:root {
  --paper: #f7f1e7;
  --paper-strong: #fffaf2;
  --ink: #1d1a17;
  --muted: #70675e;
  --line: rgba(29, 26, 23, 0.11);
  --orange: #ea5b2a;
  --orange-deep: #bc3f16;
  --green: #146356;
  --green-soft: #dcefe6;
  --cream: #f1ddb7;
  --shadow: 0 24px 70px rgba(53, 34, 17, 0.13);
  --radius: 24px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Avenir Next", "PingFang TC", "Noto Sans TC", sans-serif;
  background:
    radial-gradient(circle at 8% 0%, rgba(234, 91, 42, 0.15), transparent 25rem),
    radial-gradient(circle at 95% 15%, rgba(20, 99, 86, 0.14), transparent 28rem),
    var(--paper);
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

.kicker {
  margin: 0;
  color: var(--orange-deep);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 850;
}

.app-brand-mark {
  width: 2.65rem;
  height: 2.65rem;
  overflow: hidden;
  color: transparent;
  background: url("../icons/icon.svg?v=3") center / contain no-repeat;
  filter: drop-shadow(0 7px 14px rgba(29, 26, 23, 0.14));
}

.text-link {
  color: var(--muted);
  font-size: 0.92rem;
}

.primary-button,
.secondary-button,
.danger-button,
.light-button,
.outline-light-button {
  min-height: 3rem;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 800;
}

.primary-button {
  background: linear-gradient(135deg, var(--orange), #ff9149);
  color: white;
  box-shadow: 0 12px 26px rgba(234, 91, 42, 0.25);
}

.secondary-button {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.66);
}

.danger-button {
  border-color: rgba(165, 52, 25, 0.2);
  background: rgba(165, 52, 25, 0.08);
  color: #9d3219;
}

.light-button {
  background: var(--paper-strong);
  color: var(--ink);
}

.outline-light-button {
  border-color: rgba(255, 255, 255, 0.32);
  background: transparent;
  color: white;
}

.auth-screen {
  min-height: 100vh;
  padding: 1rem clamp(1rem, 4vw, 4rem) 3rem;
}

.auth-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: min(100%, 1180px);
  margin: 0 auto;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(21rem, 0.9fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
  width: min(100%, 1080px);
  min-height: calc(100vh - 6rem);
  margin: 0 auto;
}

.auth-intro h1,
.view-heading h1,
.welcome-row h1,
.modal-dialog h2 {
  font-family: "Iansui", "Noto Serif TC", serif;
  letter-spacing: -0.035em;
}

.auth-intro h1 {
  max-width: 10em;
  margin: 0.8rem 0 1.2rem;
  font-size: clamp(3rem, 6vw, 5.4rem);
  line-height: 1.02;
}

.auth-intro > p:not(.kicker) {
  max-width: 38rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.85;
}

.auth-benefits {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.5rem;
}

.auth-benefits span,
.filter-chips button {
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.7);
  color: var(--muted);
}

.auth-card {
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 8px);
  background: rgba(255, 250, 242, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  padding: 0.35rem;
  border-radius: 1rem;
  background: rgba(29, 26, 23, 0.06);
}

.auth-tab {
  min-height: 2.7rem;
  border: 0;
  border-radius: 0.75rem;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  font-weight: 800;
}

.auth-tab.is-active {
  background: var(--paper-strong);
  color: var(--ink);
  box-shadow: 0 8px 20px rgba(29, 26, 23, 0.08);
}

.auth-form,
.settings-form {
  display: grid;
  gap: 0.9rem;
  margin-top: 1rem;
}

.auth-form label,
.settings-form label {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
}

.auth-form input,
.settings-form input,
.settings-form textarea,
.message-form input {
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  outline: none;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
}

