.zei-demo {
  --demo-ink: #172f46;
  --demo-blue: #0d5de8;
  --demo-lime: #ddfa6c;
  --demo-muted: #536579;
  box-sizing: border-box;
  min-inline-size: 0;
  width: 100%;
  margin: 0;
  padding: clamp(12px, 2.4vw, 24px);
  border: 0;
  border-radius: 24px;
  background: var(--demo-ink);
  color: #fff;
  text-align: left;
  font-family: inherit;
}

.zei-demo *,
.zei-demo *::before,
.zei-demo *::after { box-sizing: inherit; }

.zei-demo__sr,
.zei-demo__radio {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

.zei-demo__controls { margin-bottom: 16px; }

.zei-demo__caption {
  display: block;
  margin: 0 0 9px 2px;
  color: #d8e4f2;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .045em;
}

.zei-demo__labels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.zei-demo__labels label {
  display: flex;
  min-height: 45px;
  align-items: center;
  justify-content: center;
  gap: .45em;
  padding: 7px 5px;
  border: 1px solid #506478;
  border-radius: 8px;
  background: #233d55;
  color: #fff;
  font-size: clamp(.7rem, 1.5vw, .9rem);
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  cursor: pointer;
}

.zei-demo__labels b {
  color: #c4d5e7;
  font-family: Arial, sans-serif;
  font-size: .85em;
  font-variant-numeric: tabular-nums;
}

.zei-demo__labels label:hover { background: #2e4d6a; }

#zei-demo-send:checked ~ .zei-demo__controls [for="zei-demo-send"],
#zei-demo-read:checked ~ .zei-demo__controls [for="zei-demo-read"],
#zei-demo-total:checked ~ .zei-demo__controls [for="zei-demo-total"] {
  border-color: var(--demo-lime);
  background: var(--demo-lime);
  color: var(--demo-ink);
}

#zei-demo-send:checked ~ .zei-demo__controls [for="zei-demo-send"] b,
#zei-demo-read:checked ~ .zei-demo__controls [for="zei-demo-read"] b,
#zei-demo-total:checked ~ .zei-demo__controls [for="zei-demo-total"] b { color: var(--demo-ink); }

#zei-demo-send:focus-visible ~ .zei-demo__controls [for="zei-demo-send"],
#zei-demo-read:focus-visible ~ .zei-demo__controls [for="zei-demo-read"],
#zei-demo-total:focus-visible ~ .zei-demo__controls [for="zei-demo-total"] {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.zei-demo .zei-demo__view {
  display: none;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.04fr);
  align-items: stretch;
  min-height: 262px;
  padding: 0;
  border: 1px solid #dce6f4;
  border-radius: 15px;
  overflow: hidden;
  background: #fff;
  color: var(--demo-ink);
}

#zei-demo-send:checked ~ .zei-demo__frames .zei-demo__view--send,
#zei-demo-read:checked ~ .zei-demo__frames .zei-demo__view--read,
#zei-demo-total:checked ~ .zei-demo__frames .zei-demo__view--total { display: grid; }

.zei-demo__visual {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 245px;
  place-items: center;
  padding: 23px 16px;
  overflow: hidden;
  background: #e9f0ff;
}

