:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #f3f6f5;
  color: #18211f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
textarea,
input {
  font: inherit;
}

.demo-shell {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.demo-post {
  padding: 24px 0 28px;
}

.demo-kicker {
  margin: 0 0 8px;
  color: #0f7b62;
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

.demo-post h1 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 6vw, 4.2rem);
  line-height: 1;
  letter-spacing: 0;
}

.demo-post p {
  max-width: 720px;
  color: #596763;
  line-height: 1.65;
}

.zb {
  --zb-accent: #0f7b62;
  --zb-accent-dark: #0b604e;
  --zb-amber: #b96a12;
  --zb-bg: #fbfcfc;
  --zb-surface: #ffffff;
  --zb-soft: #f4f8f6;
  --zb-line: #dce5e1;
  --zb-line-strong: #c7d3ce;
  --zb-text: #17211f;
  --zb-muted: #66736f;
  --zb-shadow: 0 18px 48px rgba(17, 32, 28, 0.1);
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--zb-line);
  border-radius: 8px;
  background: var(--zb-bg);
  color: var(--zb-text);
  box-shadow: var(--zb-shadow);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

.zb [hidden] {
  display: none !important;
}

.zb-header,
.zb-composer,
.zb-empty,
.zb-error {
  padding: 18px;
}

.zb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--zb-line);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfa 100%);
}

.zb-title-wrap {
  display: grid;
  gap: 3px;
}

.zb-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 780;
  line-height: 1.2;
  letter-spacing: 0;
}

.zb-count,
.zb-handle,
.zb-time,
.zb-empty,
.zb-error,
.zb-login-copy,
.zb-editor-meta {
  color: var(--zb-muted);
  font-size: 0.86rem;
}

.zb-userbar,
.zb-actions,
.zb-toolbar,
.zb-reactions,
.zb-provider-list,
.zb-formatbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.zb-current-user {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid var(--zb-line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--zb-text);
  padding: 7px 10px;
  font-size: 0.88rem;
  font-weight: 680;
}

.zb-button,
.zb-icon-button,
.zb-provider,
.zb-reply,
.zb-reaction,
.zb-segment,
.zb-link-button {
  border: 1px solid var(--zb-line-strong);
  border-radius: 6px;
  background: #ffffff;
  color: var(--zb-text);
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.9rem;
  font-weight: 680;
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease;
}

.zb-button:hover,
.zb-icon-button:hover,
.zb-provider:hover,
.zb-reply:hover,
.zb-reaction:hover,
.zb-segment:hover,
.zb-link-button:hover {
  border-color: var(--zb-accent);
  box-shadow: 0 4px 14px rgba(15, 123, 98, 0.12);
}

.zb-button:active,
.zb-icon-button:active,
.zb-provider:active,
.zb-reply:active,
.zb-reaction:active,
.zb-segment:active {
  transform: translateY(1px);
}

.zb-button-primary {
  border-color: var(--zb-accent);
  background: var(--zb-accent);
  color: #ffffff;
}

.zb-button-primary:hover {
  border-color: var(--zb-accent-dark);
  background: var(--zb-accent-dark);
}

.zb-link-button {
  min-height: 30px;
  border: 0;
  background: transparent;
  color: var(--zb-accent);
  padding: 0 2px;
}

.zb-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  min-width: 36px;
  padding: 0;
  font-weight: 800;
}

.zb-composer {
  position: relative;
  border-bottom: 1px solid var(--zb-line);
  background: #ffffff;
}

.zb-replying {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  border: 1px solid #d8e8e1;
  border-radius: 8px;
  background: #f1faf6;
  padding: 9px 10px;
  color: var(--zb-accent-dark);
  font-size: 0.9rem;
  font-weight: 680;
}

.zb-formatbar {
  align-items: center;
  width: 100%;
  border: 1px solid var(--zb-line);
  border-radius: 8px 8px 0 0;
  background: var(--zb-soft);
  padding: 7px;
}

.zb-format-button {
  background: #ffffff;
}

.zb-editor-head {
  display: flex;
  justify-content: flex-end;
  border-right: 1px solid var(--zb-line);
  border-left: 1px solid var(--zb-line);
  background: #ffffff;
  padding: 8px;
}

.zb-segments {
  display: inline-flex;
  border: 1px solid var(--zb-line);
  border-radius: 8px;
  background: #edf3f0;
  padding: 3px;
}

