/* The interactive demos (demos.js): on top of style.css's .demo, .demo-box, .demo-grid, .demo-label and .field. */
.demo-mount { min-height: 4rem; }

.hd-input {
  display: block;
  width: 100%;
  margin: 0 0 1rem;
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: 0.5rem;
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--gray-800);
  background: #fff;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  resize: vertical;
}
.hd-input:focus { outline: none; border-color: transparent; box-shadow: 0 0 0 2px var(--blue-600); }
.hd-input:disabled { background: var(--gray-50); color: var(--gray-500); }
.hd-system { height: 15rem; }
.hd-mono { font-family: var(--font-mono); line-height: 1.43; height: 400px; margin-bottom: 0.5rem; }
.hd-readonly { background: var(--gray-50); box-shadow: inset 0 2px 4px 0 rgb(0 0 0 / 0.05); }
.demo-grid-4 .hd-input { margin-bottom: 0; }

.hd-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border: 0;
  border-radius: 0.5rem;
  background: var(--blue-600);
  color: #fff;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  cursor: pointer;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  transition: background-color 0.15s;
}
.hd-button:hover { background: var(--blue-700); }
.hd-button:focus-visible { outline: 2px solid var(--blue-600); outline-offset: 2px; }
.hd-button:disabled { background: #93c5fd; cursor: default; }
.hd-wide { width: 100%; height: 3rem; }
.hd-busy { display: inline-flex; align-items: center; }
.hd-spin { width: 1rem; height: 1rem; margin: 0 0.5rem 0 -0.25rem; animation: hd-spin 1s linear infinite; }
@keyframes hd-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .hd-spin { animation-duration: 3s; } }

.hd-error { margin-top: 0.5rem; font-size: 0.75rem; line-height: 1rem; color: #ef4444; }
.hd-center { text-align: center; }
.hd-gap, .prose .hd-gap { margin-top: 1rem; }
.hd-single { max-width: 48rem; margin: 0 auto; }
.hd-single .hd-input { margin-bottom: 0.75rem; }

.hd-tabs { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0 0 0.5rem; }
.hd-tab {
  padding: 0.125rem 0.5rem;
  border: 0;
  border-radius: 0.25rem;
  background: var(--gray-100);
  color: var(--gray-700);
  font: inherit;
  font-size: 0.75rem;
  line-height: 1rem;
  cursor: pointer;
  transition: background-color 0.15s;
}
.hd-tab:hover { background: var(--gray-200); }
.hd-tab.active { background: var(--blue-600); color: #fff; box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); }

.hd-out { margin-bottom: 0; min-height: 12rem; }
.demo-grid .hd-out { min-height: 25rem; }
.demo-grid.hd-compact .hd-out { min-height: 12rem; }
.hd-pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.hd-placeholder { color: var(--gray-400); font-style: italic; }

.hd-tools { margin: 0 0 1rem; }
.hd-tool { margin: 0 0 0.5rem; padding: 0.75rem; border: 1px solid var(--gray-200); border-radius: 0.5rem; background: var(--gray-50); }
.prose .hd-tool code { font-size: 0.875rem; color: var(--gray-800); background: none; padding: 0; }

.hd-progress { margin-top: 0.5rem; }
.hd-bar { height: 0.625rem; border-radius: 999px; background: var(--gray-200); overflow: hidden; }
.hd-bar-fill { height: 100%; width: 0; border-radius: 999px; background: var(--blue-600); transition: width 0.2s; }
.hd-pct { margin-top: 0.25rem; font-size: 0.875rem; color: var(--gray-600); }

.hd-inbox {
  min-height: 500px;
  border: 1px solid var(--gray-300);
  border-radius: 0.5rem;
  background: var(--gray-50);
  box-shadow: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);
  overflow: hidden;
}
.hd-inbox-archived { min-height: 0; max-height: 300px; overflow-y: auto; background: var(--gray-100); }
.hd-archived-wrap { margin-top: 1rem; }
.hd-row { border-bottom: 1px solid var(--gray-200); }
.hd-row:last-child { border-bottom: 0; }
.hd-row-head {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.375rem 0.75rem;
  border: 0;
  background: none;
  font: inherit;
  text-align: left;
  color: inherit;
  cursor: pointer;
  transition: background-color 0.15s;
}
.hd-row-head:hover { background: #fff; }
.hd-row-main { flex: 1; min-width: 0; }
.hd-row-top { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; margin-bottom: 0.125rem; }
.hd-sender { font-size: 0.875rem; font-weight: 500; color: var(--gray-900); }
.hd-row-archived .hd-sender { color: var(--gray-600); }
.hd-tags { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; }
.hd-subject { display: block; font-size: 0.75rem; line-height: 1rem; color: var(--gray-600); }
.hd-caret { margin-left: 0.5rem; font-size: 0.75rem; color: var(--gray-400); }
.hd-pill { padding: 0.125rem 0.375rem; border-radius: 999px; font-size: 0.75rem; line-height: 1rem; }
.hd-label-pill { box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); }
.hd-faded { opacity: 0.75; }
.hd-archived-pill { background: var(--gray-200); color: var(--gray-600); }
.hd-prio { font-size: 0.75rem; color: var(--gray-500); }
.hd-draft-tag { margin-left: 0.25rem; font-size: 0.75rem; font-weight: 500; color: #ef4444; }
.hd-row-body { padding: 0.5rem 0.75rem; border-top: 1px solid var(--gray-200); background: #fff; font-size: 0.875rem; line-height: 1.25rem; overflow-wrap: anywhere; }
.hd-row-text { margin-top: 0.25rem; padding-top: 0.25rem; border-top: 1px solid var(--gray-200); white-space: pre-line; }
.hd-reply { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px dashed var(--gray-300); }
.hd-reply-tag { display: inline-block; margin-bottom: 0.25rem; padding: 0.125rem 0.5rem; border-radius: 0.125rem; background: #fee2e2; color: #dc2626; font-size: 0.75rem; font-weight: 500; }
.hd-reply-text { padding: 0.5rem; border: 1px solid var(--gray-200); border-radius: 0.375rem; background: var(--gray-50); color: var(--gray-700); white-space: pre-line; }

@media (max-width: 480px) {
  .demo-box { padding: 1rem; }
  .hd-mono { height: 280px; }
  .hd-inbox { min-height: 0; }
}

.demo-grid > *, .demo-grid-4 > * { min-width: 0; }
