.zf-screen {
  --zf-text: #f5ecdf;
  --zf-muted: #a6b7bf;
  --zf-apricot: #ffb375;
  --zf-line: #34505e;
  color: var(--zf-text);
  min-width: 0;
}
.zf-title h1, .zf-detail h2, .zf-offer h2, .zf-grid-center strong {
  margin: 0;
  color: var(--zf-text);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: -.04em;
  line-height: 1.07;
}
.zf-title h1 { font-size: clamp(2rem, 6cqi, 3.5rem); }
.zf-title p { color: var(--zf-muted); margin: .6rem 0 0; font-size: 1rem; }
.zf-title p span { padding: 0 .18rem; color: #d5aa76; }
.zf-map-layout { display: grid; gap: 1rem; align-items: start; margin-top: 1.35rem; }
.zf-grid {
  display: grid;
  isolation: isolate;
  grid-template-columns: repeat(4, minmax(0,1fr));
  grid-template-rows: repeat(4, minmax(0,1fr));
  aspect-ratio: 1.30;
  overflow: hidden;
  border: 1px solid #bc9364;
  background: #896f50;
  gap: 1px;
  border-radius: 15px;
}
.zf-cell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: .32rem;
  padding: .3rem .1rem;
  color: var(--zf-text);
  background: linear-gradient(140deg,#182a34,#11212d 80%);
  border: 0;
  border-radius: 0;
  text-align: center;
  cursor: pointer;
  font: 500 clamp(.72rem, 3.1cqi, 1rem)/1.2 Georgia, "Times New Roman", serif;
  transition: background .16s, color .16s;
}
.zf-cell-star { color: #e6ab75; line-height: 1; font-size: .85rem; }
.zf-cell:hover { background: #25333c; }
.zf-cell-selected, .zf-cell-selected:hover {
  background: radial-gradient(ellipse at 0 0,#684933,#423328 90%);
  box-shadow: inset 0 0 0 1.5px #ffb375;
  border-radius: 5px;
  color: #fff0db;
}
.zf-grid-center {
  grid-area: 2 / 2 / 4 / 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #f7e9cd;
  background: linear-gradient(0deg,#081b2a8a,#08162275 65%,#0a17202a),url('./assets/chart.webp') center / cover;
  text-align: center;
}
.zf-chart-star { color: #eec297; font-size: 1.6rem; line-height: 1; }
.zf-grid-center strong { font-size: clamp(1.55rem,7cqi,2.45rem); margin: .15rem 0 .28rem; }
.zf-grid-center>span { color: #ead8bd; font-size: .84rem; }
.zf-detail, .zf-message-bot {
  background: linear-gradient(135deg,#182c3a,#10222e 72%);
  border: 1px solid var(--zf-line);
}
.zf-detail { border-radius: 16px; padding: clamp(1rem,3cqi,1.65rem); }
.zf-detail-meta { display: none; }
.zf-detail h2 { display: flex; align-items: baseline; gap: .48rem; font-size: clamp(1.5rem,5.5cqi,2.35rem); }
.zf-detail-star { font: normal .78em/1 Georgia,serif; color: var(--zf-apricot); }
.zf-star-tag {
  margin-top: .85rem;
  padding: .34rem .55rem;
  border: 1px solid #997955;
  border-radius: 7px;
  color: #ffc58e;
  background: #84684924;
  font-family: inherit;
  font-size: .88rem;
  line-height: 1.15;
  font-weight: 500;
  cursor: pointer;
}
.zf-detail p, .zf-offer p { margin: .75rem 0 1rem; font-size: 1rem; line-height: 1.5; }
.zf-primary {
  cursor: pointer;
  width: 100%;
  min-height: 44px;
  padding: .72rem 1rem;
  background: #ffaf72;
  color: #241a13;
  font: 650 1rem/1.25 system-ui, sans-serif;
  border: 1px solid #ffc28e;
  border-radius: 10px;
  text-align: center;
}
.zf-primary:hover { background: #ffc28d; }
.zf-report-link {
  margin-top: 1.1rem;
  padding: .85rem 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 0;
  border-top: 1px solid #3a4950;
  color: #efdeca;
  background: transparent;
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.zf-chat-head, .zf-context-line, .zf-context, .zf-quiet, .zf-source {
  display: flex;
  align-items: center;
}
.zf-chat-head, .zf-context-line { justify-content: space-between; gap: .7rem; }
.zf-context-line { margin: 1rem 0 1.25rem; }
.zf-quiet, .zf-context, .zf-source, .zf-suggestions button {
  cursor: pointer;
  font-family: inherit;
  color: var(--zf-text);
}
.zf-quiet {
  flex-shrink: 0; min-height: 40px; border: 0; background: transparent; padding: .25rem;
  color: #e2bc8e; font-size: .87rem;
}
.zf-context, .zf-source {
  justify-content: center;
  gap: .43rem;
  border: 1px solid #7b705b;
  background: #172935;
  border-radius: 8px;
  font-size: .89rem;
  padding: .53rem .7rem;
}
.zf-demo { font-size: .78rem; color: var(--zf-muted); }
.zf-chat-layout { display: grid; align-items: start; gap: 1rem; }
.zf-conversation { min-width: 0; }
.zf-messages { display: grid; gap: .92rem; }
.zf-message-user {
  justify-self: end;
  max-width: 90%;
  padding: .7rem .85rem;
  border: 1px solid #496b83;
  border-radius: 15px 15px 4px 15px;
  background: linear-gradient(110deg,#2b4660,#233f55);
}
.zf-message-user p, .zf-message-bot p, .zf-start p {
  line-height: 1.52;
  font-size: 1rem;
  margin: 0;
  overflow-wrap: anywhere;
}
.zf-message-wrap { display: flex; gap: .52rem; align-items: flex-start; max-width: 100%; }
.zf-bot-symbol {
  flex: none;
  display: grid;
  place-items: center;
  width: 1.7rem; height: 1.7rem;
  border: 1px solid #bf8b5b;
  border-radius: 50%;
  color: var(--zf-apricot);
  background: #10202a;
  font-size: 1.2rem;
}
.zf-message-bot { border-radius: 4px 15px 15px; padding: .83rem .92rem; min-width: 0; }
.zf-message-bot b { display: block; color: var(--zf-apricot); font: 600 .9rem/1.2 system-ui,sans-serif; margin-bottom: .4rem; }
.zf-source { color: #f0dbbd; padding: .4rem .58rem; margin-top: .75rem; border-left: 3px solid var(--zf-apricot); }
.zf-suggestions { display:flex; flex-wrap:wrap; gap: .4rem; margin: .88rem 0; }
.zf-suggestions button {
  padding: .47rem .65rem; border: 1px solid var(--zf-line); border-radius: 99px;
  background: #0d202b; font-size: .81rem; line-height: 1.35; text-align: left;
}
.zf-suggestions button:hover, .zf-context:hover, .zf-source:hover { border-color: #c59b71; }
.zf-form {
  display: flex; align-items:center; gap: .3rem; padding: .28rem .3rem .28rem .75rem;
  border: 1px solid #4d6573; background: #152733; border-radius: 12px; margin: 0;
}
.zf-form:focus-within { border-color: var(--zf-apricot); }
.zf-form input { font: inherit; background: transparent; color: var(--zf-text); padding: .38rem 0; border: 0; width: 0; flex:1; outline: 0; }
.zf-form input::placeholder { color: #a4b4bd; }
.zf-form button {
  flex:none; width: 42px; height: 42px; display:grid; place-items:center;
  border: none; border-radius: 9px; background: var(--zf-apricot); color: #281a12; cursor: pointer;
}
#zf-latest { scroll-margin-top: 5rem; scroll-margin-bottom: 6rem; }
.zf-small { color: var(--zf-muted); font: 400 .79rem/1.4 system-ui,sans-serif; margin: .45rem .2rem 0; }
.zf-offer {
  border: 1px solid #a7875d;
  border-radius: 16px;
  padding: clamp(1rem,3cqi,1.5rem);
  background: linear-gradient(90deg,#322820fa 7%,#372b22dc 52%,#533c25a8),url('./assets/landscape.webp') right 65% / cover;
}
.zf-offer h2 { font-size: clamp(1.6rem,5.3cqi,2.25rem); }
.zf-offer p { margin: .4rem 0 .85rem; color: #ebdcc9; }
.zf-offer .zf-primary { width: auto; }
.zf-offer small { display:block; color:#e4d2bc; font-size:.8rem; margin-top:.55rem; }
.zf-start { padding:1.1rem; border:1px solid var(--zf-line); border-radius:14px; }
.zf-start p { margin-top:.45rem; color:var(--zf-muted); }
.zf-visually-hidden { clip-path: inset(100%); height: 1px; width: 1px; position: absolute; overflow: hidden; }
.zf-screen button:focus-visible { outline:2px solid #ffe1a9; outline-offset:2px; }
.zf-cell:focus-visible { outline-offset:-4px; }
@container atlas (min-width: 820px) {
  .zf-map-layout { grid-template-columns: minmax(350px,1.25fr) minmax(260px,.75fr); gap: 1.4rem; }
  .zf-grid { aspect-ratio: 1.16; }
  .zf-cell { font-size:clamp(.9rem,1.35cqi,1.24rem); }
  .zf-detail { align-self: stretch; display:flex; flex-direction:column; justify-content:center; }
  .zf-detail-meta { display:block; color:var(--zf-muted); font-size:.85rem; margin:0 0 1rem; }
  .zf-star-tag { align-self:flex-start; }
  .zf-detail p { margin:.95rem 0 1.4rem; }
  .zf-chat-layout { grid-template-columns: minmax(330px,1.3fr) minmax(230px,.7fr); gap:1.4rem; }
  .zf-context-line { justify-content:flex-start; }
}
@container atlas (max-width: 374px){
  .zf-cell { font-size:.82rem; }
  .zf-primary { font-size:.93rem; }
  .zf-bot-symbol { display:none; }
}

@container atlas (max-width: 740px) {
  .zf-map-layout, .zf-chat-layout { min-width: 0; }
  .zf-map-layout { margin-top: 1rem; gap: .85rem; }
  .zf-grid { aspect-ratio: 1.38; }
  .zf-cell {
    min-width: 0;
    font-size: clamp(.83rem, 3.5cqi, 1rem);
    line-height: 1.16;
    overflow-wrap: anywhere;
  }
  .zf-detail, .zf-offer { padding: 1rem; }
  .zf-title h1 { font-size: clamp(2rem, 8.1cqi, 2.7rem); }
  .zf-context, .zf-quiet, .zf-star-tag, .zf-report-link,
  .zf-source, .zf-suggestions button, .zf-form button { min-height: 44px; }
  .zf-form button { min-width: 44px; }
  .zf-report-link { margin-top: .8rem; padding: .65rem 0 0; }
  .zf-suggestions { gap: .5rem; }
  .zf-form input { min-height: 44px; font-size: 16px; }
  .zf-context-line { margin-block: .8rem 1rem; }
  .zf-message-wrap { max-width: 100%; }
  .zf-start, .zf-form, .zf-offer, .zf-detail { scroll-margin-bottom: 78px; }
}

.zf-pair-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  color: var(--gold);
  margin-top: 8px;
  text-decoration: underline;
  text-underline-offset: 4px;
}
