:root {
  --cream: #fbf7ef;
  --oat: #e8ddcc;
  --oat-deep: #c6b59d;
  --paper: #fffdf8;
  --ink: #3d372f;
  --muted: #81786b;
  --blue: #8fa8b2;
  --blue-soft: #dbe7e8;
  --rose: #c97575;
  --line: rgba(111, 96, 78, 0.18);
  --shadow: 0 18px 45px rgba(88, 73, 54, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 10%, rgba(219, 231, 232, 0.75), transparent 26rem),
    linear-gradient(135deg, #fbf7ef 0%, #f1e7d9 46%, #dbe7e8 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
}

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

img,
svg,
video {
  max-width: 100%;
  height: auto;
}

button {
  font: inherit;
}

button,
summary,
a {
  -webkit-tap-highlight-color: rgba(143, 168, 178, 0.18);
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 18px;
  border-right: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.72);
  backdrop-filter: blur(18px);
}

.sidebar-head {
  display: block;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 44px;
  margin-bottom: 32px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, var(--rose), var(--blue));
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(143, 94, 94, 0.22);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  line-height: 1.2;
}

.brand small {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.25;
}

.brand small,
.sidebar-note,
.eyebrow,
.section-title span,
.journal-row small {
  color: var(--muted);
}

.nav-list {
  display: grid;
  gap: 8px;
}

.mobile-nav-menu {
  display: none;
}

.mobile-nav-list,
.mobile-sidebar-note {
  margin-top: 10px;
}

.nav-toggle {
  list-style: none;
}

.nav-toggle::-webkit-details-marker {
  display: none;
}

.nav-item {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 8px;
  color: #5c5348;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-item:hover,
.nav-item.active {
  color: var(--ink);
  background: rgba(143, 168, 178, 0.18);
}

.nav-item.active {
  box-shadow: inset 3px 0 0 var(--rose);
}

.sidebar-note {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 28px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.42);
  font-size: 13px;
}

.content {
  width: 100%;
  min-width: 0;
  max-width: 1220px;
  padding: 34px;
}

.hero-band,
.panel,
.profile-card,
.doc-card,
.reading-card,
.journal-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.82);
  box-shadow: var(--shadow);
}

.hero-band {
  position: relative;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  min-height: 238px;
  margin-bottom: 24px;
  padding: 34px;
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(255, 253, 248, 0.92), rgba(232, 221, 204, 0.62)),
    url("/photos/2026-04-30/01-profile.png") center right / auto 118% no-repeat;
}

.hero-band > * {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  max-width: 650px;
  font-size: 42px;
  line-height: 1.15;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 560px;
  margin: 14px 0 0;
  color: #665c50;
  line-height: 1.8;
  font-size: 16px;
}

.hero-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 190px;
}

.hero-stats span {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.74);
  border: 1px solid var(--line);
}

.hero-stats strong {
  margin-right: 4px;
  color: var(--rose);
  font-size: 22px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
  gap: 22px;
  margin-bottom: 22px;
}

.profile-card,
.panel,
.doc-card,
.reading-card {
  min-width: 0;
  padding: 22px;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, var(--blue), #c2a98c);
  font-size: 28px;
  font-weight: 800;
}

.profile-header h2 {
  margin: 0 0 4px;
  font-size: 24px;
}

.profile-header p {
  margin: 0;
  color: var(--muted);
}

.profile-facts {
  display: grid;
  gap: 10px;
  margin: 0 0 20px;
}

.profile-facts div {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.profile-facts dt {
  color: var(--muted);
}

.profile-facts dd {
  margin: 0;
}

.soft-link,
.section-title a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 9px 14px;
  border: 1px solid rgba(201, 117, 117, 0.28);
  border-radius: 8px;
  color: #9d5555;
  background: rgba(255, 244, 240, 0.74);
  font-weight: 700;
}

.section-title,
.page-header.with-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.section-title {
  margin-bottom: 16px;
}

.section-title h2,
.doc-card h2 {
  margin: 0;
  font-size: 22px;
}

.page-header {
  margin: 0 0 24px;
}

.page-header h1 {
  font-size: 38px;
}

.journal-list {
  display: grid;
  gap: 14px;
}

