:root { font-family: "DM Sans", system-ui, sans-serif; color: #241731; background: #fbf9fe; }
* { box-sizing: border-box; }
body { margin: 0; }
header { min-height: 70px; padding: 12px clamp(16px, 4vw, 48px); display: flex; align-items: center; gap: 12px; background: white; border-bottom: 1px solid #e8e0ee; }
.mark { display: inline-block; background: #391459; color: white; border-radius: 14px; padding: 9px 13px; }
.logout { margin: 0 0 0 auto; }
main { max-width: 1300px; margin: 32px auto; padding: 0 20px; display: grid; grid-template-columns: 205px minmax(0, 1fr); align-items: start; gap: 28px; }
nav { display: grid; gap: 6px; }
nav button { text-align: left; border-color: transparent; background: transparent; }
nav [aria-current="page"] { background: #eae0f5; font-weight: 650; }
nav button { display: flex; align-items: center; gap: 10px; }
nav svg { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
nav svg circle { fill: #faf8fd; }
.profile-card { max-width: 470px; }
.workspace .profile-card { padding: 20px; border: 1px solid #e8e0ee; border-radius: 16px; margin-bottom: 16px; }
.profile-card form > label:not(:first-child) { margin-top: 14px; }
.profile-card article + article { margin-top: 12px; }
.profile-card h3 { margin: 0; }
.profile-recovery { display: inline-block; margin-top: 14px; color: #522478; }
#chat-title { overflow-wrap: anywhere; }
.workspace { max-width: 820px; width: 100%; margin: 0 auto; }
section { background: white; border: 1px solid #e8e0ee; border-radius: 20px; padding: clamp(16px, 3vw, 32px); }
.chat .mark { margin-bottom: 16px; }
h1, h2 { margin: 0 0 18px; line-height: 1.15; }
h1 { font-size: clamp(1.65rem, 4vw, 2.35rem); letter-spacing: -.04em; }
h2 { font-size: 1.4rem; }
#messages { max-height: 46vh; overflow-y: auto; }
.bubble { border-radius: 14px; padding: 12px; background: #f4eff9; max-width: 92%; overflow-wrap: anywhere; }
.user { background: #eadef7; margin-left: auto; }
form { margin-top: 18px; }
label { display: block; margin-bottom: 6px; }
input, textarea { width: 100%; border: 1px solid #c9b9d5; border-radius: 12px; padding: 12px; font: inherit; }
textarea { resize: vertical; min-height: 94px; }
input[type="time"] { width: auto; }
button { min-height: 44px; cursor: pointer; border: 1px solid #d8cbe3; border-radius: 10px; padding: 8px 12px; background: white; color: #391459; font: inherit; }
button:hover { background: #f4eff9; }
.primary { background: #522478; border-color: #522478; color: white; }
.primary:hover { background: #391459; }
button:disabled { opacity: .55; cursor: default; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
form .actions { justify-content: space-between; }
.note, #count, .due { color: #685b73; font-size: .9rem; }
article { border-top: 1px solid #e8e0ee; padding: 14px 0; overflow-wrap: anywhere; }
article:last-child { padding-bottom: 0; }
article p { margin: 6px 0; }
.login { display: grid; place-items: center; min-height: 100dvh; padding: 20px; }
.login-card { width: min(100%, 420px); margin: 0; background: white; padding: 28px; border: 1px solid #e8e0ee; border-radius: 20px; }
.login-card .mark, .login-card input { margin-bottom: 16px; }
.login-card .primary { width: 100%; }
@media (max-width: 720px) {
  main { grid-template-columns: 1fr; margin-top: 16px; gap: 4px; }
  nav { display: flex; flex-wrap: wrap; }
}

body:has(main) { background: #fff; }
body:has(main) header { height: 60px; min-height: 0; padding: 6px 16px; }
header .mark { padding: 6px 10px; border-radius: 10px; }
.home-link { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
#menu { border: 0; font-size: 1.3rem; }
main {
  max-width: none;
  height: calc(100dvh - 60px);
  margin: 0;
  padding: 0;
  position: relative;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
}
main aside {
  display: none;
  position: absolute;
  inset: 0 auto auto 0;
  z-index: 1;
  width: min(78vw, 260px);
  max-height: 100%;
  overflow: auto;
  background: #faf8fd;
  border: 1px solid #e8e0ee;
  border-radius: 0 0 16px 0;
  padding: 16px 12px;
  box-shadow: 8px 8px 24px #24173120;
}
main aside.open { display: block; }
main aside { width: min(calc(100vw - 12px), 330px); }
.menu-account { display: flex; align-items: center; gap: 4px; margin-bottom: 12px; }
.menu-account .logout { margin: 0; }
.menu-profile { display: flex; flex: 1; min-width: 0; align-items: center; gap: 8px; text-align: left; border: 0; background: transparent; padding: 4px; }
.menu-profile strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; overflow: hidden; background: #eae0f5; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.menu-icon { display: grid; place-items: center; width: 44px; padding: 0; border-radius: 50%; }
.menu-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.profile-card input[type="file"] { margin-bottom: 8px; }
#profile-panel .profile-card { max-width: 100%; }
.profile-form { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 24px; margin-top: 0; }
.profile-form h3 { margin: 0 0 12px; }
.profile-contact-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
@media (max-width: 720px) {
  .profile-contact-fields { grid-template-columns: minmax(0, 1fr); }
}
.profile-photo-block { display: grid; justify-items: center; align-content: start; text-align: center; gap: 8px; min-width: 0; }
.profile-avatar { width: 128px; height: 128px; font-size: 52px; color: #522478; }
#profile-photo-file { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) {
  .profile-form { grid-template-columns: minmax(0, 1fr); }
}
.workspace { display: flex; flex-direction: column; min-height: 0; padding: 0 18px; }
#status { margin: 8px 0 0; font-size: .8rem; }
.workspace > section { min-height: 0; overflow: auto; border: 0; border-radius: 0; padding: 18px 0; }
.chat:not([hidden]) { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
#welcome { margin: auto 0; padding: 12px 0; }
#welcome .mark { background: #eee4fa; color: #522478; }
#welcome h1 { margin-bottom: 14px; }
#example { border-radius: 22px; background: #faf7ff; }
#messages { flex: 1; max-height: none; min-height: 0; }
#welcome:not([hidden]) + #messages { flex: 0; }
#composer {
  flex: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 4px;
  margin: 12px 0 0;
  padding: 4px 6px 4px 10px;
  border: 1px solid #ded4e7;
  border-radius: 22px;
  box-shadow: 0 4px 16px #3019420b;
}
#composer label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#composer textarea {
  display: block;
  min-height: 44px;
  max-height: 132px;
  padding: 11px 4px;
  line-height: 20px;
  border: 0;
  resize: none;
  field-sizing: content;
}
#composer .actions { flex-wrap: nowrap; justify-content: flex-end; margin-top: 0; }
#composer .actions button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; }
#composer .actions svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#composer #voice { color: #221c29; }
#composer .send { background: #2862c8; }
#composer .send:hover { background: #1e4fa7; }
:focus-visible { outline: 2px solid #79529e; outline-offset: 2px; }
@media (max-width: 720px) {
  nav { display: grid; }
  .workspace { padding: 0 14px; }
  .workspace > section { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
}
.brand-icon { width: 38px; height: 38px; border-radius: 10px; }
#menu { margin-left: auto; }
main aside { left: auto; right: 0; border-radius: 0 0 0 16px; }
.save-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.save-row button { flex: none; }
.save-row span { font-size: .85rem; color: #176044; overflow-wrap: anywhere; }
.save-row span[data-error="true"] { color: #a12239; }
#toggle-password, #check-google { margin-top: 10px; }
@media (max-width: 720px) {
  body:has(main) header { height: 78px; }
  main { height: calc(100dvh - 78px); }
  .brand-icon { width: 44px; height: 44px; }
  .home-link strong { font-size: 21px; }
  nav button, .menu-profile { font-size: 1rem; }
  #status { font-size: .9rem; }
}
