.sample-dialog {
  width: min(980px, calc(100% - 32px));
  max-width: none;
  max-height: min(92dvh, 940px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 18px 80px #17362930;
}
.sample-dialog[open] { display: flex; flex-direction: column; }
.sample-dialog::backdrop { background: #152b2445; }
.sample-dialog [hidden] { display: none; }
.sample-head, .sample-toolbar, .sample-footer { flex: none; padding-inline: 24px; }
.sample-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding-block: 20px 14px; }
.sample-head h2 { font-size: 22px; line-height: 1.25; letter-spacing: -.025em; }
.sample-head h2:focus { outline: none; }
.sample-head p, .sample-hint, .sample-footer p, .sample-result p, .sample-profiles p, .sample-empty p {
  color: #506158; font-size: 13px; line-height: 1.45;
}
.sample-head p { margin-top: 4px; }
.sample-close { width: 36px; height: 36px; border-radius: 6px; flex: none; display: grid; place-items: center; }
.sample-close:hover, .sample-tabs button:hover { background: var(--pale); }
.sample-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.sample-tabs { display: flex; gap: 18px; }
.sample-tabs button { padding: 11px 0 10px; border-bottom: 2px solid transparent; color: #52655a; font-size: 13px; white-space: nowrap; }
.sample-tabs button[aria-pressed=true] { border-bottom-color: var(--green); color: var(--green); font-weight: 650; }
.sample-tabs span { font-variant-numeric: tabular-nums; margin-left: 3px; }
.sample-history { max-width: 260px; min-width: 0; padding: 5px 4px; border: 0; background: transparent; color: #506158; font-size: 12px; }
.sample-body { display: flex; flex-direction: column; min-height: 0; }
.sample-scroll { overflow: auto; overscroll-behavior: contain; padding: 22px 24px; }
.sample-cols { display: grid; grid-template-columns: minmax(0,1.08fr) minmax(0,1fr); gap: 28px; align-items: start; }
.sample-main, .sample-side, .sample-settings, .sample-series, .sample-result { display: grid; min-width: 0; align-content: start; gap: 12px; }
.sample-main, .sample-side { gap: 18px; }
.sample-dialog h3 { font-size: 16px; line-height: 1.3; font-weight: 650; }
.sample-dialog h4 { font-size: 13px; line-height: 1.4; font-weight: 630; }
.sample-operations { border: 0; margin: 0; padding: 0; min-width: 0; }
.sample-operations legend, .sample-field > span { padding: 0; color: #506158; font-size: 12px; line-height: 1.35; }
.sample-operations legend { margin-bottom: 5px; }
.sample-modes, .sample-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px 12px; }
.sample-modes { gap: 5px; }
.sample-modes button, .sample-main > button, .sample-empty button, .sample-profiles button, .sample-footer button {
  display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 36px;
  border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; font-size: 13px; font-weight: 550;
}
.sample-modes button { justify-content: flex-start; }
.sample-modes button:hover, .sample-main > button:hover, .sample-profiles button:hover, .sample-empty button:hover, .sample-footer button:not(.primary):hover { background: var(--pale); }
.sample-modes button[aria-pressed=true] { color: var(--green); background: var(--green2); border-color: var(--green); }
.sample-fields { align-items: end; }
.sample-field { display: grid; min-width: 0; gap: 5px; }
.sample-field input, .sample-field select {
  min-width: 0; width: 100%; height: 38px; border: 1px solid #cbd4cc; border-radius: 6px; padding: 6px 9px; background: white; color: var(--ink); font-size: 13px;
}
.sample-series { padding-top: 16px; border-top: 1px solid var(--line); }
.sample-preview-panel { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 8px; }
.sample-preview-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.sample-preview-head span { font-size: 12px; color: #516158; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sample-sheet {
  display: grid; align-items: center; margin: 12px 0 8px; padding: 12px; min-height: 96px;
  background-color: #f9faf2;
  background-image: linear-gradient(90deg,#dce2d5 1px,transparent 1px),linear-gradient(#dce2d5 1px,transparent 1px);
  background-size: 12px 12px; border: 1px solid #d9dfd3; border-radius: 4px;
}
.sample-sheet svg { width: 100%; height: auto; max-height: 132px; display: block; color: #304e42; }
.sample-values h4 { margin: 16px 0 5px; }
.sample-values > div, .sample-values > button { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 32px; padding: 5px 0; border-top: 1px solid var(--line); font-size: 13px; }
.sample-values strong { font-variant-numeric: tabular-nums; font-weight: 620; }
.sample-values > button { width: 100%; justify-content: flex-start; padding: 7px 6px; min-height: 36px; }
.sample-values > button strong { margin-left: auto; }
.sample-values > button::before { content: ''; flex: none; width: 12px; height: 12px; border-radius: 50%; border: 1px solid #798a7d; background: white; }
.sample-values > button:hover { background: var(--pale); }
.sample-values > button[aria-pressed=true] { color: var(--green); background: var(--green2); }
.sample-values > button[aria-pressed=true]::before { border: 4px solid var(--green); }
.sample-dialog summary { padding: 7px 0; color: var(--green); font-size: 13px; cursor: pointer; }
.sample-dialog details[open] summary { font-weight: 600; }
.sample-dialog details > .sample-field { margin: 5px 0 10px; }
.sample-help { border-top: 1px solid var(--line); }
.sample-help details { border-bottom: 1px solid var(--line); }
.sample-help summary { padding-block: 10px; }
.sample-dialog details p, .sample-help li, .sample-help a, .sample-recipe { font-size: 13px; line-height: 1.5; }
.sample-help p, .sample-help ul, .sample-help a { margin: 0 0 10px; }
.sample-help ul { padding-left: 19px; }
.sample-help li + li { margin-top: 6px; }
.sample-help a { display: inline-block; }
.sample-recipe { margin: 0; }
.sample-recipe div { display: grid; grid-template-columns: minmax(72px,.65fr) minmax(0,1fr); gap: 9px; padding: 4px 0; }
.sample-recipe dt { color: var(--muted); }
.sample-recipe dd { margin: 0; overflow-wrap: anywhere; }
.sample-main > button { justify-self: start; }
.sample-result .sample-choice { color: var(--green); font-weight: 650; }
.sample-result p, .sample-profiles h3 { overflow-wrap: anywhere; }
.sample-footer { display: flex; justify-content: flex-end; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding-block: 12px; }
.sample-footer p { margin-right: auto; font-size: 12px; }
.sample-footer .sample-error { color: #913b28; }
.sample-footer [data-act=preview] { display: none; }
.sample-status { margin-bottom: 14px; color: var(--green); }
.sample-empty { padding: 28px 0; display: grid; justify-items: center; gap: 10px; text-align: center; }
.sample-profiles article { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 12px; align-items: start; padding: 13px 0; }
.sample-profiles article + article { border-top: 1px solid var(--line); }
.sample-profiles article > svg { margin-top: 1px; color: var(--green); }
.sample-profiles p { margin-top: 4px; overflow-wrap: anywhere; }
@media (max-width: 800px) {
  .sample-cols { gap: 18px; grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .sample-head, .sample-toolbar, .sample-scroll, .sample-footer { padding-inline: 16px; }
  .sample-settings > .sample-fields { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 640px) {
  .sample-dialog { width: calc(100% - 12px); max-height: 96dvh; border-radius: 10px; }
  .sample-head { padding-block: 14px 8px; }
  .sample-head h2 { font-size: 20px; }
  .sample-toolbar { flex-wrap: wrap; gap: 0 12px; }
  .sample-history { max-width: 100%; flex: 1 1 140px; }
  .sample-scroll { padding-block: 14px; }
  .sample-cols { grid-template-columns: minmax(0,1fr); gap: 18px; }
  .sample-preview-panel { padding: 12px; }
  .sample-modes button, .sample-field input, .sample-field select, .sample-footer button, .sample-values > button { min-height: 40px; }
  .sample-footer { flex-wrap: wrap; padding-block: 9px; }
  .sample-footer p { flex-basis: 100%; text-align: center; }
  .sample-footer button { flex: 1 1 auto; }
  .sample-footer [data-act=preview] { display: inline-flex; }
  .sample-profiles article { grid-template-columns: auto minmax(0,1fr); }
  .sample-profiles button { grid-column: 2; justify-self: start; }
}