.journal-row,
.journal-card {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.journal-row {
  grid-template-columns: 118px 1fr;
  align-items: start;
  min-height: 44px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(232, 221, 204, 0.24);
}

.journal-row > span,
.journal-card > * {
  min-width: 0;
}

.journal-row strong,
.journal-row small {
  display: block;
}

.journal-row small {
  margin-top: 5px;
  line-height: 1.55;
}

.journal-card {
  min-height: 44px;
  padding: 18px;
  background: rgba(255, 253, 248, 0.7);
}

.journal-card h2 {
  margin: 2px 0 0;
  font-size: 22px;
}

.journal-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.date-pill {
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  color: #526a72;
  background: var(--blue-soft);
  font-size: 12px;
  font-weight: 800;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  min-width: 0;
}

.photo-grid.gallery {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

.photo-tile {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  aspect-ratio: 4 / 5;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--oat);
  cursor: zoom-in;
}

.photo-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.28s ease;
}

.photo-tile:hover img {
  transform: scale(1.04);
}

.photo-tile span {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  color: #fff;
  background: rgba(61, 55, 47, 0.58);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 18px;
  min-width: 0;
}

.reading-card {
  max-width: 860px;
  margin-bottom: 22px;
}

.markdown-body {
  color: #4f473d;
  line-height: 1.78;
  overflow-wrap: anywhere;
}

.markdown-body h1 {
  font-size: 30px;
}

.markdown-body h2,
.markdown-body h3 {
  margin: 1.25em 0 0.45em;
}

.markdown-body h2:first-child,
.markdown-body h3:first-child {
  margin-top: 0;
}

.markdown-body p {
  margin: 0.75em 0;
}

.markdown-body ul {
  padding-left: 1.25em;
}

.markdown-body li {
  margin: 0.35em 0;
}

.markdown-body blockquote {
  margin: 12px 0;
  padding: 10px 14px;
  border-left: 4px solid var(--blue);
  border-radius: 0 8px 8px 0;
  background: rgba(219, 231, 232, 0.42);
}

.markdown-body table {
  width: 100%;
  display: block;
  border-collapse: collapse;
  margin: 14px 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
  font-size: 14px;
}

.markdown-body th,
.markdown-body td {
  padding: 10px 12px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.markdown-body th {
  background: rgba(232, 221, 204, 0.55);
}

.markdown-body code {
  padding: 2px 5px;
  border-radius: 6px;
  background: rgba(143, 168, 178, 0.16);
}

.markdown-body pre {
  overflow: auto;
  padding: 14px;
  border-radius: 8px;
  background: #f2eadf;
}

.markdown-body pre code {
  padding: 0;
  background: transparent;
}

.gallery-group {
  margin-bottom: 18px;
}

.empty {
  margin: 0;
  color: var(--muted);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  padding: 28px;
  background: rgba(46, 39, 33, 0.78);
}

.lightbox.open {
  display: grid;
}

.lightbox img {
  max-width: min(92vw, 1040px);
  max-height: 82vh;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
}

.lightbox p {
  margin: 12px 0 0;
  color: #fff;
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    z-index: 25;
    height: auto;
    padding: 10px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 253, 248, 0.9);
  }

  .sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .brand {
    flex: 1 1 auto;
    margin-bottom: 0;
    overflow: hidden;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
  }

  .brand strong,
  .brand small {
    max-width: 46vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-list-desktop,
  .sidebar-note-desktop {
    display: none;
  }

  .mobile-nav-menu {
    position: relative;
    display: block;
    flex: 0 0 auto;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 84px;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: #5c5348;
    background: rgba(255, 255, 255, 0.58);
    cursor: pointer;
    font-weight: 700;
  }

  .nav-toggle span:first-child,
  .nav-toggle span:first-child::before,
  .nav-toggle span:first-child::after {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    content: "";
  }

  .nav-toggle span:first-child {
    position: relative;
  }

  .nav-toggle span:first-child::before,
  .nav-toggle span:first-child::after {
    position: absolute;
    left: 0;
  }

  .nav-toggle span:first-child::before {
    top: -6px;
  }

  .nav-toggle span:first-child::after {
    top: 6px;
  }

  .mobile-nav-menu[open] .nav-toggle {
    color: var(--ink);
    background: rgba(143, 168, 178, 0.18);
  }

  .mobile-nav-list,
  .mobile-sidebar-note {
    position: absolute;
    right: 0;
    width: min(300px, calc(100vw - 28px));
    border: 1px solid var(--line);
    background: rgba(255, 253, 248, 0.98);
    box-shadow: 0 18px 45px rgba(88, 73, 54, 0.16);
  }

  .mobile-nav-list {
    top: calc(100% + 8px);
    z-index: 2;
    max-height: calc(100dvh - 100px);
    padding: 8px;
    overflow-y: auto;
    border-radius: 8px 8px 0 0;
  }

  .mobile-nav-list .nav-item.active {
    box-shadow: inset 3px 0 0 var(--rose);
  }

  .mobile-sidebar-note {
    top: calc(100% + 274px);
    z-index: 3;
    margin-top: 0;
    border-top: 0;
    border-radius: 0 0 8px 8px;
  }

  .content {
    padding: 18px;
    max-width: none;
  }

  .hero-band {
    align-items: start;
    flex-direction: column;
    min-height: 0;
    padding: 24px;
    background:
      linear-gradient(90deg, rgba(255, 253, 248, 0.98) 0%, rgba(255, 253, 248, 0.94) 58%, rgba(255, 253, 248, 0.82) 100%),
      url("/photos/2026-04-30/01-profile.png") right center / auto 100% no-repeat;
  }

  .hero-stats {
    justify-content: flex-start;
    min-width: 0;
  }

  h1,
  .page-header h1 {
    font-size: 32px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 16px;
  }

  .doc-grid {
    grid-template-columns: 1fr;
  }

  .journal-row {
    grid-template-columns: 1fr;
    gap: 9px;
  }
}

