:root{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#253a4a;background:#f8f9f8;font-synthesis:none}*{box-sizing:border-box}body{margin:0}button,textarea,input{font:inherit}button{cursor:pointer}button:focus-visible,input:focus-visible,textarea:focus-visible{outline:3px solid #81bdd8;outline-offset:3px}.app{min-height:100dvh}.topbar{height:76px;display:flex;align-items:center;justify-content:space-between;padding:0 clamp(20px,5vw,72px);border-bottom:1px solid #e9efef}.brand{display:flex;align-items:center;gap:10px;color:#253a4a;font-weight:750;letter-spacing:.08em;text-decoration:none;font-size:14px}.brand small{font-size:10px;font-weight:600;color:#7a909d;letter-spacing:.15em}.brand-mark{display:grid;place-items:center;width:35px;height:35px;border-radius:12px;background:#dceff5;color:#4387a5;font-family:Georgia,serif;font-weight:700;font-size:25px;letter-spacing:0}.history-toggle,.icon-button{border:0;background:transparent;color:#506779;display:inline-flex;align-items:center;justify-content:center}.history-toggle{gap:8px;font-size:13px;padding:10px}.history-toggle svg,.icon-button svg,.send-button svg{width:21px;height:21px}.history-toggle b{font-size:11px;background:#e5f1f5;border-radius:20px;padding:3px 6px}.icon-button{width:42px;height:42px;border-radius:50%;font-size:27px}.history-toggle:hover,.icon-button:hover{background:#edf3f4}main{width:min(100% - 40px,720px);margin:0 auto;padding:clamp(42px,10vh,112px) 0 50px}.intro{text-align:center}.intro-icon{display:grid;place-items:center;width:60px;height:60px;margin:0 auto 22px;border-radius:22px;background:#e5f3f7;color:#5896af}.intro-icon svg{width:33px;height:33px}.eyebrow{font-size:10px;letter-spacing:.16em;font-weight:750;color:#7fa5b3}.intro h1{font-size:clamp(30px,4vw,43px);line-height:1.17;letter-spacing:-.045em;font-weight:650;margin:12px 0 16px;color:#203645}.lead{max-width:490px;margin:0 auto;color:#6e818c;line-height:1.65;font-size:15px}.steps{display:flex;align-items:center;justify-content:center;gap:12px;margin:31px 0 36px;color:#7a909b;font-size:12px}.steps span:not(.step-line){display:flex;align-items:center;gap:7px}.steps i{font-style:normal;width:22px;height:22px;display:grid;place-items:center;border:1px solid #d5e6ea;border-radius:50%;color:#6494a6;font-size:10px}.step-line{width:20px;height:1px;background:#d9e6e9}.workspace{max-width:650px;margin:auto}.composer{border:1px solid #d4e4e8;background:#fff;border-radius:24px;padding:18px 17px 13px;box-shadow:0 14px 40px rgba(40,75,89,.065)}textarea{border:0;resize:none;background:transparent;width:100%;color:#253a4a;line-height:1.5;outline:0;min-height:64px;max-height:180px}textarea::placeholder{color:#a7b3b8}.composer-bottom,.composer-tools,.composer-actions{display:flex;align-items:center}.composer-bottom{justify-content:space-between}.composer-tools{gap:9px;color:#94a6ad;font-size:12px}.add-button{width:39px;height:39px;border-radius:13px;border:0;background:#eaf4f7;color:#5e99b0;font-size:27px;font-weight:300;line-height:1}.composer-actions{gap:6px}.send-button{display:grid;place-items:center;width:40px;height:40px;border:0;border-radius:13px;background:#477e94;color:white}.send-button:hover{background:#356b81}.voice-status{font-size:11px;color:#738b96}.privacy-note{text-align:center;color:#a1afb5;font-size:11px;line-height:1.5;margin:15px 0}.photo-strip{display:flex;gap:8px;overflow:auto;margin-bottom:15px}.photo-thumb{position:relative;flex:none;width:74px;height:74px}.photo-thumb img{width:100%;height:100%;object-fit:cover;border-radius:12px}.photo-thumb button{position:absolute;right:3px;top:3px;width:23px;height:23px;border:0;border-radius:50%;background:rgba(28,44,50,.75);color:white;font-size:17px}.photo-thumb span{position:absolute;bottom:3px;left:4px;color:white;text-shadow:0 1px 3px #000;font-size:9px}.conversation{margin-bottom:20px}.message{margin-bottom:16px;line-height:1.6;font-size:14px}.message.eva{display:flex;gap:12px}.eva-avatar{display:grid;place-items:center;flex:none;width:32px;height:32px;border-radius:11px;background:#e1f0f4;color:#5690a8;font-family:Georgia,serif;font-size:21px}.bubble{flex:1;min-width:0}.bubble strong{display:block;margin:3px 0 6px}.message.user{background:#edf4f5;border-radius:18px;padding:13px 16px;margin-left:44px;white-space:pre-wrap;overflow-wrap:anywhere}.context-card{background:#fff;border:1px solid #e4eded;border-radius:18px;padding:17px;margin:14px 0}.field{display:block;margin:13px 0;color:#6c818c;font-size:12px}.field input{display:block;width:100%;border:1px solid #e1e9e9;border-radius:10px;background:#fbfcfc;padding:11px;color:#253a4a;margin-top:6px;font-size:14px}.field input[type=date]{min-height:43px}.chip-row{display:flex;gap:7px;flex-wrap:wrap}.chip{border:1px solid #dce9ec;color:#5d7d8c;background:#fff;border-radius:20px;padding:8px 12px;font-size:12px}.chip[aria-pressed=true]{background:#e6f4f7;border-color:#9fcbd8;color:#315e70}.actions{display:flex;gap:9px;flex-wrap:wrap;margin-top:16px}.primary,.secondary{border-radius:12px;padding:11px 15px;font-size:13px;font-weight:600}.primary{background:#477e94;color:#fff;border:1px solid #477e94}.secondary{background:#fff;color:#4e7181;border:1px solid #d5e5e8}.detail{color:#80939c;font-size:12px;line-height:1.55}.draft{white-space:pre-wrap;line-height:1.65;font-size:14px;overflow-wrap:anywhere}.draft-edit{min-height:220px;border:1px solid #dce7e9;border-radius:12px;padding:12px;font-size:14px}.timeline{list-style:none;padding:0;margin:12px 0}.timeline li{border-left:1px solid #cfe1e5;padding:0 0 13px 16px;margin-left:5px;font-size:13px}.timeline li:before{content:"";display:inline-block;width:7px;height:7px;border-radius:50%;background:#75a9ba;margin:0 10px 0 -20px}.timeline small{display:block;margin:3px 0 0;color:#91a1a8}.history{position:fixed;z-index:5;right:20px;top:68px;width:min(350px,calc(100% - 40px));max-height:70vh;overflow:auto;background:#fff;border:1px solid #e2ecee;border-radius:20px;padding:18px;box-shadow:0 15px 50px rgba(32,54,69,.14)}.history-head,.dialog-title{display:flex;justify-content:space-between;align-items:center}.history h2,.dialog-title h2{font-size:19px;margin:5px 0}.case-row{display:block;width:100%;text-align:left;background:transparent;border:0;border-bottom:1px solid #edf1f1;padding:14px 0;color:#253a4a}.case-row strong,.case-row small{display:block}.case-row small{color:#899ca5;margin-top:5px}.choice-dialog{border:0;border-radius:22px;width:min(420px,calc(100% - 32px));padding:22px;color:#253a4a;box-shadow:0 20px 70px #18344633}.choice-dialog::backdrop{background:#20364477}.choice-dialog p{font-size:13px;line-height:1.5;color:#83949d}.choice-row{display:flex;align-items:center;gap:13px;width:100%;padding:15px 0;border:0;border-bottom:1px solid #edf2f2;background:transparent;color:#253a4a;text-align:left}.choice-row>span:nth-child(2){flex:1}.choice-row strong,.choice-row small{display:block}.choice-row small{color:#8b9da5;margin-top:4px}.choice-row>span:last-child{font-size:24px;color:#a1b0b5}.choice-icon{width:40px;height:40px;border-radius:13px;background:#eaf4f7;color:#5e99b0;display:grid;place-items:center;font-size:23px}.notice{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);background:#253a4a;color:white;padding:12px 18px;border-radius:12px;font-size:13px;z-index:9}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}[hidden]{display:none!important}@media(max-width:600px){.topbar{height:65px;padding:0 18px}.history-toggle span{display:none}main{width:calc(100% - 32px);padding-top:clamp(38px,8vh,70px)}.intro h1{font-size:32px}.lead{font-size:14px}.steps{margin:27px 0}.composer{border-radius:21px}.intro-icon{width:54px;height:54px;margin-bottom:17px}.message.user{margin-left:25px}.history{right:12px;top:61px;width:calc(100% - 24px)}}

/* HomeEva 0.2: case follow-up, local backup, and review status. */
.field select,.field input[type=file]{display:block;width:100%;border:1px solid #e1e9e9;border-radius:10px;background:#fbfcfc;padding:11px;color:#253a4a;margin-top:6px;font-size:14px}
.field select{min-height:43px}
.field input[type=file]{font-size:12px}
.field textarea{display:block;min-height:94px;border:1px solid #e1e9e9;border-radius:10px;background:#fbfcfc;padding:11px;margin-top:6px;resize:vertical;font-size:14px}
.case-status{display:inline-flex;align-items:center;width:max-content;max-width:100%;border-radius:12px;padding:5px 9px;margin:7px 0;background:#edf3f5;color:#567583;font-size:11px;font-weight:650}
.case-status.due,.case-status.open{background:#fff1e8;color:#9d591d}
.case-status.observed{background:#e9f5ee;color:#37765a}
.case-status.pending{background:#edf0fa;color:#5f6e9b}
.inspection-section{border-top:1px solid #e3ecec;margin-top:24px;padding-top:9px}
.inspection-section h3{display:flex;align-items:center;gap:8px}
.count-indicator{background:#e5f1f5;color:#467b92;border-radius:50px;padding:2px 8px;font-size:11px}
.inspection-entry{padding:12px 0;border-bottom:1px solid #e8eeee}
.inspection-top{display:flex;gap:12px;flex-wrap:wrap;align-items:center;justify-content:space-between;font-size:13px}
.inspection-note{font-size:13px;white-space:pre-wrap;overflow-wrap:anywhere}
.inspection-photos{margin:9px 0}
.inspection-form{margin:18px 0 10px;padding:14px;background:#f7fafb;border-radius:15px}
.inspection-form .field{margin:0 0 12px}
.backup-import{margin-top:15px;border-top:1px solid #e7eded;padding-top:13px}
.backup-import .secondary{width:100%}
.backup-import #backup-all{margin-bottom:9px}

.ai-analysis-status { margin-top: 10px; padding: 10px; background-color: #f0f8ff; border-radius: 5px; }
.ai-analysis-status p { margin: 0; font-size: 14px; }
.ai-analysis-status .error { color: #d32f2f; }

.ai-analysis-result { 
  margin-top: 10px; 
  padding: 10px; 
  background-color: #f9f9f9; 
  border-radius: 5px; 
  border-left: 4px solid #4caf50;
}
.ai-analysis-result h4 { 
  margin-top: 0; 
  margin-bottom: 8px; 
  color: #333;
}
.ai-analysis-result p { 
  margin: 5px 0; 
  font-size: 13px;
}
.ai-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

/* Новый дизайн HomeEva */

.homeeva-app {
  background: linear-gradient(135deg, #fff9f2 0%, #f8f4f0 100%);
  min-height: 100dvh;
}

.topbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 5vw, 72px);
  border-bottom: 1px solid #f0e9e0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #253a4a;
  font-weight: 750;
  letter-spacing: .08em;
  text-decoration: none;
  font-size: 14px;
}

.brand small {
  font-size: 10px;
  font-weight: 600;
  color: #9d8b73;
  letter-spacing: .15em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f0e9e0 0%, #e8d8c0 100%);
  color: #a67b4a;
  font-family: Georgia, serif;
  font-weight: 700;
  font-size: 25px;
  letter-spacing: 0;
  box-shadow: 0 2px 8px rgba(166, 123, 74, 0.1);
}

.app-main {
  width: min(100% - 40px, 720px);
  margin: 0 auto;
  padding: clamp(42px, 10vh, 112px) 0 50px;
}

.intro {
  text-align: center;
}

.intro-icon {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin: 0 auto 22px;
  border-radius: 22px;
  background: linear-gradient(135deg, #f0e9e0 0%, #e8d8c0 100%);
  color: #a67b4a;
  box-shadow: 0 4px 12px rgba(166, 123, 74, 0.15);
}

.intro-icon svg {
  width: 33px;
  height: 33px;
}

.eyebrow {
  font-size: 10px;
  letter-spacing: .16em;
  font-weight: 750;
  color: #9d8b73;
}

.intro h1 {
  font-size: clamp(30px, 4vw, 43px);
  line-height: 1.17;
  letter-spacing: -0.045em;
  font-weight: 650;
  margin: 12px 0 16px;
  color: #253a4a;
}

.lead {
  max-width: 490px;
  margin: 0 auto;
  color: #6e818c;
  line-height: 1.65;
  font-size: 15px;
}

.steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 31px 0 36px;
  color: #9d8b73;
  font-size: 12px;
}

.steps span:not(.step-line) {
  display: flex;
  align-items: center;
  gap: 7px;
}

.steps i {
  font-style: normal;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid #f0e9e0;
  border-radius: 50%;
  color: #a67b4a;
  font-size: 10px;
}

.step-line {
  width: 20px;
  height: 1px;
  background: #f0e9e0;
}

.workspace {
  max-width: 650px;
  margin: auto;
}

.composer {
  border: 1px solid #f0e9e0;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  padding: 18px 17px 13px;
  box-shadow: 0 14px 40px rgba(166, 123, 74, 0.065);
  backdrop-filter: blur(5px);
  position: relative;
}

.composer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  background: linear-gradient(45deg, #f0e9e0, #e8d8c0, #f0e9e0);
  border-radius: 25px;
  z-index: -1;
  opacity: 0.3;
}

textarea {
  border: 0;
  resize: none;
  background: transparent;
  width: 100%;
  color: #253a4a;
  line-height: 1.5;
  outline: 0;
  min-height: 64px;
  max-height: 180px;
  font-size: 15px;
}

textarea::placeholder {
  color: #a7b3b8;
}

.composer-bottom, .composer-tools, .composer-actions {
  display: flex;
  align-items: center;
}

.composer-bottom {
  justify-content: space-between;
}

.composer-tools {
  gap: 9px;
  color: #9d8b73;
  font-size: 12px;
}

.add-button {
  width: 39px;
  height: 39px;
  border-radius: 13px;
  border: 0;
  background: linear-gradient(135deg, #f0e9e0 0%, #e8d8c0 100%);
  color: #a67b4a;
  font-size: 27px;
  font-weight: 300;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(166, 123, 74, 0.1);
  transition: all 0.2s ease;
}

.add-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(166, 123, 74, 0.15);
}

.composer-actions {
  gap: 6px;
}

.send-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, #f0e9e0 0%, #e8d8c0 100%);
  color: #a67b4a;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(166, 123, 74, 0.2);
  transition: all 0.2s ease;
}

.send-button:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 15px rgba(166, 123, 74, 0.25);
}

.voice-status {
  font-size: 11px;
  color: #9d8b73;
}

.privacy-note {
  text-align: center;
  color: #9d8b73;
  font-size: 11px;
  line-height: 1.5;
  margin: 15px 0;
}

.photo-strip {
  display: flex;
  gap: 8px;
  overflow: auto;
  margin-bottom: 15px;
}

.photo-thumb {
  position: relative;
  flex: none;
  width: 74px;
  height: 74px;
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(166, 123, 74, 0.1);
}

.photo-thumb button {
  position: absolute;
  right: 3px;
  top: 3px;
  width: 23px;
  height: 23px;
  border: 0;
  border-radius: 50%;
  background: rgba(166, 123, 74, 0.75);
  color: white;
  font-size: 17px;
}

.photo-thumb span {
  position: absolute;
  bottom: 3px;
  left: 4px;
  color: white;
  text-shadow: 0 1px 3px #000;
  font-size: 9px;
}

.conversation {
  margin-bottom: 20px;
}

.message {
  margin-bottom: 16px;
  line-height: 1.6;
  font-size: 14px;
}

.message.eva {
  display: flex;
  gap: 12px;
}

.eva-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 11px;
  background: linear-gradient(135deg, #f0e9e0 0%, #e8d8c0 100%);
  color: #a67b4a;
  font-family: Georgia, serif;
  font-size: 21px;
  box-shadow: 0 2px 6px rgba(166, 123, 74, 0.1);
}

.bubble {
  flex: 1;
  min-width: 0;
}

.bubble strong {
  display: block;
  margin: 3px 0 6px;
  color: #253a4a;
}

.message.user {
  background: linear-gradient(135deg, #f0e9e0 0%, #e8d8c0 100%);
  border-radius: 18px;
  padding: 13px 16px;
  margin-left: 44px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  box-shadow: 0 2px 8px rgba(166, 123, 74, 0.1);
}

.context-card {
  background: linear-gradient(135deg, #fff9f2 0%, #f8f4f0 100%);
  border: 1px solid #f0e9e0;
  border-radius: 18px;
  padding: 17px;
  margin: 14px 0;
  box-shadow: 0 4px 12px rgba(166, 123, 74, 0.05);
}

.field {
  display: block;
  margin: 13px 0;
  color: #6c818c;
  font-size: 12px;
}

.field input {
  display: block;
  width: 100%;
  border: 1px solid #f0e9e0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.8);
  padding: 11px;
  color: #253a4a;
  margin-top: 6px;
  font-size: 14px;
  box-shadow: inset 0 2px 6px rgba(166, 123, 74, 0.05);
}

.field input[type=date] {
  min-height: 43px;
}

.chip-row {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.chip {
  border: 1px solid #f0e9e0;
  color: #6c818c;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 20px;
  padding: 8px 12px;
  font-size: 12px;
  box-shadow: 0 2px 6px rgba(166, 123, 74, 0.05);
}

.chip[aria-pressed=true] {
  background: linear-gradient(135deg, #f0e9e0 0%, #e8d8c0 100%);
  border-color: #a67b4a;
  color: #253a4a;
}

.actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.primary, .secondary {
  border-radius: 12px;
  padding: 11px 15px;
  font-size: 13px;
  font-weight: 600;
}

.primary {
  background: linear-gradient(135deg, #f0e9e0 0%, #e8d8c0 100%);
  color: #253a4a;
  border: 1px solid #a67b4a;
}

.secondary {
  background: rgba(255, 255, 255, 0.8);
  color: #253a4a;
  border: 1px solid #f0e9e0;
  box-shadow: 0 2px 6px rgba(166, 123, 74, 0.05);
}

.detail {
  color: #9d8b73;
  font-size: 12px;
  line-height: 1.55;
}

.draft {
  white-space: pre-wrap;
  line-height: 1.65;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.draft-edit {
  min-height: 220px;
  border: 1px solid #f0e9e0;
  border-radius: 12px;
  padding: 12px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: inset 0 2px 6px rgba(166, 123, 74, 0.05);
}

.timeline {
  list-style: none;
  padding: 0;
  margin: 12px 0;
}

.timeline li {
  border-left: 1px solid #f0e9e0;
  padding: 0 0 13px 16px;
  margin-left: 5px;
  font-size: 13px;
}

.timeline li:before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a67b4a;
  margin: 0 10px 0 -20px;
}

.timeline small {
  display: block;
  margin: 3px 0 0;
  color: #9d8b73;
}

.history {
  position: fixed;
  z-index: 5;
  right: 20px;
  top: 68px;
  width: min(350px, calc(100% - 40px));
  max-height: 70vh;
  overflow: auto;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #f0e9e0;
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 15px 50px rgba(166, 123, 74, 0.14);
  backdrop-filter: blur(10px);
}

.history-head, .dialog-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history h2, .dialog-title h2 {
  font-size: 19px;
  margin: 5px 0;
}

.case-row {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #f0e9e0;
  padding: 14px 0;
  color: #253a4a;
}

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

.case-row small {
  color: #9d8b73;
  margin-top: 5px;
}

.choice-dialog {
  border: 0;
  border-radius: 22px;
  width: min(420px, calc(100% - 32px));
  padding: 22px;
  color: #253a4a;
  box-shadow: 0 20px 70px rgba(166, 123, 74, 0.1);
  background: linear-gradient(135deg, #fff9f2 0%, #f8f4f0 100%);
}

.choice-dialog::backdrop {
  background: rgba(166, 123, 74, 0.4);
}

.choice-dialog p {
  font-size: 13px;
  line-height: 1.5;
  color: #9d8b73;
}

.choice-row {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 15px 0;
  border: 0;
  border-bottom: 1px solid #f0e9e0;
  background: transparent;
  color: #253a4a;
  text-align: left;
}

.choice-row>span:nth-child(2) {
  flex: 1;
}

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

.choice-row small {
  color: #9d8b73;
  margin-top: 4px;
}

.choice-row>span:last-child {
  font-size: 24px;
  color: #9d8b73;
}

.choice-icon {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: linear-gradient(135deg, #f0e9e0 0%, #e8d8c0 100%);
  color: #a67b4a;
  display: grid;
  place-items: center;
  font-size: 23px;
}

.notice {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(37, 58, 74, 0.9);
  color: white;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 13px;
  z-index: 9;
  backdrop-filter: blur(5px);
}

@media(max-width: 600px) {
  .topbar {
    height: 65px;
    padding: 0 18px;
  }
  
  .history-toggle span {
    display: none;
  }
  
  main {
    width: calc(100% - 32px);
    padding-top: clamp(38px, 8vh, 70px);
  }
  
  .intro h1 {
    font-size: 32px;
  }
  
  .lead {
    font-size: 14px;
  }
  
  .steps {
    margin: 27px 0;
  }
  
  .composer {
    border-radius: 21px;
  }
  
  .intro-icon {
    width: 54px;
    height: 54px;
    margin-bottom: 17px;
  }
  
  .message.user {
    margin-left: 25px;
  }
  
  .history {
    right: 12px;
    top: 61px;
    width: calc(100% - 24px);
  }
  
  .primary, .secondary {
    padding: 10px 14px;
    font-size: 12px;
  }
}

/* Дополнительные стили для ИИ-анализа */
.ai-analysis-status {
  background: rgba(240, 233, 224, 0.7);
  border-radius: 12px;
  padding: 12px;
  margin-top: 10px;
  text-align: center;
  color: #a67b4a;
  font-size: 13px;
}

.ai-analysis-result {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  padding: 15px;
  margin-top: 10px;
  border: 1px solid #f0e9e0;
  box-shadow: 0 2px 6px rgba(166, 123, 74, 0.05);
}

.ai-analysis-result h3 {
  margin-top: 0;
  color: #a67b4a;
  font-size: 14px;
}

.ai-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 10px;
}

.ai-actions button {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  background: linear-gradient(135deg, #f0e9e0 0%, #e8d8c0 100%);
  color: #253a4a;
  border: 1px solid #a67b4a;
}

.ai-actions button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.error {
  color: #e74c3c;
}

/* Новый дизайн HomeEva */

.homeeva-app {
  background: linear-gradient(135deg, #fff9f2 0%, #f8f4f0 100%);
  min-height: 100dvh;
}

.topbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 5vw, 72px);
  border-bottom: 1px solid #f0e9e0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #253a4a;
  font-weight: 750;
  letter-spacing: .08em;
  text-decoration: none;
  font-size: 14px;
}

.brand small {
  font-size: 10px;
  font-weight: 600;
  color: #9d8b73;
  letter-spacing: .15em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f0e9e0 0%, #e8d8c0 100%);
  color: #a67b4a;
  font-family: Georgia, serif;
  font-weight: 700;
  font-size: 25px;
  letter-spacing: 0;
  box-shadow: 0 2px 8px rgba(166, 123, 74, 0.1);
}

.app-main {
  width: min(100% - 40px, 720px);
  margin: 0 auto;
  padding: clamp(42px, 10vh, 112px) 0 50px;
}

.intro {
  text-align: center;
}

.intro-icon {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin: 0 auto 22px;
  border-radius: 22px;
  background: linear-gradient(135deg, #f0e9e0 0%, #e8d8c0 100%);
  color: #a67b4a;
  box-shadow: 0 4px 12px rgba(166, 123, 74, 0.15);
}

.intro-icon svg {
  width: 33px;
  height: 33px;
}

.eyebrow {
  font-size: 10px;
  letter-spacing: .16em;
  font-weight: 750;
  color: #9d8b73;
}

.intro h1 {
  font-size: clamp(30px, 4vw, 43px);
  line-height: 1.17;
  letter-spacing: -0.045em;
  font-weight: 650;
  margin: 12px 0 16px;
  color: #253a4a;
}

.lead {
  max-width: 490px;
  margin: 0 auto;
  color: #6e818c;
  line-height: 1.65;
  font-size: 15px;
}

.steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 31px 0 36px;
  color: #9d8b73;
  font-size: 12px;
}

.steps span:not(.step-line) {
  display: flex;
  align-items: center;
  gap: 7px;
}

.steps i {
  font-style: normal;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid #f0e9e0;
  border-radius: 50%;
  color: #a67b4a;
  font-size: 10px;
}

.step-line {
  width: 20px;
  height: 1px;
  background: #f0e9e0;
}

.workspace {
  max-width: 650px;
  margin: auto;
}

.composer {
  border: 1px solid #f0e9e0;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  padding: 18px 17px 13px;
  box-shadow: 0 14px 40px rgba(166, 123, 74, 0.065);
  backdrop-filter: blur(5px);
  position: relative;
}

.composer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  background: linear-gradient(45deg, #f0e9e0, #e8d8c0, #f0e9e0);
  border-radius: 25px;
  z-index: -1;
  opacity: 0.3;
}

textarea {
  border: 0;
  resize: none;
  background: transparent;
  width: 100%;
  color: #253a4a;
  line-height: 1.5;
  outline: 0;
  min-height: 64px;
  max-height: 180px;
  font-size: 15px;
}

textarea::placeholder {
  color: #a7b3b8;
}

.composer-bottom, .composer-tools, .composer-actions {
  display: flex;
  align-items: center;
}

.composer-bottom {
  justify-content: space-between;
}

.composer-tools {
  gap: 9px;
  color: #9d8b73;
  font-size: 12px;
}

.add-button {
  width: 39px;
  height: 39px;
  border-radius: 13px;
  border: 0;
  background: linear-gradient(135deg, #f0e9e0 0%, #e8d8c0 100%);
  color: #a67b4a;
  font-size: 27px;
  font-weight: 300;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(166, 123, 74, 0.1);
  transition: all 0.2s ease;
}

.add-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(166, 123, 74, 0.15);
}

.composer-actions {
  gap: 6px;
}

.send-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, #f0e9e0 0%, #e8d8c0 100%);
  color: #a67b4a;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(166, 123, 74, 0.2);
  transition: all 0.2s ease;
}

.send-button:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 15px rgba(166, 123, 74, 0.25);
}

.voice-status {
  font-size: 11px;
  color: #9d8b73;
}

.privacy-note {
  text-align: center;
  color: #9d8b73;
  font-size: 11px;
  line-height: 1.5;
  margin: 15px 0;
}

.photo-strip {
  display: flex;
  gap: 8px;
  overflow: auto;
  margin-bottom: 15px;
}

.photo-thumb {
  position: relative;
  flex: none;
  width: 74px;
  height: 74px;
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(166, 123, 74, 0.1);
}

.photo-thumb button {
  position: absolute;
  right: 3px;
  top: 3px;
  width: 23px;
  height: 23px;
  border: 0;
  border-radius: 50%;
  background: rgba(166, 123, 74, 0.75);
  color: white;
  font-size: 17px;
}

.photo-thumb span {
  position: absolute;
  bottom: 3px;
  left: 4px;
  color: white;
  text-shadow: 0 1px 3px #000;
  font-size: 9px;
}

.conversation {
  margin-bottom: 20px;
}

.message {
  margin-bottom: 16px;
  line-height: 1.6;
  font-size: 14px;
}

.message.eva {
  display: flex;
  gap: 12px;
}

.eva-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 11px;
  background: linear-gradient(135deg, #f0e9e0 0%, #e8d8c0 100%);
  color: #a67b4a;
  font-family: Georgia, serif;
  font-size: 21px;
  box-shadow: 0 2px 6px rgba(166, 123, 74, 0.1);
}

.bubble {
  flex: 1;
  min-width: 0;
}

.bubble strong {
  display: block;
  margin: 3px 0 6px;
  color: #253a4a;
}

.message.user {
  background: linear-gradient(135deg, #f0e9e0 0%, #e8d8c0 100%);
  border-radius: 18px;
  padding: 13px 16px;
  margin-left: 44px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  box-shadow: 0 2px 8px rgba(166, 123, 74, 0.1);
}

.context-card {
  background: linear-gradient(135deg, #fff9f2 0%, #f8f4f0 100%);
  border: 1px solid #f0e9e0;
  border-radius: 18px;
  padding: 17px;
  margin: 14px 0;
  box-shadow: 0 4px 12px rgba(166, 123, 74, 0.05);
}

.field {
  display: block;
  margin: 13px 0;
  color: #6c818c;
  font-size: 12px;
}

.field input {
  display: block;
  width: 100%;
  border: 1px solid #f0e9e0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.8);
  padding: 11px;
  color: #253a4a;
  margin-top: 6px;
  font-size: 14px;
  box-shadow: inset 0 2px 6px rgba(166, 123, 74, 0.05);
}

.field input[type=date] {
  min-height: 43px;
}

.chip-row {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.chip {
  border: 1px solid #f0e9e0;
  color: #6c818c;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 20px;
  padding: 8px 12px;
  font-size: 12px;
  box-shadow: 0 2px 6px rgba(166, 123, 74, 0.05);
}

.chip[aria-pressed=true] {
  background: linear-gradient(135deg, #f0e9e0 0%, #e8d8c0 100%);
  border-color: #a67b4a;
  color: #253a4a;
}

.actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.primary, .secondary {
  border-radius: 12px;
  padding: 11px 15px;
  font-size: 13px;
  font-weight: 600;
}

.primary {
  background: linear-gradient(135deg, #f0e9e0 0%, #e8d8c0 100%);
  color: #253a4a;
  border: 1px solid #a67b4a;
}

.secondary {
  background: rgba(255, 255, 255, 0.8);
  color: #253a4a;
  border: 1px solid #f0e9e0;
  box-shadow: 0 2px 6px rgba(166, 123, 74, 0.05);
}

.detail {
  color: #9d8b73;
  font-size: 12px;
  line-height: 1.55;
}

.draft {
  white-space: pre-wrap;
  line-height: 1.65;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.draft-edit {
  min-height: 220px;
  border: 1px solid #f0e9e0;
  border-radius: 12px;
  padding: 12px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: inset 0 2px 6px rgba(166, 123, 74, 0.05);
}

.timeline {
  list-style: none;
  padding: 0;
  margin: 12px 0;
}

.timeline li {
  border-left: 1px solid #f0e9e0;
  padding: 0 0 13px 16px;
  margin-left: 5px;
  font-size: 13px;
}

.timeline li:before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a67b4a;
  margin: 0 10px 0 -20px;
}

.timeline small {
  display: block;
  margin: 3px 0 0;
  color: #9d8b73;
}

.history {
  position: fixed;
  z-index: 5;
  right: 20px;
  top: 68px;
  width: min(350px, calc(100% - 40px));
  max-height: 70vh;
  overflow: auto;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #f0e9e0;
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 15px 50px rgba(166, 123, 74, 0.14);
  backdrop-filter: blur(10px);
}

.history-head, .dialog-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history h2, .dialog-title h2 {
  font-size: 19px;
  margin: 5px 0;
}

.case-row {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #f0e9e0;
  padding: 14px 0;
  color: #253a4a;
}

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

.case-row small {
  color: #9d8b73;
  margin-top: 5px;
}

.choice-dialog {
  border: 0;
  border-radius: 22px;
  width: min(420px, calc(100% - 32px));
  padding: 22px;
  color: #253a4a;
  box-shadow: 0 20px 70px rgba(166, 123, 74, 0.1);
  background: linear-gradient(135deg, #fff9f2 0%, #f8f4f0 100%);
}

.choice-dialog::backdrop {
  background: rgba(166, 123, 74, 0.4);
}

.choice-dialog p {
  font-size: 13px;
  line-height: 1.5;
  color: #9d8b73;
}

.choice-row {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 15px 0;
  border: 0;
  border-bottom: 1px solid #f0e9e0;
  background: transparent;
  color: #253a4a;
  text-align: left;
}

.choice-row>span:nth-child(2) {
  flex: 1;
}

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

.choice-row small {
  color: #9d8b73;
  margin-top: 4px;
}

.choice-row>span:last-child {
  font-size: 24px;
  color: #9d8b73;
}

.choice-icon {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: linear-gradient(135deg, #f0e9e0 0%, #e8d8c0 100%);
  color: #a67b4a;
  display: grid;
  place-items: center;
  font-size: 23px;
}

.notice {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(37, 58, 74, 0.9);
  color: white;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 13px;
  z-index: 9;
  backdrop-filter: blur(5px);
}

@media(max-width: 600px) {
  .topbar {
    height: 65px;
    padding: 0 18px;
  }
  
  .history-toggle span {
    display: none;
  }
  
  main {
    width: calc(100% - 32px);
    padding-top: clamp(38px, 8vh, 70px);
  }
  
  .intro h1 {
    font-size: 32px;
  }
  
  .lead {
    font-size: 14px;
  }
  
  .steps {
    margin: 27px 0;
  }
  
  .composer {
    border-radius: 21px;
  }
  
  .intro-icon {
    width: 54px;
    height: 54px;
    margin-bottom: 17px;
  }
  
  .message.user {
    margin-left: 25px;
  }
  
  .history {
    right: 12px;
    top: 61px;
    width: calc(100% - 24px);
  }
  
  .primary, .secondary {
    padding: 10px 14px;
    font-size: 12px;
  }
}

/* Дополнительные стили для ИИ-анализа */
.ai-analysis-status {
  background: rgba(240, 233, 224, 0.7);
  border-radius: 12px;
  padding: 12px;
  margin-top: 10px;
  text-align: center;
  color: #a67b4a;
  font-size: 13px;
}

.ai-analysis-result {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  padding: 15px;
  margin-top: 10px;
  border: 1px solid #f0e9e0;
  box-shadow: 0 2px 6px rgba(166, 123, 74, 0.05);
}

.ai-analysis-result h3 {
  margin-top: 0;
  color: #a67b4a;
  font-size: 14px;
}

.ai-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 10px;
}

.ai-actions button {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  background: linear-gradient(135deg, #f0e9e0 0%, #e8d8c0 100%);
  color: #253a4a;
  border: 1px solid #a67b4a;
}

.ai-actions button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.error {
  color: #e74c3c;
}