.zb-segment {
  min-height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--zb-muted);
  padding: 0 12px;
  box-shadow: none;
}

.zb-segment-active {
  background: #ffffff;
  color: var(--zb-text);
  box-shadow: 0 2px 8px rgba(20, 33, 29, 0.08);
}

.zb-editor-shell {
  border: 1px solid var(--zb-line);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: #ffffff;
}

.zb-composer textarea {
  display: block;
  width: 100%;
  min-height: 132px;
  resize: vertical;
  border: 0;
  background: transparent;
  padding: 14px;
  color: var(--zb-text);
  line-height: 1.5;
}

.zb-composer textarea:focus {
  outline: 3px solid rgba(15, 123, 98, 0.14);
  outline-offset: -3px;
}

.zb-preview {
  min-height: 132px;
  padding: 14px;
}

.zb-preview-empty {
  color: var(--zb-muted);
}

.zb-toolbar {
  justify-content: space-between;
  margin-top: 12px;
}

.zb-file {
  display: none;
}

.zb-emoji-panel,
.zb-mentions {
  position: absolute;
  z-index: 20;
  margin-top: 8px;
  border: 1px solid var(--zb-line-strong);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(20, 33, 30, 0.16);
  padding: 8px;
}

.zb-emoji-panel {
  display: grid;
  grid-template-columns: repeat(6, 34px);
  gap: 4px;
}

.zb-emoji-panel button,
.zb-mentions button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.zb-emoji-panel button {
  width: 34px;
  height: 34px;
}

.zb-mentions button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px;
  color: var(--zb-text);
  text-align: left;
}

.zb-emoji-panel button:hover,
.zb-mentions button:hover {
  background: #edf5f2;
}

.zb-list {
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--zb-bg);
}

.zb-comment {
  padding: 18px;
  border-bottom: 1px solid var(--zb-line);
  background: #ffffff;
}

.zb-comment:last-child {
  border-bottom: 0;
}

.zb-comment .zb-list {
  margin: 14px 0 0 34px;
  border-left: 2px solid #dfe9e4;
  background: transparent;
}

.zb-comment .zb-comment {
  padding: 14px 0 0 16px;
  border-bottom: 0;
  background: transparent;
}

.zb-comment-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
}

.zb-avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border: 1px solid var(--zb-line);
  border-radius: 50%;
  background:
    linear-gradient(135deg, rgba(15, 123, 98, 0.18), rgba(185, 106, 18, 0.18)),
    #eef4f1;
  object-fit: cover;
}

.zb-author {
  font-weight: 760;
}

.zb-markdown {
  overflow-wrap: anywhere;
  color: var(--zb-text);
  line-height: 1.62;
}

.zb-markdown p {
  margin: 0 0 10px;
}

.zb-markdown p:last-child {
  margin-bottom: 0;
}

.zb-markdown a {
  color: var(--zb-accent);
  font-weight: 680;
}

.zb-markdown img {
  display: block;
  max-width: min(100%, 720px);
  max-height: 420px;
  margin: 12px 0;
  border: 1px solid var(--zb-line);
  border-radius: 8px;
}

.zb-markdown code {
  border: 1px solid #dbe4e0;
  border-radius: 5px;
  background: #f1f5f3;
  padding: 2px 5px;
  color: #23302d;
  font-size: 0.92em;
}

.zb-mention {
  color: var(--zb-accent-dark);
  font-weight: 760;
}

.zb-reactions {
  margin-top: 12px;
}

.zb-reaction {
  min-height: 30px;
  padding: 0 9px;
  color: var(--zb-muted);
  font-weight: 720;
}

.zb-reaction-active {
  border-color: var(--zb-amber);
  background: #fff6e8;
  color: #7c4308;
}

.zb-login-copy {
  margin: 0;
}

.zb-error {
  border-bottom: 1px solid #f3d0c4;
  background: #fff4ef;
  color: #8a351c;
}

@media (max-width: 640px) {
  .demo-shell {
    width: min(100% - 18px, 980px);
    padding-top: 16px;
  }

  .zb-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .zb-userbar,
  .zb-actions,
  .zb-toolbar {
    width: 100%;
  }

  .zb-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .zb-button-primary {
    width: 100%;
  }

  .zb-comment .zb-list {
    margin-left: 12px;
  }
}