@media (max-width: 520px) {
  body {
    font-size: 16px;
  }

  .sidebar {
    padding: 8px 12px;
  }

  .brand {
    gap: 9px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .brand strong {
    font-size: 15px;
  }

  .brand small {
    display: none;
  }

  .nav-toggle {
    min-width: 44px;
    padding: 8px 10px;
  }

  .nav-toggle span:last-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .content {
    padding: 12px;
  }

  .hero-band,
  .profile-card,
  .panel,
  .doc-card,
  .reading-card,
  .journal-card {
    padding: 16px;
  }

  .hero-band {
    gap: 18px;
    margin-bottom: 16px;
    background:
      linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(255, 253, 248, 0.93)),
      url("/photos/2026-04-30/01-profile.png") right bottom / auto 74% no-repeat;
  }

  h1,
  .page-header h1 {
    font-size: 30px;
    line-height: 1.18;
  }

  .hero-copy {
    margin-top: 12px;
    font-size: 16px;
    line-height: 1.65;
  }

  .hero-stats {
    gap: 8px;
  }

  .hero-stats span {
    min-height: 44px;
    padding: 9px 11px;
  }

  .hero-stats strong {
    font-size: 20px;
  }

  .section-title {
    gap: 10px;
    margin-bottom: 12px;
  }

  .section-title h2,
  .doc-card h2,
  .journal-card h2,
  .profile-header h2 {
    font-size: 21px;
    line-height: 1.25;
  }

  .section-title,
  .page-header.with-action {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-grid,
  .journal-list {
    gap: 12px;
  }

  .journal-row,
  .journal-card {
    gap: 10px;
  }

  .journal-row small,
  .journal-card p {
    font-size: 15px;
    line-height: 1.65;
  }

  .date-pill {
    padding: 7px 10px;
    font-size: 12px;
  }

  .photo-grid,
  .photo-grid.gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .photo-tile span {
    left: 6px;
    right: 6px;
    bottom: 6px;
    padding: 5px 7px;
    font-size: 12px;
    line-height: 1.25;
  }

  .profile-facts div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .markdown-body {
    font-size: 16px;
    line-height: 1.72;
  }

  .markdown-body h1 {
    font-size: 26px;
  }

  .markdown-body pre {
    margin-right: -2px;
    margin-left: -2px;
  }

  .lightbox {
    padding: 14px;
  }

  .lightbox-close {
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
  }
}

.chat-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  font-family: inherit;
}

.chat-toggle {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, var(--rose), #b76579 52%, var(--blue));
  box-shadow: 0 14px 34px rgba(143, 94, 94, 0.28);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.chat-toggle span {
  font-size: 20px;
  font-weight: 800;
}

.chat-toggle:hover {
  transform: scale(1.06);
  box-shadow: 0 18px 42px rgba(143, 94, 94, 0.34);
}

.chat-widget.open .chat-toggle {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.88);
}