.zei-demo__visual--paper {
  background:
    radial-gradient(circle at 80% 9%, #f1f7f4 0, transparent 64%),
    repeating-linear-gradient(133deg, #dbe5f8 0 1px, transparent 1px 6px),
    #e8f0ff;
}

.zei-demo__visual--read { background: linear-gradient(156deg, #dce6ff, #f0f5ff); }
.zei-demo__visual--total { background: linear-gradient(156deg, #ebf5c9, #f5f8e9); }

.zei-demo__receipt {
  display: grid;
  gap: 5px;
  width: min(69%, 152px);
  padding: 14px 13px 17px;
  background: #fffcf4;
  box-shadow: 1px 9px 24px #18385b35;
  color: #324359;
  font-family: "Yu Gothic UI", Meiryo, sans-serif;
  font-size: .66rem;
  line-height: 1.4;
  transform: rotate(-7deg) translateY(-4px);
}

.zei-demo__receipt::after {
  position: absolute;
  inset: auto 0 -5px;
  height: 6px;
  background: linear-gradient(135deg, #fffcf4 50%, transparent 51%) 0 0 / 10px 10px repeat-x;
  content: "";
}

.zei-demo__receipt strong {
  margin-bottom: 3px;
  color: var(--demo-ink);
  font-size: .9rem;
  text-align: center;
}

.zei-demo__receipt b {
  margin-top: 3px;
  padding-top: 5px;
  border-top: 1px dashed #a0aebe;
  color: var(--demo-ink);
  font-family: Arial, sans-serif;
  font-size: .9rem;
  text-align: right;
}

.zei-demo__file {
  position: absolute;
  bottom: 17px;
  left: 50%;
  padding: 3px 8px;
  border-radius: 6px;
  background: #fff;
  color: #3d5067;
  font-size: .68rem;
  font-weight: 700;
  white-space: nowrap;
  transform: translateX(-50%);
}

.zei-demo__report {
  width: min(100%, 213px);
  padding: 11px 12px;
  border: 1px solid #d9e4f0;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 8px 20px #213d6620;
}

.zei-demo .zei-demo__report-title {
  margin: 0 0 5px;
  color: var(--demo-ink);
  font-size: .72rem;
  font-weight: 800;
  line-height: 1.35;
}

.zei-demo__report dl,
.zei-demo__report dd { margin: 0; }

.zei-demo__report dl div {
  display: flex;
  justify-content: space-between;
  gap: 5px 8px;
  padding: 5px 0;
  border-top: 1px solid #e7eef4;
  color: #526477;
  font-size: .67rem;
  line-height: 1.35;
}

.zei-demo__report dd {
  color: var(--demo-ink);
  font-weight: 800;
  text-align: right;
}

.zei-demo__report .zei-demo__amount dd { color: #0a4ebf; }

.zei-demo__total {
  display: block;
  color: var(--demo-ink);
  font-family: Arial, sans-serif;
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  line-height: 1.25;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}

.zei-demo__chart {
  display: flex;
  gap: 4px;
  height: 6px;
  margin: 8px 0 10px;
}

.zei-demo__chart span { flex: 110; border-radius: 6px; background: var(--demo-blue); }
.zei-demo__chart span:nth-child(2) { flex: 72.6; background: #6c90f8; }
.zei-demo__chart span:nth-child(3) { flex: 66; background: #adc341; }

.zei-demo__body {
  align-self: center;
  padding: 23px clamp(16px, 3vw, 28px);
}

.zei-demo .zei-demo__body h3 {
  margin: 13px 0 9px;
  color: var(--demo-ink);
  font-size: clamp(1.2rem, 2.3vw, 1.7rem);
  font-weight: 800;
  line-height: 1.32;
  letter-spacing: -.04em;
}

.zei-demo .zei-demo__body p:not(.zei-demo__status) {
  margin: 0;
  color: var(--demo-muted);
  font-size: .85rem;
  line-height: 1.65;
}

.zei-demo .zei-demo__status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  padding: 3px 8px 3px 5px;
  border-radius: 999px;
  background: #e8f0ff;
  color: #174d9a;
  font-size: .73rem;
  font-weight: 800;
  line-height: 1.3;
}

.zei-demo__status span {
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  border-radius: 50%;
  background: var(--demo-blue);
  color: #fff;
}

@media (max-width: 540px) {
  .zei-demo { border-radius: 18px; }
  .zei-demo .zei-demo__view { grid-template-columns: minmax(0, 1fr); }
  .zei-demo__visual { min-height: 192px; padding: 14px; }
  .zei-demo__body { align-self: start; padding: 16px; }
}

@media (max-width: 380px) {
  .zei-demo__labels b { display: none; }
  .zei-demo__labels label { min-height: 43px; }
}

.zei-chat {
  --chat-ink: #172f46;
  --chat-muted: #536579;
  --chat-chrome: #fcfdff;
  --chat-bg: #dce8f6;
  --chat-accent: #d6f3c7;
  display: grid;
  width: min(100%, 440px);
  margin-inline: auto;
  overflow: hidden;
  border: 1px solid #bbccdf;
  border-radius: 25px;
  background: var(--chat-chrome);
  box-shadow: 0 20px 40px #1a365624, 0 3px 7px #1a36560f;
  color: var(--chat-ink);
  font: inherit;
  text-align: left;
}

.zei-chat *,
.zei-chat *::before,
.zei-chat *::after { box-sizing: border-box; }

.zei-chat__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.zei-chat__header {
  display: flex;
  min-height: 69px;
  align-items: center;
  gap: 11px;
  padding: 10px 14px;
  background: #244969;
  color: #fff;
}

.zei-chat__line-icon {
  display: block;
  flex: 0 0 50px;
  width: 50px;
  height: auto;
}

.zei-chat__heading { display: grid; gap: 2px; margin-right: auto; }

.zei-chat__heading strong {
  font-size: .96rem;
  font-weight: 800;
  line-height: 1.3;
}

.zei-chat .zei-chat__reset {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 9px;
  border: 1px solid #92acc7;
  border-radius: 9px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: .72rem;
  font-weight: 700;
  cursor: pointer;
}

.zei-chat .zei-chat__privacy {
  margin: 0;
  padding: 8px 12px;
  border-bottom: 1px solid #d2e0ed;
  background: #f1f7fd;
  color: #39536b;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.5;
}

.zei-chat__thread {
  display: flex;
  min-width: 0;
  min-height: 260px;
  height: clamp(290px, 51vw, 371px);
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 17px 15px 20px;
  background: linear-gradient(145deg, #e5eff9, var(--chat-bg) 55%, #c7d9ed);
  scrollbar-color: #8fa9c5 transparent;
  scrollbar-width: thin;
}

.zei-chat .zei-chat__bubble {
  position: relative;
  max-width: min(90%, 325px);
  margin: 0;
  padding: 9px 12px;
  border: 1px solid #c9dbea;
  border-radius: 5px 13px 13px;
  background: #fff;
  color: var(--chat-ink);
  font-size: .87rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.zei-chat__message {
  display: flex;
  width: 100%;
  flex: 0 0 auto;
  align-items: flex-start;
  gap: 7px;
}

.zei-chat__reply-avatar {
  display: grid;
  flex: 0 0 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: #172f46;
  color: #ddfa6c;
  font: 900 15px/1 Arial, sans-serif;
}

.zei-chat__message .zei-chat__bubble--agent { max-width: min(calc(100% - 37px), 325px); }
.zei-chat__message .zei-chat__record { max-width: calc(100% - 37px); }

.zei-chat .zei-chat__bubble::before {
  position: absolute;
  top: 9px;
  left: -6px;
  width: 7px;
  height: 9px;
  background: #fff;
  clip-path: polygon(0 0, 100% 22%, 100% 100%);
  content: "";
}

.zei-chat .zei-chat__bubble--user {
  align-self: flex-end;
  border-color: #b9d3a0;
  border-radius: 13px 5px 13px 13px;
  background: #d6f3c7;
  color: #254132;
  font-weight: 700;
}

.zei-chat .zei-chat__bubble--user::before {
  right: -6px;
  left: auto;
  background: #d6f3c7;
  clip-path: polygon(0 22%, 100% 0, 0 100%);
}

.zei-chat__tray {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-top: 1px solid #d2e0ed;
  background: #fff;
}

.zei-chat__tray[hidden] { display: none; }

.zei-chat__tray-preview {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.zei-chat .zei-chat__tray-preview .zei-chat__photo {
  width: 70px;
  height: 62px;
  border-radius: 8px;
  background: #eef4fb;
  object-fit: contain;
}

.zei-chat .zei-chat__tray-preview .zei-chat__receipt {
  width: 91px;
  padding: 4px 6px 8px;
  gap: 1px;
  font-size: 9px;
}

.zei-chat .zei-chat__tray-preview .zei-chat__receipt strong { font-size: 9px; }

.zei-chat .zei-chat__send {
  display: grid;
  flex: 0 0 44px;
  height: 44px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #0d53ce;
  color: #fff;
  cursor: pointer;
}

.zei-chat .zei-chat__send:disabled { opacity: .45; cursor: default; }

.zei-chat__send-plane {
  width: 21px;
  height: 21px;
  background: currentColor;
  clip-path: polygon(0 8%, 98% 48%, 0 92%, 17% 55%, 62% 48%, 17% 42%);
}

.zei-chat .zei-chat__sent-photo {
  display: grid;
  max-width: 85%;
  flex: 0 0 auto;
  align-self: flex-end;
  justify-items: end;
  gap: 4px;
  margin: 0;
}

.zei-chat .zei-chat__sent-photo .zei-chat__receipt {
  width: 146px;
  border: 1px solid #c8d5e3;
  border-radius: 8px;
  box-shadow: none;
  clip-path: none;
}

.zei-chat .zei-chat__sent-photo .zei-chat__photo { border-radius: 8px; }

.zei-chat__actions {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 11px 12px;
  border-top: 1px solid #d2e0ed;
  background: var(--chat-chrome);
}

.zei-chat .zei-chat__choice {
  box-sizing: border-box;
  min-height: 44px;
  padding: 5px 10px;
  border: 1px solid #b5c8d9;
  border-radius: 100vw;
  background: #fff;
  color: #254968;
  font: inherit;
  font-size: .79rem;
  font-weight: 750;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
}

.zei-chat .zei-chat__choice--primary {
  border-color: #8ec386;
  background: var(--chat-accent);
  color: #203321;
}

.zei-chat .zei-chat__choice--muted { color: #51685e; }

.zei-chat :is(button, [tabindex]):focus-visible {
  outline: 2px solid #0d60bd;
  outline-offset: -2px;
}

.zei-chat .zei-chat__reset:focus-visible { outline-color: #fff; }

@media (hover: hover) {
  .zei-chat .zei-chat__choice:hover { background: #eef5fc; }
  .zei-chat .zei-chat__choice--primary:hover { background: #c3e9b2; }
  .zei-chat .zei-chat__reset:hover { background: #355e82; }
}

.zei-chat .zei-chat__example {
  display: grid;
  max-width: 92%;
  flex: 0 0 auto;
  justify-items: center;
  gap: 8px;
  margin: 0;
  padding: 11px 12px 8px;
  border: 1px solid #d1dfd4;
  border-radius: 11px;
  background: #f9fcf9;
}

.zei-chat .zei-chat__figure-caption {
  color: var(--chat-muted);
  font-size: .67rem;
  line-height: 1.35;
}

.zei-chat__receipt {
  display: grid;
  width: 133px;
  gap: 3px;
  padding: 11px 12px 13px;
  background: #fffdf5;
  box-shadow: 0 2px 5px #192f4632;
  color: #34465c;
  font-size: .68rem;
  line-height: 1.45;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 90% 96%, 80% 100%, 70% 96%, 60% 100%, 50% 96%, 40% 100%, 30% 96%, 20% 100%, 10% 96%, 0 100%);
}

.zei-chat__receipt strong {
  padding-bottom: 3px;
  color: var(--chat-ink);
  font-size: .77rem;
  text-align: center;
}

.zei-chat__receipt b {
  border-top: 1px dashed #a0abbb;
  padding-top: 3px;
  color: var(--chat-ink);
  text-align: right;
}

.zei-chat .zei-chat__photo {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 172px;
  object-fit: contain;
}

.zei-chat .zei-chat__preview-note {
  margin: 0;
  color: var(--chat-muted);
  font-size: .77rem;
}

.zei-chat__record {
  width: min(92%, 244px);
  flex: 0 0 auto;
  padding: 11px 13px 8px;
  border: 1px solid #cbded2;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 4px 10px #223a4c0b;
  color: var(--chat-ink);
  font-size: .79rem;
}

.zei-chat__record > strong { display: block; margin-bottom: 5px; }

.zei-chat .zei-chat__record dl,
.zei-chat .zei-chat__record dd { margin: 0; }

.zei-chat__record dl div {
  display: flex;
  justify-content: space-between;
  gap: 7px;
  padding: 4px 0;
  border-top: 1px solid #e2ede7;
  color: var(--chat-muted);
  line-height: 1.38;
}

.zei-chat__record dd {
  color: var(--chat-ink);
  font-weight: 800;
  text-align: right;
}

@media (max-width: 390px) {
  .zei-chat { border-radius: 20px; }
  .zei-chat__header { gap: 8px; padding-inline: 10px; }
  .zei-chat__thread { padding-inline: 10px; }
  .zei-chat__actions { padding-inline: 8px; }
}
