:root {
  --ink: #18201d;
  --muted: #7c8581;
  --line: #e5e9e7;
  --green: #16634d;
  --green-dark: #104b3b;
  --green-soft: #e8f2ed;
  --cream: #f5f6f2;
  --paper: #ffffff;
  --shadow: 0 28px 80px rgba(20, 42, 34, 0.14);
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-geist-sans), Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; }
button { color: inherit; }

button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(22, 99, 77, 0.25);
  outline-offset: 2px;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 54px 24px 76px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(rgba(245, 246, 242, 0.82), rgba(245, 246, 242, 0.94)),
    radial-gradient(circle at 20% 20%, #cdded5 0 1px, transparent 1px);
  background-size: auto, 26px 26px;
}

.login-page::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0 48%, rgba(22, 99, 77, 0.025) 48% 52%, transparent 52% 100%);
  pointer-events: none;
}

.login-orb { position: absolute; border-radius: 50%; filter: blur(2px); opacity: .38; }
.login-orb-one { width: 420px; height: 420px; left: -180px; top: -190px; background: #b9d8c9; }
.login-orb-two { width: 360px; height: 360px; right: -170px; bottom: -180px; background: #d8e3c6; }

.login-card {
  width: min(100%, 472px);
  padding: 42px 46px 34px;
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(218, 225, 221, .92);
  border-radius: 28px;
  box-shadow: var(--shadow);
  position: relative;
  z-index: 2;
  backdrop-filter: blur(22px);
}

.brand { display: flex; align-items: center; gap: 12px; font-size: 24px; font-weight: 720; letter-spacing: -1px; }
.brand-login { justify-content: center; margin-bottom: 42px; }

.lock-mark { width: 38px; height: 38px; display: inline-grid; place-items: center; position: relative; flex: 0 0 auto; }
.lock-shackle { width: 18px; height: 15px; border: 2px solid var(--green); border-bottom: 0; border-radius: 9px 9px 0 0; position: absolute; top: 4px; }
.lock-body { width: 26px; height: 22px; background: var(--green); border-radius: 7px; display: grid; place-items: center; position: absolute; bottom: 2px; box-shadow: 0 4px 10px rgba(22,99,77,.16); }
.lock-body span { width: 4px; height: 7px; border-radius: 4px; background: white; }
.lock-mark-small { width: 22px; height: 22px; transform: scale(.62); transform-origin: center; margin: -5px; }

.login-heading { text-align: center; margin-bottom: 30px; }
.eyebrow, .section-kicker { margin: 0 0 12px; font-family: var(--font-geist-mono), monospace; font-size: 10px; font-weight: 700; letter-spacing: 1.8px; color: var(--green); }
.login-heading h1 { margin: 0; font-size: 36px; letter-spacing: -1.7px; font-weight: 640; }
.login-heading > p:last-child { margin: 12px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }

.login-form { display: flex; flex-direction: column; gap: 17px; }
.login-form label > span, .modal-card form label > span { display: block; margin: 0 0 8px; font-size: 12px; font-weight: 650; }
.input-shell, .username-field { height: 51px; border: 1px solid #dce2df; border-radius: 12px; display: flex; align-items: center; background: #fbfcfb; transition: .2s ease; }
.input-shell:focus-within, .username-field:focus-within { border-color: var(--green); box-shadow: 0 0 0 4px rgba(22, 99, 77, .08); background: white; }
.input-shell input, .username-field input { min-width: 0; flex: 1; height: 100%; border: 0; outline: 0; background: transparent; }
.field-symbol { width: 42px; text-align: center; color: #8a9490; font-weight: 700; }
.key-symbol { font-size: 9px; }
.show-password, .text-button { border: 0; background: transparent; color: var(--green); font-size: 12px; font-weight: 650; cursor: pointer; padding: 10px 14px; }
.login-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.remember-label { display: flex; align-items: center; gap: 8px; color: #69736f; font-size: 12px; cursor: pointer; }
.remember-label input { accent-color: var(--green); }
.primary-button { height: 50px; padding: 0 22px; border: 0; border-radius: 12px; background: var(--green); color: white; font-size: 13px; font-weight: 680; display: flex; align-items: center; justify-content: center; gap: 14px; cursor: pointer; box-shadow: 0 8px 20px rgba(22,99,77,.16); transition: .2s ease; }
.primary-button:hover { background: var(--green-dark); transform: translateY(-1px); }
.login-button { margin-top: 4px; width: 100%; }
.login-button span, .primary-button > span { font-size: 19px; font-weight: 400; }
.form-error { margin: -4px 0 0; color: #a23a3a; font-size: 12px; line-height: 1.4; }
.login-security { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; justify-content: center; gap: 12px; color: #55605b; }
.login-security div { display: flex; flex-direction: column; gap: 3px; }
.login-security strong { font-size: 11px; color: var(--ink); }
.login-security span { font-size: 10px; }
.demo-note { margin: 20px 0 0; text-align: center; color: #929a96; font-size: 10px; }
.login-footer { position: absolute; bottom: 22px; margin: 0; color: #7f8884; font-family: var(--font-geist-mono), monospace; font-size: 9px; letter-spacing: .9px; }

.app-shell { width: 100%; height: 100dvh; display: grid; grid-template-columns: 360px 1fr; background: var(--paper); overflow: hidden; }
.sidebar { border-right: 1px solid var(--line); background: #fafbf9; display: flex; flex-direction: column; min-width: 0; position: relative; z-index: 3; }
.sidebar-header { height: 82px; display: flex; align-items: center; justify-content: space-between; padding: 0 26px; border-bottom: 1px solid var(--line); position: relative; }
.avatar { width: 45px; height: 45px; border-radius: 15px; display: grid; place-items: center; flex: 0 0 auto; font-size: 12px; font-weight: 720; letter-spacing: -.3px; border: 0; }
.avatar-me { width: 38px; height: 38px; border-radius: 50%; background: #183f34; color: #dfeee6; cursor: pointer; }
.avatar-violet { background: #eee9f7; color: #694b8c; }
.avatar-blue { background: #e4eef5; color: #356681; }
.avatar-coral { background: #f8e9e4; color: #9b5948; }
.avatar-green { background: #e1eee6; color: #397259; }
.avatar-amber { background: #f5ecd9; color: #936d2f; }
.avatar-pink { background: #f4e5ed; color: #8e4f71; }
.contact-title-row { padding: 27px 25px 19px; display: flex; align-items: flex-end; justify-content: space-between; }
.contact-title-row .section-kicker { margin-bottom: 7px; }
.contact-title-row h2 { margin: 0; font-size: 24px; letter-spacing: -1px; }
.contact-title-row h2 span { display: inline-grid; place-items: center; min-width: 24px; height: 20px; margin-left: 7px; padding: 0 6px; border-radius: 8px; background: var(--green-soft); color: var(--green); font-family: var(--font-geist-mono), monospace; font-size: 10px; vertical-align: 4px; }
.add-button { width: 37px; height: 37px; border-radius: 50%; border: 0; background: var(--green); color: white; font-size: 25px; line-height: 1; font-weight: 300; cursor: pointer; box-shadow: 0 6px 16px rgba(22,99,77,.16); transition: .2s ease; }
.add-button:hover { transform: rotate(90deg); background: var(--green-dark); }
.search-box { height: 43px; margin: 0 21px 13px; border: 1px solid var(--line); background: white; border-radius: 12px; display: flex; align-items: center; padding: 0 11px; gap: 10px; }
.search-symbol { width: 13px; height: 13px; border: 1.8px solid #87918c; border-radius: 50%; position: relative; }
.search-symbol::after { content: ""; position: absolute; width: 5px; height: 2px; background: #87918c; transform: rotate(45deg); right: -4px; bottom: -2px; border-radius: 2px; }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 12px; }
.search-box input::placeholder { color: #a2aaa6; }
.search-box kbd { border: 1px solid #e2e6e4; border-radius: 5px; padding: 3px 5px; color: #939b97; font-family: var(--font-geist-mono), monospace; font-size: 8px; }
.notification-prompt { margin: 0 21px 12px; min-height: 58px; border: 1px solid #d8e5df; border-radius: 13px; padding: 9px 11px; background: #edf5f1; color: var(--ink); display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer; }
.notification-prompt:disabled { opacity: .65; cursor: wait; }
.notification-prompt.denied { background: #f7eeee; border-color: #ecd6d6; }
.notification-bell { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; background: var(--green); color: white; font-size: 8px; box-shadow: 0 4px 12px rgba(22,99,77,.18); }
.notification-prompt.denied .notification-bell { background: #9b5a5a; }
.notification-prompt > span:nth-child(2) { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.notification-prompt strong { font-size: 10px; }
.notification-prompt small { color: var(--muted); font-size: 8px; line-height: 1.35; }
.notification-prompt > span:last-child { color: #7d8883; font-size: 17px; }

.contact-list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 11px 8px; }
.contact-row { width: 100%; min-height: 72px; border: 0; background: transparent; border-radius: 14px; padding: 11px 12px; display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer; transition: .15s ease; }
.contact-row:hover { background: #f1f4f1; }
.contact-row.active { background: #eaf1ed; }
.contact-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 7px; }
.contact-name-row, .contact-message-row { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.contact-name-row strong { font-size: 13px; }
.contact-name-row time { color: #949c98; font-size: 9px; }
.contact-message-row > span { color: #838b87; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contact-message-row b { width: 18px; height: 18px; display: grid; place-items: center; background: var(--green); color: white; border-radius: 50%; font-family: var(--font-geist-mono), monospace; font-size: 8px; }
.empty-search { padding: 50px 20px; color: var(--muted); text-align: center; font-size: 12px; }
.security-status { margin: 10px 18px 17px; border: 1px solid #dfe7e3; background: white; border-radius: 13px; min-height: 59px; display: flex; align-items: center; gap: 12px; padding: 10px 12px; cursor: pointer; text-align: left; }
.shield-dot { width: 32px; height: 32px; border-radius: 10px; background: var(--green-soft); display: grid; place-items: center; }
.security-status > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.security-status strong { font-size: 10px; }
.security-status small { color: #8c9490; font-size: 9px; }
.security-status > span:last-child { color: #8b9490; }

.chat-panel { min-width: 0; display: grid; grid-template-rows: 82px 1fr auto; background: #f7f8f5; }
.chat-header { background: rgba(255,255,255,.88); backdrop-filter: blur(18px); display: flex; align-items: center; padding: 0 28px; border-bottom: 1px solid var(--line); z-index: 2; }
.chat-header .avatar { margin-right: 13px; }
.chat-person { display: flex; flex-direction: column; gap: 4px; }
.chat-person strong { font-size: 14px; }
.chat-person span { color: #7b8580; font-size: 10px; }
.chat-person i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #50a678; margin-right: 4px; }
.chat-person i.offline { background: #aab2ae; }
.chat-actions { margin-left: auto; display: flex; gap: 8px; }
.chat-actions button { width: 36px; height: 36px; border: 1px solid var(--line); background: white; border-radius: 11px; color: #65706a; cursor: pointer; font-weight: 700; }
.mobile-back { display: none; }
.message-area { min-height: 0; overflow-y: auto; padding: 22px max(30px, 8vw) 26px; background-image: radial-gradient(#dbe1dc 0.65px, transparent 0.65px); background-size: 20px 20px; }
.encryption-note { width: fit-content; margin: 0 auto 23px; border: 1px solid #dfe6e2; border-radius: 20px; background: rgba(255,255,255,.82); color: #7f8984; padding: 7px 13px; display: flex; align-items: center; gap: 9px; font-size: 9px; backdrop-filter: blur(10px); }
.date-divider { display: flex; align-items: center; gap: 12px; color: #9aa29e; font-family: var(--font-geist-mono), monospace; font-size: 8px; letter-spacing: 1.2px; margin: 0 0 25px; }
.date-divider::before, .date-divider::after { content: ""; height: 1px; flex: 1; background: #e2e6e3; }
.messages { width: min(100%, 760px); margin: 0 auto; }
.message-line { display: flex; margin: 8px 0; }
.message-line.me { justify-content: flex-end; }
.bubble { max-width: min(72%, 500px); padding: 11px 14px 8px; border-radius: 16px 16px 16px 4px; background: white; box-shadow: 0 3px 10px rgba(31,50,42,.055); border: 1px solid rgba(226,231,228,.8); }
.message-line.me .bubble { color: white; background: var(--green); border-color: transparent; border-radius: 16px 16px 4px 16px; }
.bubble p { margin: 0; font-size: 12px; line-height: 1.52; }
.message-meta { display: flex; align-items: center; justify-content: flex-end; gap: 5px; margin: 5px 0 -2px 16px; color: #9ba39f; font-size: 8px; }
.message-line.me .message-meta { color: rgba(255,255,255,.64); }
.ticks { font-size: 9px; letter-spacing: -3px; padding-right: 3px; color: #a6d7c2; }
.attachment-bubble { min-width: 270px; }
.file-card { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.11); border: 1px solid rgba(255,255,255,.14); border-radius: 11px; padding: 10px; }
.file-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: rgba(255,255,255,.15); font-size: 17px; }
.file-card > span:last-child { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.file-card strong { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.file-card small { color: rgba(255,255,255,.63); font-size: 8px; }
.sent-image { margin: -5px -8px 0; }
.sent-image img { width: min(320px, 100%); max-height: 260px; object-fit: cover; display: block; border-radius: 12px; }
.sent-image > span { display: block; max-width: 260px; margin: 7px 4px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; color: rgba(255,255,255,.72); }
.once-photo, .once-consumed { width: 100%; min-width: 235px; border: 1px solid rgba(255,255,255,.2); border-radius: 11px; padding: 10px; color: white; background: rgba(255,255,255,.1); display: grid; grid-template-columns: 36px 1fr; grid-template-rows: auto auto; column-gap: 10px; text-align: left; cursor: pointer; }
.once-photo > span, .once-consumed > span { grid-row: 1 / 3; width: 34px; height: 34px; display: grid; place-items: center; border: 1.5px solid rgba(255,255,255,.75); border-radius: 50%; font-family: var(--font-geist-mono), monospace; }
.once-photo strong, .once-consumed strong { font-size: 10px; align-self: end; }
.once-photo small { color: rgba(255,255,255,.65); font-size: 8px; align-self: start; }
.once-consumed { align-items: center; grid-template-rows: 1fr; opacity: .65; cursor: default; }

.file-card { color: inherit; text-decoration: none; }
.message-line.them .file-card, .message-line.them .once-photo, .message-line.them .once-consumed { color: var(--ink); background: #f3f6f4; border-color: #e1e7e3; }
.message-line.them .file-icon { background: #e3ede8; color: var(--green); }
.message-line.them .file-card small, .message-line.them .once-photo small { color: var(--muted); }
.message-line.them .once-photo > span, .message-line.them .once-consumed > span { border-color: #92a49c; }
.message-line.them .sent-image > span { color: var(--muted); }

.composer-wrap { background: rgba(255,255,255,.9); border-top: 1px solid var(--line); padding: 15px max(24px, 6vw) 12px; backdrop-filter: blur(18px); }
.composer { height: 50px; max-width: 900px; margin: 0 auto; display: flex; align-items: center; gap: 8px; border: 1px solid #dfe5e1; border-radius: 15px; padding: 0 7px; background: white; position: relative; box-shadow: 0 7px 24px rgba(32,49,42,.05); }
.attach-button, .emoji-button { width: 34px; height: 34px; flex: 0 0 auto; border: 0; background: transparent; color: #7d8782; cursor: pointer; border-radius: 10px; }
.attach-button { font-size: 24px; font-weight: 300; }
.emoji-button { font-size: 18px; }
.composer textarea { height: 36px; flex: 1; min-width: 0; resize: none; border: 0; outline: 0; padding: 9px 4px; background: transparent; font-size: 12px; line-height: 18px; }
.composer textarea::placeholder { color: #a1a9a5; }
.send-button { width: 36px; height: 36px; flex: 0 0 auto; border: 0; border-radius: 11px; background: #e7ece9; color: #98a29d; font-size: 17px; cursor: pointer; transition: .2s ease; }
.send-button.ready { background: var(--green); color: white; transform: rotate(45deg); }
.composer-wrap > p { margin: 7px 0 0; display: flex; align-items: center; justify-content: center; gap: 8px; color: #9aa29e; font-size: 8px; }
.hidden-input { display: none; }

.floating-menu { position: absolute; z-index: 20; border: 1px solid var(--line); border-radius: 15px; background: white; box-shadow: 0 20px 52px rgba(25,46,37,.16); padding: 7px; }
.profile-menu { top: 68px; right: 18px; width: 230px; }
.profile-summary { display: flex; align-items: center; gap: 11px; padding: 11px 10px 14px; border-bottom: 1px solid var(--line); margin-bottom: 5px; }
.profile-summary > div { display: flex; flex-direction: column; gap: 3px; }
.profile-summary strong { font-size: 11px; }
.profile-summary div span { color: var(--muted); font-size: 9px; }
.profile-menu > button { width: 100%; border: 0; background: transparent; display: flex; justify-content: space-between; padding: 11px 10px; border-radius: 9px; font-size: 10px; cursor: pointer; }
.profile-menu > button:hover { background: #f3f6f4; }
.attach-menu { bottom: 58px; left: -3px; width: 235px; }
.attach-menu button { width: 100%; border: 0; background: transparent; display: flex; align-items: center; gap: 11px; padding: 9px; border-radius: 10px; cursor: pointer; text-align: left; }
.attach-menu button:hover { background: #f3f6f4; }
.attach-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-size: 15px; }
.document-icon { background: #e8eff6; color: #47708b; }
.image-icon { background: #e8f1ec; color: #41765d; }
.once-icon { background: #f3eaf3; color: #815681; border: 1.5px solid #ab84ab; border-radius: 50%; font-family: var(--font-geist-mono), monospace; font-size: 10px; }
.attach-menu button > span:last-child { display: flex; flex-direction: column; gap: 3px; }
.attach-menu strong { font-size: 10px; }
.attach-menu small { color: #8a938f; font-size: 8px; }

.modal-backdrop { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(17,31,26,.42); backdrop-filter: blur(8px); animation: fade-in .18s ease; }
.modal-card { width: min(100%, 455px); max-height: calc(100dvh - 40px); overflow-y: auto; border: 1px solid rgba(255,255,255,.8); border-radius: 24px; padding: 36px; background: white; box-shadow: 0 30px 80px rgba(15,35,27,.3); position: relative; animation: rise-in .23s ease; }
.modal-close { position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 50%; background: white; color: #7f8884; font-size: 19px; cursor: pointer; }
.modal-icon { width: 46px; height: 46px; display: grid; place-items: center; margin-bottom: 24px; background: var(--green-soft); color: var(--green); border-radius: 14px; font-size: 27px; font-weight: 300; }
.modal-card .section-kicker { margin-bottom: 9px; }
.modal-card h2 { margin: 0; font-size: 26px; letter-spacing: -1.1px; }
.modal-card > p:not(.section-kicker):not(.security-intro) { color: var(--muted); margin: 9px 0 25px; font-size: 12px; }
.modal-card form { display: flex; flex-direction: column; gap: 16px; }
.modal-card form label input { width: 100%; height: 49px; border: 1px solid #dce2df; border-radius: 11px; padding: 0 14px; outline: none; background: #fbfcfb; font-size: 12px; }
.modal-card form label > input:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(22,99,77,.08); background: white; }
.username-field input { border: 0 !important; box-shadow: none !important; padding-left: 5px !important; }
.username-field b { padding-left: 14px; color: #7f8984; font-size: 12px; }
.modal-card form .primary-button { width: 100%; margin-top: 4px; }
.modal-footnote { display: block; margin-top: 18px; text-align: center; color: #969e9a; font-size: 9px; }
.security-modal > .lock-mark { margin-bottom: 23px; }
.security-intro { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 12px 0 22px; }
.security-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 22px; }
.security-grid div { border: 1px solid var(--line); border-radius: 13px; padding: 14px; }
.security-grid span { display: block; color: var(--green); font-family: var(--font-geist-mono), monospace; font-size: 8px; margin-bottom: 12px; }
.security-grid strong { font-size: 10px; }
.security-grid p { margin: 6px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.security-modal .primary-button { width: 100%; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: calc(100% - 32px); border: 1px solid rgba(255,255,255,.12); border-radius: 12px; padding: 11px 16px; background: #173f33; color: white; box-shadow: 0 12px 35px rgba(20,44,35,.3); font-size: 11px; animation: toast-in .25s ease; }

.once-viewer-backdrop { z-index: 90; background: rgba(3, 8, 6, .94); backdrop-filter: blur(18px); }
.once-viewer { width: min(94vw, 920px); max-height: 92dvh; display: grid; gap: 14px; }
.once-viewer img { width: 100%; max-height: calc(92dvh - 60px); object-fit: contain; border-radius: 16px; background: #050907; }
.once-viewer > div { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: white; font-size: 11px; }
.once-viewer button { border: 1px solid rgba(255,255,255,.3); border-radius: 10px; padding: 9px 18px; background: rgba(255,255,255,.12); color: white; cursor: pointer; }
.attach-button:disabled, .send-button:disabled { opacity: .45; cursor: wait; }

@keyframes fade-in { from { opacity: 0; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }

@media (max-width: 760px) {
  .login-page { padding: 20px 16px 56px; }
  .login-card { padding: 34px 25px 28px; border-radius: 22px; }
  .brand-login { margin-bottom: 31px; }
  .login-heading h1 { font-size: 32px; }
  .app-shell { display: block; position: relative; }
  .sidebar { width: 100%; height: 100dvh; border-right: 0; }
  .sidebar.mobile-hidden { display: none; }
  .chat-panel { display: none; width: 100%; height: 100dvh; grid-template-rows: 74px 1fr auto; }
  .chat-panel.mobile-open { display: grid; }
  .chat-header { padding: 0 15px; }
  .chat-header .avatar { width: 40px; height: 40px; border-radius: 13px; }
  .mobile-back { display: block; width: 33px; height: 33px; margin-right: 6px; border: 0; background: transparent; color: var(--green); font-size: 20px; }
  .chat-actions button:first-child { display: none; }
  .message-area { padding: 18px 14px 20px; }
  .encryption-note { text-align: center; line-height: 1.3; }
  .bubble { max-width: 84%; }
  .attachment-bubble { min-width: 235px; }
  .composer-wrap { padding: 11px 10px 8px; }
  .composer-wrap > p { display: none; }
  .emoji-button { display: none; }
  .security-grid { grid-template-columns: 1fr; }
  .modal-card { padding: 30px 24px; }
}

@media (min-width: 761px) and (max-width: 980px) {
  .app-shell { grid-template-columns: 310px 1fr; }
  .message-area { padding-left: 32px; padding-right: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

.password-gate { z-index: 80; background: rgba(12, 27, 21, .72); }
.password-modal { width: min(100%, 480px); }
.password-lock { width: 54px; height: 54px; display: grid; place-items: center; margin-bottom: 22px; border-radius: 17px; background: var(--green-soft); }
.password-modal .password-lock .lock-mark { transform: scale(.84); }
.password-requirements { margin: -2px 0 2px; padding-left: 20px; color: var(--muted); font-size: 10px; line-height: 1.75; }
.password-requirements li { padding-left: 3px; }
.password-requirements li::marker { color: var(--green); }
.primary-button:disabled { opacity: .62; cursor: wait; transform: none; }

.empty-chat-panel { grid-template-rows: 1fr; }
.empty-chat-state { align-self: center; justify-self: center; width: min(88%, 420px); padding: 42px; text-align: center; color: var(--muted); }
.empty-chat-state > .lock-mark { margin-bottom: 22px; }
.empty-chat-state h2 { margin: 0; color: var(--ink); font-size: 28px; letter-spacing: -1px; }
.empty-chat-state > p:last-child { margin: 11px 0 0; font-size: 12px; line-height: 1.6; }
