@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap");

:root {
  --bg: #efefe9;
  --ink: #0b0b0b;
  --muted: #6b6b66;
  --line: #e2e2da;
  --card: #fff;
  --accent: #c6e05a;
  --accent-hover: #d4ea7a;
  --accent-deep: #3d7a32;
  --accent-ink: #0b0b0b;
  --black: #0b0b0b;
  --warn: #fff6d8;
  --err: #fde8e8;
  --ok: #eaf6d4;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(11,11,11,.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font: 16px/1.5 Outfit, "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  overscroll-behavior: none;
}
a { color: var(--accent-deep); }

.shell { padding: 10px 20px 18px; flex: 0 0 auto; }
header.top {
  background: var(--black);
  color: #fff;
  border-radius: 28px;
  padding: 12px 16px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
header.top .nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 22px; letter-spacing: -.03em;
  color: #fff; text-decoration: none;
}
header.top { margin-bottom: 20px; }
header.top nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; justify-content: flex-end; }
header.top nav .nav-icons { margin-left: auto; display: flex; align-items: center; gap: 4px; }
header.top nav a {
  color: #f2f2ec; text-decoration: none; font-size: 14px; font-weight: 500;
  padding: 8px 12px; border-radius: 999px;
}
header.top nav a:hover { background: #1c1c1c; color: #fff; }
header.top nav a.home-ico {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1c1c1c;
  color: var(--accent);
  border-radius: 12px;
  flex: 0 0 auto;
}
header.top nav a.home-ico:hover { background: #2a2a2a; color: #fff; }
header.top nav a.admin-ico {
  width: 36px; height: 36px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: #1c1c1c; color: var(--accent);
  border-radius: 12px; flex: 0 0 auto; margin-left: 0;
}
header.top nav a.admin-ico:hover { background: #2a2a2a; color: #fff; }
header.top nav a.out { background: var(--accent); color: var(--accent-ink); }
header.top nav a.out:hover { background: var(--accent-hover); color: var(--accent-ink); }
header.top nav a.video-ico {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1c1c1c;
  color: var(--accent);
  border-radius: 12px;
  flex: 0 0 auto;
}
header.top nav a.admin-ico + a.video-ico { margin-left: 0; }
header.top nav a.chatz-ico {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1c1c1c;
  color: var(--accent);
  border-radius: 12px;
  flex: 0 0 auto;
}
header.top nav a.chatz-ico:hover { background: #2a2a2a; color: #fff; }
header.top nav a.chatz-ico.on { background: var(--accent); color: var(--accent-ink); }
header.top nav a.phone-ico {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1c1c1c;
  color: var(--accent);
  border-radius: 12px;
  flex: 0 0 auto;
}
header.top nav a.phone-ico:hover { background: #2a2a2a; color: #fff; }
header.top nav a.phone-ico.on { background: var(--accent); color: var(--accent-ink); }
.phone-centre { display: flex; justify-content: center; align-items: flex-start; }
.phone-card { width: min(640px, 100%); margin: 24px auto; text-align: center; }
.phone-card form { margin: 16px 0; }
.dial { margin: 12px 0 16px; }
.dial input { width: 100%; text-align: center; font-size: 22px; letter-spacing: .04em; }
.dial-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.dial-pad button { min-height: 56px; border-radius: 16px; font-size: 18px; line-height: 1.1; }
.dial-pad button span { display: block; font-size: 10px; letter-spacing: .08em; font-weight: 500; }
.dial-actions { display: flex; gap: 8px; }
.dial-actions button { flex: 1; }
.phone-list button { width: 100%; text-align: left; margin: 4px 0; }
.phone-log { min-height: 280px; max-height: 50vh; overflow: auto; background: #f4f4ee; border-radius: 12px; padding: 12px; }
.phone-log .mine { text-align: right; color: #3d7a32; }
.phone-thread form { display: flex; gap: 8px; margin-top: 12px; }
.phone-thread form[hidden] { display: none; }
@media (max-width: 800px) { .phone-desk { grid-template-columns: 1fr; } }
header.top nav a.video-ico { margin-left: 0; }
.acct-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.acct-head h3 { margin: 0; }
.desk { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; min-height: 70vh; margin: 0 20px 20px; align-items: stretch; }
.desk aside { margin-left: 0; }
.desk main { margin-right: 0; }
.desk aside, .desk main { background: #fff; border: 1px solid #e4e4de; border-radius: 18px; box-shadow: var(--shadow); padding: 14px; }
.desk .tools { display: flex; flex-direction: column; gap: 8px; }
.desk .tools button, .desk .tools .member-pick, .desk .tools select { width: 100%; }
.desk .log { min-height: 280px; background: #f4f4ee; border-radius: 12px; padding: 12px; }
.desk #send { display: flex; gap: 8px; margin-top: 10px; }
.desk #send[hidden] { display: none; }
.thread-pick { display: none; }
@media (max-width: 800px) {
  body.chatz-page { overflow: hidden; height: 100dvh; }
  body.chatz-page .desk {
    grid-template-columns: 1fr;
    margin: 0 10px 10px;
    height: calc(100dvh - 84px);
    min-height: 0;
  }
  body.chatz-page .desk aside .tools { flex-direction: row; flex-wrap: wrap; }
  body.chatz-page .desk aside .tools button { width: calc(50% - 4px); }
  body.chatz-page .desk aside .tools .member-pick { width: 100%; }
  body.chatz-page .thread-pick { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
  body.chatz-page .chat-tabs { display: none; }
  body.chatz-page .desk main { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
  body.chatz-page .desk h1 { font-size: 20px; }
  body.chatz-page .desk .log { flex: 1 1 auto; min-height: 0; overflow: auto; }
}
.chat-tabs button.on { background: #c6e05a; color: #0b0b0b; }
.member-invite { display: flex; gap: 8px; align-items: end; margin-bottom: 12px; }
.member-invite label { flex: 1; }
header.top nav a.chatz-ico,
header.top nav a.phone-ico,
header.top nav a.video-ico { position: relative; }
.nav-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: #d92d20; color: #fff;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
}
header.top nav a.video-ico.on { background: var(--accent); color: var(--accent-ink); }

.wrap {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 12px 20px 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
main.wrap:has(.layout) {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-width: none;
  padding-left: 20px;
  padding-right: 20px;
}
footer.wrap {
  flex: 0 0 auto;
  padding: 0 20px 10px;
  color: var(--muted);
  font-size: 13px;
}
footer.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
footer.foot p { margin: 0; }
a.terms-link {
  color: #b4b4ae;
  text-decoration: none;
  font-size: 13px;
}
a.terms-link:hover { color: #8e8e88; text-decoration: underline; }
.terms-doc h2 { margin-top: 22px; }
.terms-doc ul { margin: 0 0 12px; padding-left: 1.2em; }
.to-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 32%);
  gap: 12px;
  align-items: end;
}
@media (max-width: 700px) {
  .to-row { grid-template-columns: 1fr; }
}

h1 { margin: 0 0 8px; font-size: 32px; letter-spacing: -.04em; font-weight: 700; }
h2 { margin: 28px 0 10px; font-size: 20px; letter-spacing: -.03em; }
h3 { margin: 0 0 8px; font-size: 15px; }
.muted { color: var(--muted); }

.layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; overflow: auto; }
}
.layout > aside.panel {
  min-height: 0;
  overflow: auto;
}

.panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}
.panel nav a, .folder a, .msg {
  display: block;
  padding: 8px 10px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--ink);
}
.panel nav a:hover, .folder a:hover, .msg:hover { background: #f4f4ee; }
.panel nav a.on, .folder a.on { background: var(--black); color: #fff; }
.folder a.current { font-weight: 700; }
.folder-head { margin-top: 15px; }
.folder-item { cursor: grab; }
.folder-item.dragging { opacity: .45; }
.folder-item.drop-on { background: var(--accent); color: var(--accent-ink); }
.msg-row.dragging { opacity: .5; }
.busy-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11,11,11,.45);
}
.busy-screen[hidden] { display: none !important; }
.busy-card {
  background: #fff;
  border-radius: 18px;
  padding: 22px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow);
}
.busy-spin {
  width: 36px;
  height: 36px;
  border: 3px solid #e2e2da;
  border-top-color: #3d7a32;
  border-radius: 50%;
  animation: busy-turn .8s linear infinite;
}
@keyframes busy-turn { to { transform: rotate(360deg); } }
.mail-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.acct-sent:hover { color: var(--ink); }

.msg-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) minmax(120px, 28%);
  grid-template-rows: auto auto;
  gap: 2px 10px;
  align-items: start;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
}
.msg-check { grid-row: 1 / span 2; padding-top: 10px; }
.msg { grid-column: 2; grid-row: 1; border-radius: 0; padding: 4px 8px 0; min-width: 0; }
.msg .from { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.flag-ico { flex: 0 0 12px; width: 12px; height: 12px; }
.msg .sub, a.sub {
  display: block;
  margin-top: 2px;
  color: #161616;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  text-decoration: none;
  white-space: normal;
  overflow: visible;
}
.msg.unseen .sub, .msg.unseen + a.sub { font-weight: 700; }
.msg-date { grid-column: 3; grid-row: 1 / span 2; }
.msg-date { font-size: 12px; color: var(--muted); padding: 12px 4px 0 0; text-align: right; word-break: break-word; }
.msg-date.flagged-date, .msg-row.is-flagged .msg-date { color: #b42318; font-weight: 700; }
.ctx-menu button:disabled { opacity: .4; color: var(--muted); cursor: not-allowed; }
.ctx-menu button:disabled:hover { background: #fff; }

body.app, body { background: #efefe9; }
.inbox-main {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 10px 30px rgba(11,11,11,.08);
  padding: 16px 16px 8px;
}
.mail-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  background: #fff;
}
.inbox-main > h1 { margin: 0 0 12px; }
.row-tools {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  width: 100%;
  min-width: 0;
}
.row-tools .btn, .row-tools .icon-btn {
  flex-shrink: 0;
  padding: 8px 12px;
  font-size: 14px;
}
.tool-left, .tool-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  white-space: nowrap;
}
.tool-right { margin-left: 0; }
.tool-search { flex: 1 1 0; min-width: 0; }
.tool-search input[type="search"] { width: 100%; margin: 0; min-width: 0; padding: 8px 12px; }
.compose-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.compose-btn svg { display: block; }
.ctx-menu {
  position: absolute;
  z-index: 50;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  min-width: 140px;
  padding: 6px;
}
.ctx-menu button {
  width: 100%;
  text-align: left;
  background: #fff;
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  color: #b42318;
}
.ctx-menu button:hover { background: #fde8e8; }
.ctx-menu button.ctx-neutral { color: #161616; }
.ctx-menu button.ctx-neutral:hover { background: #f4f4ee; }
#forwardForm textarea { min-height: 90px; margin-top: 6px; }
.confirm-back {
  position: fixed; inset: 0;
  background: rgba(11,11,11,.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 60; padding: 20px;
}
.confirm-back[hidden], .ctx-menu[hidden] { display: none !important; }
.acct-line { font-size: 14px; color: var(--muted); margin: 0 0 10px; }
.select-row { display: flex; justify-content: flex-end; margin: 0 0 8px; }
.select-all { flex-direction: row; align-items: center; gap: 8px; margin: 0; }
.icon-btn {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--ink);
  border-radius: 999px; text-decoration: none; border: 0;
}
.icon-btn:hover { background: var(--accent-hover); }
.icon-btn.is-disabled, .icon-btn:disabled {
  opacity: .35; cursor: not-allowed; background: #ddd; color: #666;
}
.icon-btn.secondary-ico { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.icon-btn.secondary-ico:hover { background: #f4f4ee; }
.danger-btn { background: #fff; color: #b42318; border: 1px solid #b42318; }
.danger-btn:hover { background: #b42318; color: #fff; }
.sr-only-form { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 12px 0; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
#lbxDialogField[hidden], #lbxDialogWarn[hidden], #lbxDialogText[hidden] { display: none !important; }
input, select, textarea, button, .btn {
  font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff;
}
textarea { min-height: 180px; border-radius: 16px; width: 100%; }
button, .btn {
  background: var(--accent); color: var(--accent-ink); border-color: var(--accent);
  text-decoration: none; display: inline-block; cursor: pointer; font-weight: 600;
}
button:hover, .btn:hover { background: var(--accent-hover); }
button:disabled, .btn:disabled, #smartyGo:disabled {
  opacity: .45;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(.2);
}
.btn.secondary, button.secondary { background: #fff; color: var(--ink); border: 1px solid var(--ink); }
.file-field { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.file-label { font-size: 13px; font-weight: 500; color: var(--muted); }
.file-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  cursor: pointer;
  font-weight: 600;
}
.file-btn input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.danger { color: #b42318; }

.flash { padding: 12px 16px; border-radius: 14px; margin-bottom: 14px; }
.flash.ok { background: var(--ok); }
.flash.err { background: var(--err); }
.auth {
  max-width: 560px; margin: 48px auto; background: #fff; padding: 32px;
  border-radius: 28px; box-shadow: var(--shadow);
}
.auth-fit { margin: 12px auto; padding: 18px 20px; max-height: calc(100vh - 120px); overflow: hidden; }
.reg-form label { margin-bottom: 6px; }
.reg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.reg-actions { display: flex; gap: 12px; align-items: center; margin: 8px 0 0; }
.key-row { display: flex; align-items: center; gap: 8px; }
.qmark { border: 0; background: #0b0b0b; color: #c6e05a; border-radius: 999px; width: 22px; height: 22px; padding: 0; cursor: pointer; font-weight: 700; flex: 0 0 auto; }
.terms-row { flex-direction: row; align-items: center; gap: 8px; flex-wrap: nowrap; }
.terms-row span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.linkish { width: auto; height: auto; border: 0; background: none; color: #3d7a32; text-decoration: underline; padding: 0; cursor: pointer; font: inherit; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
body:has(.auth-fit) { overflow: hidden; }
body:has(.auth-fit) footer { display: none; }
@media (max-width: 700px) { .reg-grid { grid-template-columns: 1fr; } body:has(.auth-fit) { overflow: auto; } }
.letter { background: #fff; border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.letter + .letter { margin-top: 24px; }
.letter .hdr { border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 16px; }
.letter pre { white-space: pre-wrap; font: inherit; margin: 0; }
.mail-text {
  font: 16px/1.5 Outfit, "Segoe UI", system-ui, sans-serif;
  color: #161616;
}
.mail-text p { margin: 0 0 10px; }
.mail-html {
  max-width: 100%;
  overflow-x: auto;
  color: #161616;
  font: 16px/1.5 Outfit, "Segoe UI", system-ui, sans-serif;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.mail-html p, .mail-html div, .mail-html li { color: #161616; }
.mail-html p { margin: 0 0 10px; }
.mail-html div { margin: 0; }
.mail-html br + br { display: none; }
.mail-html h1, .mail-html h2, .mail-html h3 { color: #0b0b0b; line-height: 1.25; margin: 16px 0 8px; }
.mail-html a { color: #3d7a32; }
.mail-html img { max-width: 100%; height: auto; display: block; margin: 10px 0; border-radius: 8px; }
.mail-html table { width: 100%; max-width: 100%; border-collapse: collapse; font-size: 15px; }
.mail-html td, .mail-html th { padding: 6px 8px; vertical-align: top; word-break: break-word; }
.mail-html blockquote {
  margin: 12px 0;
  padding: 8px 12px;
  border-left: 3px solid #c6e05a;
  color: #333;
  background: #fafaf6;
}
code { font-size: 13px; background: #ecece6; padding: 1px 6px; border-radius: 6px; }

.install-hint {
  display: none !important;
  background: var(--black);
  color: #fff;
  border-radius: 16px;
  padding: 10px 14px;
  margin: 0 0 16px;
  font-size: 14px;
}
.install-hint button { margin: 0; }
@media (max-width: 640px) and (hover: none) {
  .install-hint.show {
    display: flex !important;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
  }
}
.compose-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
}
.compose-head h1 { margin: 0; }
.smarty-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--black);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
}
.smarty-btn:hover { background: #222; color: #fff; }
.smarty-face { font-size: 18px; line-height: 1; color: var(--accent); }
.modal-back {
  position: fixed; inset: 0;
  background: rgba(11,11,11,.55);
  display: none;
  align-items: center; justify-content: center;
  z-index: 9999; padding: 20px;
}
.modal-back.is-open,
.modal-back:not([hidden]) { display: flex; }
.modal-back[hidden] { display: none !important; }
.modal {
  background: #fff;
  border-radius: 22px;
  padding: 22px;
  width: min(520px, 100%);
  max-height: min(88vh, 760px);
  overflow: auto;
  box-shadow: var(--shadow);
}
.modal h2 { margin: 0 0 6px; }
.smarty-pager { display: flex; gap: 8px; align-items: center; margin: 8px 0 12px; font-size: 13px; color: var(--muted); }
.smarty-pager span.on { color: var(--ink); font-weight: 700; }
.smarty-page[hidden] { display: none !important; }
.smarty-form[hidden] { display: none !important; }
.smarty-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.smarty-page.page-incomplete, .smarty-form.page-incomplete {
  outline: 2px solid #b42318;
  outline-offset: 6px;
  border-radius: 16px;
}
label.is-empty { color: #b42318; }
input.is-empty, textarea.is-empty, select.is-empty {
  border-color: #b42318;
  background: #fff5f5;
}

@media print {
  header.top, .shell, .layout aside, .row-tools, .install-hint, footer, .no-print { display: none !important; }
  body, .wrap, .letter { background: #fff; box-shadow: none; }
}

.contact-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 10px 0 14px;
}
.contact-toolbar-bottom { margin-top: 14px; }
.contact-toolbar .tool-left, .contact-toolbar .tool-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.contact-toolbar .tool-right { margin-left: auto; }
.contact-go { padding: 8px 14px; font-size: 13px; }

.nav-toggle, .side-toggle { display: none; }

@media (max-width: 800px) {
  html, body {
    overflow: hidden;
    height: 100dvh;
    max-height: 100dvh;
    min-height: 100dvh;
  }
  .shell { padding: 8px 8px 0; }
  .wrap { padding: 10px 8px 12px; overflow: auto; -webkit-overflow-scrolling: touch; }
  main.wrap:has(.layout) {
    overflow: auto;
    min-height: 0;
  }
  header.top {
    border-radius: 16px;
    padding: 8px 10px;
    position: relative;
  }
  header.top .nav {
    flex-wrap: nowrap;
    gap: 8px;
  }
  .brand { font-size: 18px; min-width: 0; }
  .nav-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 40px;
    height: 40px;
    margin-left: auto;
    background: #1c1c1c;
    border: 0;
    border-radius: 12px;
    padding: 10px;
    cursor: pointer;
  }
  .nav-toggle span {
    display: block;
    height: 2px;
    background: #fff;
    border-radius: 2px;
  }
  header.top nav {
    display: none;
    position: absolute;
    left: 8px;
    right: 8px;
    top: calc(100% + 6px);
    background: #111;
    border-radius: 16px;
    padding: 8px;
    flex-direction: column;
    z-index: 80;
    box-shadow: var(--shadow);
  }
  body.nav-open header.top nav { display: flex; }
  header.top nav .nav-icons {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    margin-left: 0;
    gap: 6px;
  }
  header.top nav a,
  header.top nav a.home-ico,
  header.top nav a.chatz-ico,
  header.top nav a.phone-ico,
  header.top nav a.video-ico,
  header.top nav a.admin-ico,
  header.top nav a.out {
    width: 100%;
    height: auto;
    margin-left: 0;
    justify-content: flex-start;
    padding: 12px 14px;
  }
  .wrap { padding: 10px 12px 12px; overflow: auto; background: transparent; }
  main.wrap:has(.layout) {
    overflow: auto;
    min-height: 0;
    background: transparent;
  }
  footer.wrap { padding: 0 12px 16px; flex-wrap: wrap; }
  h1 { font-size: 24px; }
  .layout {
    grid-template-columns: 1fr;
    overflow: visible;
    gap: 12px;
  }
  .side-toggle {
    display: block;
    width: 100%;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    font-weight: 600;
    margin: 0 0 8px;
    min-height: 44px;
  }
  .layout > aside.panel {
    overflow: hidden;
    padding: 10px;
    background: #fff;
  }
  .layout > aside.panel .side-body { display: none; }
  .layout > aside.panel.side-open .side-body {
    display: block;
    max-height: 36vh;
    overflow: auto;
  }
  .inbox-main {
    overflow: visible;
    min-height: 0;
    background: #fff;
    border-radius: 18px;
    padding: 12px;
  }
  .mail-list {
    max-height: none;
    min-height: 0;
    overflow: visible;
    background: #fff;
  }
  .row-tools { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
  .tool-left, .tool-right { display: flex; flex-wrap: wrap; width: 100%; margin: 0; gap: 8px; }
.icon-btn.danger-ico { background: #fff; border: 1px solid #f0c2c2; color: #b42318; }
.icon-btn.danger-ico:hover { background: #fde8e8; }
  .tool-left { justify-content: flex-start; }
  .tool-right { justify-content: flex-end; }
  .row-tools .icon-btn, .row-tools .btn, .inbox-search button, .compose-send button, .compose-send a {
    min-height: 44px;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .mail-actions .btn { flex: 1 1 120px; }
  .inbox-search { align-items: stretch; }
  .inbox-search input { min-height: 44px; }
  .compose-head { align-items: stretch; }
  .compose-send { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; margin: 8px 0 0; }
  body.chatz-page .desk aside .tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  body.chatz-page .desk aside .tools button { width: 100%; min-height: 44px; }
  header.top nav a { min-height: 44px; display: flex; align-items: center; }
  .home-bar nav a { min-height: 44px; display: flex; align-items: center; justify-content: center; }
  .tool-search { flex: 1 1 100%; order: 3; }
  .msg-row {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 4px 8px;
    background: #fafaf7;
    border: 1px solid #eee;
    border-radius: 14px;
    padding: 10px 8px;
    margin: 0 0 8px;
  }
  .msg-date { grid-column: 2; font-size: 11px; padding-top: 2px; text-align: left; }
  .letter, .auth { padding: 16px; margin: 0; background: #fff; }
  .auth { margin: 16px auto; }
  .modal { width: 100%; max-height: 92dvh; }
  .contact-toolbar { flex-direction: column; align-items: stretch; }
  .contact-toolbar .tool-right { margin-left: 0; width: 100%; }
}

.mail-frame {
  display: block;
  width: 100%;
  min-height: 70vh;
  height: 70vh;
  border: 0;
  background: #fff;
  border-radius: 12px;
}

.mail-files {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.mail-files h2 {
  margin: 0 0 10px;
  font-size: 16px;
}
.mail-file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mail-file-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #f6f6f1;
  border-radius: 12px;
  padding: 10px 12px;
}
a.mail-file {
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
a.mail-file:hover { color: var(--accent-deep); text-decoration: underline; }

.meet { position: relative; }
.meet-status {
  margin: 6px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f4f4ee;
  color: #161616;
  font-size: 14px;
}
.meet-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.meet-clocks { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.meet-timer { font-weight: 700; background: #0b0b0b; color: #c6e05a; border-radius: 999px; padding: 6px 12px; }
.meet-limit { font-weight: 700; color: #b42318; background: #fde8e8; border-radius: 999px; padding: 6px 12px; }
.meet-stage {
  margin-top: 12px;
  min-height: 360px;
  background: #111;
  border-radius: 22px;
  padding: 12px 96px 12px 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  position: relative;
  max-height: 520px;
  overflow: auto;
}
.meet-bgrail {
  position: absolute;
  top: 12px;
  right: 8px;
  bottom: 12px;
  width: 76px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 4;
}
.meet-bgrail button {
  border: 2px solid transparent;
  border-radius: 10px;
  background: #1c1c1c;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px;
  cursor: pointer;
}
.meet-bgrail button.on { border-color: #c6e05a; }
.meet-bgrail .swatch {
  display: block;
  height: 40px;
  border-radius: 7px;
  background-size: cover;
  background-position: center;
}
.meet-empty { color: #d7d7d0; padding: 48px 16px; text-align: center; grid-column: 1 / -1; }
.meet-stage:has(.meet-tile:only-of-type) .meet-tile { grid-column: 1 / -1; }
.meet-tile {
  position: relative;
  background: #1c1c1c;
  border-radius: 16px;
  min-height: 220px;
  overflow: hidden;
  border: 2px solid transparent;
}
.meet-tile.speaking { border-color: #c6e05a; }
.meet-tile video { width: 100%; height: 100%; min-height: 240px; object-fit: contain; background: #111; display: block; }
.meet-tile.no-video video { opacity: 0; }
.meet-avatar {
  position: absolute; inset: 0 0 36px;
  display: none; align-items: center; justify-content: center;
  font-size: 42px; font-weight: 700; color: #0b0b0b; background: #c6e05a;
}
.meet-tile.no-video .meet-avatar { display: flex; }
.meet-tag {
  position: absolute; left: 8px; right: 8px; bottom: 8px;
  display: flex; justify-content: space-between; gap: 8px;
  color: #fff; font-size: 13px; text-shadow: 0 1px 2px #000;
}
.meet-float { position: absolute; top: 10px; right: 10px; font-size: 28px; }
.meet-linkbox, .meet-invite {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-top: 12px;
}
.meet-linkbox label, .meet-invite label { flex: 1 1 260px; }
.meet-linkbox input, .meet-invite input { width: 100%; }
.meet-sent { list-style: none; margin: 0; padding: 0; width: 100%; }
.meet-sent li { font-size: 14px; color: #3d7a32; }
.meet-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
#meetStart { margin-top: 10px; position: relative; z-index: 30; }
.meet-ctl {
  background: #0b0b0b; color: #fff; border: 0; border-radius: 999px;
  padding: 8px 14px; font-weight: 600; cursor: pointer;
}
.meet-ctl.off, .meet-ctl.danger { background: #b42318; }
.meet-ctl:disabled, #meetStart:disabled { opacity: .45; cursor: not-allowed; }
.meet-side {
  position: absolute; right: 0; top: 72px; width: min(320px, 100%);
  background: #fff; border-radius: 18px; box-shadow: var(--shadow); padding: 12px; z-index: 5;
}
.meet-side-head { display: flex; justify-content: space-between; align-items: center; }
.meet-people { list-style: none; margin: 10px 0 0; padding: 0; }
.meet-people li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.meet-log { max-height: 240px; overflow: auto; margin: 8px 0; }
.meet-log p { margin: 0 0 8px; }
.meet-chat form { display: flex; gap: 8px; }
.meet-chat input { flex: 1; }
.meet-reacts {
  position: absolute; bottom: 64px; left: 16px;
  background: #fff; border-radius: 999px; padding: 8px; display: flex; gap: 6px;
  box-shadow: var(--shadow); z-index: 6;
}
.meet-reacts button { border: 0; background: #f4f4ee; border-radius: 999px; font-size: 22px; cursor: pointer; }
@media (max-width: 800px) {
  .meet { max-width: 100%; }
  .meet-top { flex-direction: column; align-items: stretch; }
  .meet-clocks { order: -1; margin-left: 0; width: 100%; justify-content: flex-end; flex-wrap: wrap; }
  .meet-status, .meet-empty, #meetInviteNote { display: none; }
  .meet h1 { font-size: 24px; margin-top: 8px; }
  .meet-stage {
    min-height: 0;
    max-height: none;
    padding: 8px;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .meet-tile { min-height: 0; overflow: hidden; }
  .meet-tile video { width: 100%; height: auto; min-height: 0; max-height: 70vh; object-fit: contain; }
  .meet-bgrail {
    position: static;
    width: 100%;
    height: auto;
    flex-direction: row;
    overflow: auto;
    margin-top: 8px;
  }
  .meet-bgrail button { flex: 0 0 72px; }
  .meet-bar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .meet-ctl { width: 100%; min-height: 44px; }
  .meet-linkbox, .meet-invite { display: flex; flex-direction: column; align-items: stretch; }
  .meet-side { position: static; width: 100%; margin-top: 12px; }
}
@media (max-width: 900px) and (orientation: landscape) {
  .meet-stage { grid-template-columns: 1fr; max-height: 70vh; }
  .meet-tile video { width: 100%; height: 62vh; min-height: 0; max-height: 62vh; object-fit: contain; }
}
.home { background: #0b0b0b; color: #f4f4ee; }
.home-hero { position: relative; min-height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.home-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.home-bar, .home-copy { position: relative; z-index: 1; }
.home-bar { display: flex; justify-content: space-between; align-items: center; padding: 18px 24px; }
.home-bar nav { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.home-build { margin-left: 12px; color: #c6e05a; font-size: 13px; font-weight: 700; }
.home-bar a, .home-copy a { color: #fff; text-decoration: none; font-weight: 600; }
.home-join { background: #c6e05a; color: #0b0b0b !important; border-radius: 999px; padding: 10px 16px; }
.home-copy { margin-top: auto; padding: 48px 24px 64px; max-width: 760px; text-shadow: 0 2px 16px #0b0b0b; }
.home-copy h1 { font-size: 56px; line-height: 1; color: #fff; }
.home-kicker { color: #c6e05a; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.home-actions { display: flex; gap: 12px; align-items: center; }
.home-about { background: #0b0b0b url("home-poster.jpg") center/cover no-repeat; color: #fff; padding: 0 0 64px; position: relative; z-index: 2; }
.about-bar { margin: 18px 18px 0; }
.about-bar .home-ico { margin-left: auto; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; background: #1c1c1c; color: #c6e05a; border-radius: 12px; }
.about-inner { max-width: 720px; margin: 0 auto; padding: 28px 24px 0; text-align: center; }
.home-about h2 { font-size: 36px; color: #fff; text-shadow: 0 2px 12px #0b0b0b; }
.home-grid { display: flex; flex-direction: column; align-items: center; gap: 16px; margin: 24px auto; max-width: 720px; }
.home-grid article { background: #fff; color: #161616; border-radius: 18px; padding: 16px; border-top: 6px solid #c6e05a; width: min(520px, 100%); text-align: left; }
.home-about .home-actions { justify-content: center; }
.home-about .home-join { display: inline-block; }
.home-foot { background: #0b0b0b; color: #f4f4ee; padding: 16px 24px; position: relative; z-index: 2; }
.inbox-search { display: flex; gap: 8px; margin: 0 0 12px; }
.inbox-search input { flex: 1; }
.compose-send { margin: 0; }
@media (max-width: 800px) {
  .home-hero { overflow: visible; min-height: 100dvh; }
  .home-bar { padding: 12px 14px; position: relative; }
  .home-bar .nav-toggle { display: inline-flex; margin-left: auto; background: #1c1c1c; }
  .home-bar nav {
    display: none;
    position: absolute;
    left: 12px;
    right: 12px;
    top: calc(100% + 8px);
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    margin: 0;
    background: #111;
    border-radius: 16px;
    padding: 8px;
    z-index: 6;
  }
  body.nav-open .home-hero .home-bar nav,
  body.about-open .about-bar nav { display: flex; }
  .home-bar nav a, .home-build { width: 100%; margin: 0; text-align: left; }
  .home-copy { padding: 28px 16px 40px; }
  .home-copy h1 { font-size: 34px; }
  .home-actions { flex-wrap: wrap; }
  .about-inner { padding: 20px 14px 0; }
  .home-grid article { width: 100%; }
  .home-foot { padding: 16px; }
}