.chat-panel {
  position: absolute;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(380px, calc(100vw - 32px));
  height: min(520px, calc(100vh - 32px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: 0 24px 80px rgba(88, 73, 54, 0.24);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.98);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.chat-widget.open .chat-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(232, 221, 204, 0.72), rgba(219, 231, 232, 0.68)),
    var(--paper);
}

.chat-header strong,
.chat-header span {
  display: block;
}

.chat-header strong {
  font-size: 15px;
}

.chat-header span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.chat-close {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.72);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.62), rgba(251, 247, 239, 0.92)),
    var(--cream);
}

.chat-message {
  display: flex;
  width: 100%;
}

.chat-message.user {
  justify-content: flex-end;
}

.chat-message.ai {
  justify-content: flex-start;
}

.chat-bubble {
  max-width: 82%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: var(--paper);
  font-size: 14px;
  line-height: 1.65;
  overflow-wrap: anywhere;
  box-shadow: 0 8px 24px rgba(88, 73, 54, 0.08);
}

.chat-message.user .chat-bubble {
  border-color: rgba(143, 168, 178, 0.36);
  color: #fff;
  background: linear-gradient(145deg, var(--blue), #7d97a2);
}

.chat-message.ai .chat-bubble {
  border-top-left-radius: 6px;
}

.chat-message.user .chat-bubble {
  border-top-right-radius: 6px;
}

.chat-bubble p {
  margin: 0.5em 0;
}

.chat-bubble p:first-child {
  margin-top: 0;
}

.chat-bubble p:last-child {
  margin-bottom: 0;
}

.chat-bubble a {
  color: #566f7c;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.chat-message.user .chat-bubble a {
  color: #fff;
}

.chat-bubble code {
  padding: 2px 5px;
  border-radius: 6px;
  background: rgba(143, 168, 178, 0.18);
  font-size: 0.92em;
}

.chat-bubble pre {
  max-width: 100%;
  overflow: auto;
  margin: 8px 0;
  padding: 10px;
  border-radius: 8px;
  background: #f2eadf;
}

.chat-bubble pre code {
  padding: 0;
  background: transparent;
}

.chat-bubble img {
  display: block;
  max-width: 100%;
  margin: 8px 0;
  border-radius: 8px;
}

.chat-typing {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 18px;
}

.chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: chatTyping 1s infinite ease-in-out;
}

.chat-typing span:nth-child(2) {
  animation-delay: 0.14s;
}

.chat-typing span:nth-child(3) {
  animation-delay: 0.28s;
}

@keyframes chatTyping {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.94);
}

.chat-form textarea {
  min-height: 44px;
  max-height: 118px;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 11px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  line-height: 1.45;
  outline: none;
}

.chat-form textarea:focus {
  border-color: rgba(143, 168, 178, 0.72);
  box-shadow: 0 0 0 3px rgba(143, 168, 178, 0.18);
}

.chat-send {
  align-self: end;
  min-width: 62px;
  height: 44px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(145deg, var(--rose), #b76579);
  cursor: pointer;
  font-weight: 700;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.chat-send:hover {
  transform: translateY(-1px);
}

.chat-send:disabled,
.chat-form textarea:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.chat-error {
  color: #8f4545;
}

.chat-retry {
  display: block;
  min-height: 44px;
  margin-top: 8px;
  border: 1px solid rgba(143, 69, 69, 0.28);
  border-radius: 8px;
  padding: 6px 10px;
  color: #8f4545;
  background: rgba(201, 117, 117, 0.1);
  cursor: pointer;
  font-weight: 700;
}

@media (max-width: 520px) {
  .chat-widget {
    right: max(14px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
  }

  .chat-panel {
    position: fixed;
    inset: 0;
    width: 100dvw;
    height: 100dvh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }

  .chat-widget.open .chat-toggle {
    display: none;
  }

  .chat-bubble {
    max-width: 88%;
    font-size: 15px;
  }

  .chat-header {
    min-height: 60px;
    padding: 10px 12px;
    padding-top: max(10px, env(safe-area-inset-top));
  }

  .chat-messages {
    padding: 12px;
  }

  .chat-form {
    padding: 10px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }

  .chat-form textarea {
    font-size: 16px;
  }
}
