/* Compact utility refinements layered after styles.css. */
.tool-intro { padding-bottom: 24px; }
.tool-intro h1 {
  max-width: none;
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: -0.025em;
  font-weight: 750;
}
.tool-intro p {
  margin-top: 6px;
  max-width: 620px;
  color: var(--app-muted);
  font-size: 14px;
  line-height: 1.5;
}
.group-heading p { font-size: 14px; line-height: 1.5; }
.decision-card legend { padding-bottom: 12px; }
.decision-heading > span, .choice-copy > span { display: none; }
.choice-card {
  min-height: 68px;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  padding: 11px 12px;
}
.choice-copy strong { font-size: 14px; line-height: 1.2; }
.choice-grid.choice-count-5 .choice-card { min-height: 68px; }
.accent-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.accent-choice { min-height: 62px; font: inherit; color: inherit; }
.accent-custom { appearance: none; }
.accent-custom:focus-visible { outline: 3px solid rgba(81,70,229,.16); outline-offset: 2px; }
.accent-custom .accent-dot { box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.demo-links a { cursor: default; }

/* The component sampler intentionally omits radio controls. */
label.demo-check:has(input[name="sample-radio"]) { display: none; }

/* Keep the Filled document sample recognizable instead of a solid block. */
.icon-sampler .demo-card-icon:nth-child(2) { position: relative; }
.preview-frame[data-icon="filled"] .icon-sampler .demo-card-icon:nth-child(2)::before,
.preview-frame[data-icon="filled"] .icon-sampler .demo-card-icon:nth-child(2)::after {
  content: "";
  position: absolute;
  z-index: 2;
  left: 15px;
  height: 2px;
  border-radius: 999px;
  background: var(--pv-accent-soft);
  pointer-events: none;
}
.preview-frame[data-icon="filled"] .icon-sampler .demo-card-icon:nth-child(2)::before { top: 16px; width: 10px; }
.preview-frame[data-icon="filled"] .icon-sampler .demo-card-icon:nth-child(2)::after { top: 21px; width: 7px; }

/* Northstar's identity stays stable while the surrounding UI changes. */
.demo-logo { border-radius: 7px !important; }

/* Hover styles must visibly affect both primary and secondary controls. */
.preview-frame[data-hover="tint"] .demo-button-primary:hover:not(:disabled) {
  background: color-mix(in srgb, var(--pv-accent) 82%, var(--pv-surface) 18%);
}
.preview-frame[data-hover="tint"] :is(.demo-button-secondary, .demo-button-quiet, .demo-icon-button):hover:not(:disabled) {
  background: var(--pv-accent-soft);
  border-color: color-mix(in srgb, var(--pv-accent) 45%, var(--pv-border) 55%);
}
.preview-frame[data-hover="darken"] .demo-button-primary:hover:not(:disabled) {
  background: var(--pv-accent-hover);
}
.preview-frame[data-hover="darken"] :is(.demo-button-secondary, .demo-button-quiet, .demo-icon-button):hover:not(:disabled) {
  background: color-mix(in srgb, var(--pv-surface) 86%, var(--pv-text) 14%);
  border-color: color-mix(in srgb, var(--pv-border) 72%, var(--pv-text) 28%);
}
.preview-frame[data-hover="border"] .demo-button-primary:hover:not(:disabled) {
  border-color: color-mix(in srgb, currentColor 72%, var(--pv-accent) 28%);
}

/* Keep the text behavior sample narrow enough for wrap modes to be distinguishable. */
.text-stress h3 {
  width: min(100%, 27ch);
  max-width: 27ch;
}
.preview-frame[data-text="wrap"] .text-stress h3 { text-wrap: wrap; }
.preview-frame[data-text="pretty"] .text-stress h3 { text-wrap: pretty; }
.preview-frame[data-text="balance"] .text-stress h3 { text-wrap: balance; }
.text-pretty-fallback { text-wrap: wrap !important; }

/* Word-inspired custom color picker, adapted to StyleSpec chrome. */
.color-dialog {
  width: min(560px, calc(100vw - 28px));
  max-height: min(760px, calc(100dvh - 28px));
  margin: auto;
  padding: 0;
  border: 1px solid var(--app-border);
  border-radius: 18px;
  background: var(--app-surface);
  color: var(--app-text);
  box-shadow: 0 28px 80px rgba(0,0,0,.24);
}
.color-dialog::backdrop { background: rgba(22,22,20,.36); backdrop-filter: blur(2px); }
.color-dialog-card { padding: 20px; }
.color-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.color-dialog-header strong { display: block; font-size: 18px; letter-spacing: -.02em; }
.color-dialog-header span { display: block; margin-top: 4px; color: var(--app-muted); font-size: 12px; }
.color-dialog-close {
  width: 32px; height: 32px; border: 0; border-radius: 9px; background: var(--app-surface-soft);
  cursor: pointer; font-size: 20px; line-height: 1;
}
.color-picker-section { margin-top: 20px; }
.color-picker-section h3 { margin: 0 0 9px; font-size: 12px; font-weight: 700; color: #474741; }
.color-theme-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(22px, 1fr));
  gap: 5px;
}
.color-theme-column { display: grid; gap: 4px; }
.color-standard-grid { display: grid; grid-template-columns: repeat(11, minmax(22px, 1fr)); gap: 5px; }
.color-swatch {
  aspect-ratio: 1;
  min-width: 0;
  padding: 0;
  border: 1px solid rgba(0,0,0,.11);
  border-radius: 5px;
  background: var(--picker-color);
  cursor: pointer;
}
.color-swatch:hover { outline: 2px solid rgba(81,70,229,.24); outline-offset: 1px; }
.color-swatch.is-current { outline: 2px solid var(--app-accent); outline-offset: 1px; }
.more-colors-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.more-colors-row h3 { margin-bottom: 3px; }
.more-colors-row span { color: var(--app-muted); font-size: 11px; }
#custom-native-color {
  width: 48px; height: 38px; padding: 3px; border: 1px solid var(--app-border); border-radius: 9px;
  background: #fff; cursor: pointer;
}
.custom-color-value {
  display: grid;
  grid-template-columns: 34px auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  margin-top: 16px;
  padding: 11px;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: #fafaf8;
}
.custom-color-preview { width: 34px; height: 34px; border-radius: 9px; border: 1px solid rgba(0,0,0,.1); }
.custom-color-value label { color: var(--app-muted); font-size: 11px; font-weight: 700; }
#custom-color-hex {
  min-width: 0; height: 34px; padding: 0 9px; border: 1px solid var(--app-border); border-radius: 8px;
  background: #fff; color: var(--app-text); font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