.auth-form input:focus,
.settings-form input:focus,
.settings-form textarea:focus,
.message-form input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(234, 91, 42, 0.1);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.identity-preview {
  margin: -0.25rem 0 0;
  color: var(--orange-deep);
  font-family: "SFMono-Regular", "JetBrains Mono", monospace;
  font-size: 0.86rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.demo-note,
.form-error {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.6;
}

.form-error {
  min-height: 1.4em;
  margin-top: 0.75rem;
  color: #a5391d;
}

.app-shell {
  min-height: 100vh;
  padding-bottom: calc(6.5rem + var(--safe-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: min(calc(100% - 2rem), 1180px);
  margin: 0 auto;
  padding: 0.75rem 0;
  background: rgba(247, 241, 231, 0.84);
  backdrop-filter: blur(18px);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chip-button,
.avatar-button {
  min-height: 2.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.8);
  cursor: pointer;
  font-weight: 750;
}

.chip-button {
  padding: 0.55rem 0.85rem;
}

.avatar-button {
  display: grid;
  place-items: center;
  width: 2.6rem;
  padding: 0;
  background: var(--ink);
  color: white;
}

.app-main {
  width: min(calc(100% - 2rem), 1120px);
  margin: 0 auto;
  padding: 2rem 0 0;
}

.app-view {
  animation: view-in 320ms ease both;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.welcome-row,
.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
}

.welcome-row h1,
.section-title-row h2,
.view-heading h1 {
  margin: 0.25rem 0 0;
}

.welcome-row h1 {
  font-size: clamp(2.4rem, 5vw, 4.2rem);
}

.status-badge {
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  background: #fff0c9;
  color: #7a5c06;
  font-size: 0.8rem;
  font-weight: 850;
}

.status-badge.is-verified {
  background: var(--green-soft);
  color: var(--green);
}

.digital-id-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 1.2rem;
  margin: 1.3rem 0 2.5rem;
  padding: clamp(1.3rem, 4vw, 2.2rem);
  border-radius: 32px;
  background:
    radial-gradient(circle at 90% 10%, rgba(234, 91, 42, 0.8), transparent 12rem),
    linear-gradient(135deg, #1d1a17 0%, #143c35 100%);
  color: white;
  box-shadow: 0 28px 80px rgba(29, 26, 23, 0.25);
}

.digital-id-card::after {
  content: "";
  position: absolute;
  right: -4rem;
  bottom: -7rem;
  width: 18rem;
  height: 18rem;
  border: 2.5rem solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.digital-id-top,
.digital-id-meta,
.digital-id-actions {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.digital-id-top {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.live-dot {
  color: #ff9e68;
}

.digital-address {
  position: relative;
  z-index: 1;
  margin: 0;
  font-family: "SFMono-Regular", "JetBrains Mono", monospace;
  font-size: clamp(1.55rem, 4vw, 3rem);
  font-weight: 850;
  overflow-wrap: anywhere;
}

.digital-id-meta {
  justify-content: flex-start;
  color: rgba(255, 255, 255, 0.7);
}

.digital-id-meta span + span::before {
  content: "·";
  margin-right: 0.7rem;
}

.digital-id-actions {
  justify-content: flex-start;
}

.section-title-row {
  margin: 2.5rem 0 1rem;
}

.section-title-row h2,
.settings-card h2 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.quick-card {
  display: grid;
  gap: 0.4rem;
  min-height: 10.5rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 16px 40px rgba(46, 31, 16, 0.09);
}

.quick-card > span,
.apps-grid button > span {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.64);
  font-weight: 900;
}

.quick-card strong {
  margin-top: auto;
  font-size: 1.08rem;
}

.quick-card small {
  color: rgba(29, 26, 23, 0.64);
}

.quick-orange { background: #ffd9bd; }
.quick-green { background: #cde8dc; }
.quick-cream { background: #f2e3c9; }
.quick-dark { background: var(--ink); color: white; }
.quick-dark small { color: rgba(255, 255, 255, 0.65); }

.pulse-list {
  display: grid;
  gap: 0.75rem;
}

.pulse-list article {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  background: rgba(255, 250, 242, 0.72);
}

.pulse-list article > span {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  background: var(--paper-strong);
  color: var(--orange-deep);
  font-weight: 900;
}

.pulse-list p {
  margin: 0.2rem 0 0;
  color: var(--muted);
}

.view-heading {
  margin-bottom: 1.5rem;
}

.view-heading h1 {
  font-size: clamp(2.5rem, 5vw, 4.6rem);
  line-height: 1.05;
}

.view-heading > p:last-child {
  max-width: 45rem;
  margin: 0.8rem 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.filter-chips {
  display: flex;
  gap: 0.55rem;
  overflow-x: auto;
  margin-bottom: 1rem;
  padding-bottom: 0.25rem;
  scrollbar-width: none;
}

.filter-chips button {
  flex: 0 0 auto;
  cursor: pointer;
}

.filter-chips button.is-active {
  background: var(--ink);
  color: white;
}

.offers-grid,
.profiles-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.offer-card,
.profile-card,
.settings-card,
.conversation-panel,
.thread-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 242, 0.82);
  box-shadow: 0 18px 50px rgba(46, 31, 16, 0.09);
}

.offer-card,
.profile-card {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
}

.offer-card .offer-top,
.profile-top,
.profile-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.offer-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.4rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.8rem;
  background: #ffd9bd;
  color: var(--orange-deep);
  font-weight: 900;
}

.offer-card[data-color="green"] .offer-badge { background: var(--green-soft); color: var(--green); }
.offer-card[data-color="cream"] .offer-badge { background: #f3e5c9; color: #795c25; }

.offer-category,
.profile-school {
  color: var(--muted);
  font-size: 0.8rem;
}

.offer-card h3,
.profile-card h3 {
  margin: 0;
  font-size: 1.15rem;
}

.offer-card p,
.profile-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.offer-card button,
.profile-actions button {
  min-height: 2.7rem;
  border: 0;
  border-radius: 0.85rem;
  cursor: pointer;
  font-weight: 800;
}

.offer-card button {
  margin-top: auto;
  background: var(--ink);
  color: white;
}

.profile-avatar,
.conversation-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border-radius: 1rem;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 900;
}

.profile-avatar {
  width: 3.2rem;
  height: 3.2rem;
}

.profile-avatar img,
.conversation-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-identity {
  color: var(--orange-deep) !important;
  font-family: "SFMono-Regular", monospace;
  font-size: 0.82rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.interest-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.interest-list span {
  padding: 0.4rem 0.55rem;
  border-radius: 999px;
  background: rgba(29, 26, 23, 0.06);
  color: var(--muted);
  font-size: 0.75rem;
}

.profile-actions button:first-child {
  flex: 1;
  background: var(--orange);
  color: white;
}

.profile-actions button:last-child {
  flex: 1;
  border: 1px solid var(--line);
  background: transparent;
}

.chat-layout {
  display: grid;
  grid-template-columns: minmax(17rem, 0.36fr) minmax(0, 0.64fr);
  gap: 1rem;
  min-height: 38rem;
}

.conversation-panel,
.thread-panel {
  overflow: hidden;
}

.conversation-title,
.thread-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
  min-height: 4rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--line);
}

.conversation-title button,
.thread-header button {
  border: 0;
  background: transparent;
  color: var(--orange-deep);
  cursor: pointer;
  font-weight: 800;
}

.conversation-list {
  display: grid;
}

.conversation-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.conversation-item.is-active {
  background: rgba(234, 91, 42, 0.08);
}

.conversation-avatar {
  width: 2.8rem;
  height: 2.8rem;
}

.conversation-copy {
  min-width: 0;
  flex: 1;
}

.conversation-copy strong,
.conversation-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-copy small {
  margin-top: 0.25rem;
  color: var(--muted);
}

.unread-badge {
  display: grid;
  place-items: center;
  min-width: 1.4rem;
  height: 1.4rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--orange);
  color: white;
  font-size: 0.72rem;
  font-weight: 900;
}

.thread-panel {
  min-height: 38rem;
}

#active-chat {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 38rem;
}

.thread-header {
  justify-content: flex-start;
}

.thread-header div {
  display: grid;
  gap: 0.15rem;
}

.thread-header span {
  color: var(--muted);
  font-size: 0.78rem;
}

.message-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  overflow-y: auto;
  max-height: 32rem;
  padding: 1rem;
}

.message {
  max-width: min(78%, 30rem);
  padding: 0.7rem 0.85rem;
  border-radius: 1rem 1rem 1rem 0.25rem;
  background: white;
  line-height: 1.55;
  box-shadow: 0 8px 22px rgba(29, 26, 23, 0.06);
}

.message.is-mine {
  align-self: flex-end;
  border-radius: 1rem 1rem 0.25rem 1rem;
  background: var(--green);
  color: white;
}

.message time {
  display: block;
  margin-top: 0.25rem;
  opacity: 0.6;
  font-size: 0.7rem;
}

.message-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.6rem;
  padding: 0.8rem;
  border-top: 1px solid var(--line);
}

.message-form button {
  padding: 0 1rem;
  border: 0;
  border-radius: 0.9rem;
  background: var(--orange);
  color: white;
  cursor: pointer;
  font-weight: 850;
}

.empty-state {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 38rem;
  padding: 2rem;
  text-align: center;
}

.empty-state p {
  max-width: 22rem;
  color: var(--muted);
  line-height: 1.7;
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.apps-grid button {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 6rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  background: rgba(255, 250, 242, 0.82);
  text-align: left;
  cursor: pointer;
}

.apps-grid button div {
  display: grid;
  gap: 0.2rem;
}

.apps-grid small {
  color: var(--muted);
}

.settings-card {
  display: grid;
  gap: 1.2rem;
  margin-top: 1.5rem;
  padding: 1.2rem;
}

.settings-card h2 {
  margin: 0.25rem 0 0;
}

.settings-form {
  grid-template-columns: 1fr 1fr;
}

.settings-form .full-field,
.settings-form button {
  grid-column: 1 / -1;
}

.settings-form textarea {
  resize: vertical;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.bottom-nav {
  position: fixed;
  right: 50%;
  bottom: max(0.65rem, var(--safe-bottom));
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  width: min(calc(100% - 1rem), 34rem);
  padding: 0.45rem;
  border: 1px solid rgba(29, 26, 23, 0.12);
  border-radius: 1.5rem;
  background: rgba(255, 250, 242, 0.9);
  box-shadow: 0 18px 60px rgba(29, 26, 23, 0.2);
  backdrop-filter: blur(20px);
  transform: translateX(50%);
}

.bottom-nav button {
  display: grid;
  justify-items: center;
  gap: 0.2rem;
  min-height: 3.4rem;
  padding: 0.3rem;
  border: 0;
  border-radius: 1rem;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
}

.bottom-nav button span {
  font-weight: 900;
}

.bottom-nav button small {
  font-size: 0.68rem;
}

.bottom-nav button.is-active {
  background: var(--ink);
  color: white;
}

.modal-dialog {
  width: min(calc(100% - 2rem), 28rem);
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--paper-strong);
  color: var(--ink);
  box-shadow: 0 30px 100px rgba(29, 26, 23, 0.3);
}

.modal-dialog::backdrop {
  background: rgba(29, 26, 23, 0.55);
  backdrop-filter: blur(8px);
}

.modal-dialog h2 {
  margin: 0.5rem 0 1rem;
  font-size: 2rem;
}

.dialog-close {
  float: right;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
}

.qr-frame {
  display: grid;
  place-items: center;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 1.4rem;
  background: white;
}

.qr-frame img {
  display: block;
  width: min(100%, 22rem);
  aspect-ratio: 1;
}

.qr-identity {
  color: var(--orange-deep);
  font-family: "SFMono-Regular", monospace;
  font-weight: 850;
  text-align: center;
  overflow-wrap: anywhere;
}

.dialog-note,
.install-steps {
  color: var(--muted);
  line-height: 1.75;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(6rem + var(--safe-bottom));
  z-index: 80;
  max-width: calc(100% - 2rem);
  padding: 0.75rem 1rem;
  border-radius: 999px;
  background: var(--ink);
  color: white;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 900px) {
  .auth-layout {
    grid-template-columns: 1fr;
    align-content: center;
    padding-top: 2rem;
  }

  .auth-intro h1 {
    max-width: 12em;
    font-size: clamp(2.6rem, 10vw, 4.5rem);
  }

  .quick-grid,
  .offers-grid,
  .profiles-grid,
  .apps-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chat-layout {
    grid-template-columns: 1fr;
  }

  .conversation-panel.is-hidden-mobile,
  .thread-panel:not(.is-active-mobile) {
    display: none;
  }
}

@media (max-width: 620px) {
  .auth-screen {
    padding-inline: 0.75rem;
  }

  .auth-header {
    padding-inline: 0.25rem;
  }

  .auth-layout {
    gap: 1.5rem;
  }

  .auth-intro h1 {
    font-size: clamp(2.35rem, 12vw, 3.5rem);
  }

  .auth-intro > p:not(.kicker) {
    font-size: 0.95rem;
  }

  .auth-card {
    padding: 0.9rem;
    border-radius: 1.5rem;
  }

  .form-row,
  .settings-form {
    grid-template-columns: 1fr;
  }

  .topbar {
    width: calc(100% - 1rem);
  }

  .topbar .app-brand > span:last-child {
    display: none;
  }

  .chip-button {
    padding-inline: 0.65rem;
    font-size: 0.78rem;
  }

  .app-main {
    width: calc(100% - 1rem);
    padding-top: 1.2rem;
  }

  .welcome-row {
    align-items: center;
  }

  .digital-id-card {
    border-radius: 1.6rem;
  }

  .digital-id-actions button {
    flex: 1;
  }

  .quick-grid {
    gap: 0.6rem;
  }

  .quick-card {
    min-height: 9.5rem;
    padding: 0.85rem;
  }

  .offers-grid,
  .profiles-grid,
  .apps-grid {
    grid-template-columns: 1fr;
  }

  .chat-heading {
    margin-bottom: 1rem;
  }

  .conversation-panel,
  .thread-panel,
  #active-chat {
    height: max(20rem, calc(100dvh - 18rem - var(--safe-bottom)));
    min-height: 0;
  }

  .conversation-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .conversation-list {
    overflow-y: auto;
  }

  .message-list {
    min-height: 0;
    max-height: none;
  }

  .settings-form button {
    grid-column: auto;
  }

  .settings-actions > button {
    width: 100%;
  }
}

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