#custom-color-hex.is-invalid { border-color: #dc2626; outline: 2px solid rgba(220,38,38,.1); }
.color-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.dialog-secondary, .dialog-primary {
  min-height: 38px; padding: 0 14px; border-radius: 9px; font-weight: 650; cursor: pointer;
}
.dialog-secondary { border: 1px solid var(--app-border); background: #fff; }
.dialog-primary { border: 1px solid var(--app-accent); background: var(--app-accent); color: #fff; }

@media (max-width: 900px) {
  .tool-intro h1 { font-size: 21px; line-height: 1.25; letter-spacing: -0.025em; }
  .tool-intro p { margin-top: 6px; font-size: 14px; }
}

@media (max-width: 620px) {
  .tool-intro h1 { font-size: 21px; }
  .choice-card { min-height: 72px; padding: 10px; }
  .choice-grid.choice-count-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .choice-grid.choice-count-3 .choice-card {
    grid-template-columns: 1fr;
    justify-items: center;
    align-content: center;
    gap: 7px;
    min-height: 82px;
    text-align: center;
  }
  .choice-grid.choice-count-3 .choice-copy strong { font-size: 12px; }
  .choice-grid.choice-count-4 .choice-card { min-height: 72px; }
  .accent-choice { min-height: 58px; }
  .color-dialog-card { padding: 16px; }
  .color-theme-grid { grid-template-columns: repeat(6, minmax(24px, 1fr)); row-gap: 9px; }
  .color-standard-grid { grid-template-columns: repeat(6, minmax(24px, 1fr)); }
}

@media (max-width: 390px) {
  .choice-grid.choice-count-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
