.fdp-specimen,
.fdp-specimen * {
    box-sizing: border-box;
}

.fdp-specimen {
    --fdp-ui-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --fdp-border: #dedede;
    --fdp-muted: #6b6b6b;
    --fdp-panel: #f7f7f5;
    --fdp-accent: #1a73e8;
    color: #202124;
    margin: 2rem 0;
    border: 1px solid var(--fdp-border);
    border-radius: 18px;
    overflow: hidden;
    background: #fff;
    font-family: var(--fdp-ui-font);
    box-shadow: 0 14px 40px rgba(32, 33, 36, .07);
}

.fdp-specimen button,
.fdp-specimen input,
.fdp-specimen select,
.fdp-specimen textarea {
    font: inherit;
}

.fdp-specimen__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 24px 28px;
    border-bottom: 1px solid var(--fdp-border);
}

.fdp-specimen__title,
.fdp-section h3 {
    margin: 0;
    color: #202124;
    font-family: var(--fdp-ui-font);
    font-weight: 650;
    line-height: 1.2;
}

.fdp-specimen__title { font-size: clamp(26px, 4vw, 42px); }
.fdp-section h3 { font-size: 28px; }

.fdp-eyebrow {
    margin: 0 0 6px;
    color: var(--fdp-muted);
    font: 600 11px/1.2 var(--fdp-ui-font);
    letter-spacing: .1em;
    text-transform: uppercase;
}

.fdp-specimen__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin: 10px 0 0;
    color: var(--fdp-muted);
    font-size: 13px;
}

.fdp-specimen__meta a { color: var(--fdp-accent); }

.fdp-button {
    min-height: 38px;
    padding: 8px 14px;
    border: 1px solid var(--fdp-border);
    border-radius: 999px;
    background: #fff;
    color: #202124;
    cursor: pointer;
    font-weight: 600;
}

.fdp-button:hover { border-color: #8b8b8b; background: #f8f9fa; }
.fdp-button:focus-visible,
.fdp-specimen input:focus-visible,
.fdp-specimen select:focus-visible,
.fdp-specimen textarea:focus-visible,
.fdp-preview__text:focus-visible { outline: 3px solid rgba(26, 115, 232, .24); outline-offset: 2px; }

.fdp-editor {
    padding: 22px 28px 18px;
    background: var(--fdp-panel);
    border-bottom: 1px solid var(--fdp-border);
}

.fdp-editor__input-row,
.fdp-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
}

.fdp-editor__input-row { margin-bottom: 16px; }

.fdp-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 110px;
    color: #4c4c4c;
    font-size: 12px;
    font-weight: 600;
}

.fdp-field--grow { flex: 1 1 380px; }
.fdp-field--tracking { min-width: 170px; }

.fdp-field textarea,
.fdp-field select,
.fdp-field input[type="number"] {
    min-height: 40px;
    border: 1px solid #c8c8c8;
    border-radius: 8px;
    background: #fff;
    color: #202124;
    padding: 8px 10px;
}

.fdp-field textarea {
    width: 100%;
    min-height: 64px;
    resize: vertical;
    font-weight: 400;
}

.fdp-field--color { min-width: 62px; }
.fdp-field input[type="color"] { width: 100%; height: 40px; padding: 3px; border: 1px solid #c8c8c8; border-radius: 8px; background: #fff; }

.fdp-size-control,
.fdp-segmented {
    display: inline-flex;
    min-height: 40px;
    overflow: hidden;
    border: 1px solid #c8c8c8;
    border-radius: 8px;
    background: #fff;
}

.fdp-size-control button,
.fdp-segmented button {
    width: 38px;
    padding: 0;
    border: 0;
    background: #fff;
    color: #333;
    cursor: pointer;
}

.fdp-size-control button:hover,
.fdp-segmented button:hover,
.fdp-segmented button[aria-pressed="true"] { background: #e8f0fe; color: #174ea6; }
.fdp-size-control input { width: 58px; min-height: 38px; border-width: 0 1px !important; border-radius: 0 !important; text-align: center; }
.fdp-segmented button:nth-child(2) { text-align: center; }
.fdp-segmented button:nth-child(3) { text-align: right; padding-right: 8px; }

.fdp-toggle {
    display: flex;
    align-items: center;
    align-self: flex-end;
    min-height: 40px;
    padding: 0 11px;
    border: 1px solid #c8c8c8;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}
.fdp-toggle input { margin-right: 7px; }
.fdp-toggle:has(input:disabled) { opacity: .48; cursor: not-allowed; }

.fdp-range-label {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 14px;
    margin-top: 16px;
    color: var(--fdp-muted);
    font-size: 12px;
    font-weight: 600;
}
.fdp-range-label input { width: 100%; accent-color: var(--fdp-accent); }
.fdp-field--tracking input { accent-color: var(--fdp-accent); }
.fdp-field--tracking output { color: var(--fdp-muted); font-weight: 400; }

.fdp-preview-list { background: var(--fdp-bg); }
.fdp-preview {
    position: relative;
    padding: clamp(28px, 6vw, 72px) clamp(22px, 5vw, 56px);
    border-bottom: 1px solid var(--fdp-border);
    background: var(--fdp-bg);
}
.fdp-preview__text {
    min-height: 1.4em;
    color: var(--fdp-color);
    font-family: var(--fdp-family), sans-serif;
    font-size: var(--fdp-size);
    font-style: var(--fdp-style);
    font-weight: var(--fdp-weight);
    line-height: var(--fdp-line-height);
    letter-spacing: var(--fdp-letter-spacing);
    text-align: var(--fdp-align);
    text-transform: var(--fdp-transform);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.fdp-preview__remove {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: 1px solid var(--fdp-border);
    border-radius: 50%;
    background: rgba(255,255,255,.9);
    color: #555;
    cursor: pointer;
}

.fdp-add-preview { margin: 16px 28px; }

.fdp-section { padding: 32px 28px; border-top: 1px solid var(--fdp-border); }
.fdp-section__heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
.fdp-section__heading > span { color: var(--fdp-muted); font-size: 13px; }

.fdp-style-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--fdp-border); border-radius: 12px; overflow: hidden; }
.fdp-face-card { min-width: 0; padding: 20px; border-bottom: 1px solid var(--fdp-border); font-family: var(--fdp-family), sans-serif; }
.fdp-face-card:nth-child(odd) { border-right: 1px solid var(--fdp-border); }
.fdp-face-card__label { margin: 0 0 12px; color: var(--fdp-muted); font: 500 12px/1.3 var(--fdp-ui-font); }
.fdp-face-card__sample { margin: 0; color: #202124; font-size: 28px; line-height: 1.25; overflow-wrap: anywhere; }

.fdp-type-scale { background: #fbfbfa; }
.fdp-scale-row { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 16px; padding: 22px 0; border-top: 1px solid var(--fdp-border); }
.fdp-scale-row__label { color: var(--fdp-muted); font: 500 12px/1.4 var(--fdp-ui-font); }
.fdp-scale-row p { margin: 0; color: #202124; font-family: var(--fdp-family), sans-serif; font-weight: var(--fdp-weight); line-height: 1.35; overflow-wrap: anywhere; }

.fdp-notice { margin: 1rem 0; padding: 12px 16px; border-left: 4px solid #dba617; background: #fff8e5; color: #4c3b00; }

@media (max-width: 720px) {
    .fdp-specimen { border-radius: 12px; }
    .fdp-specimen__header,
    .fdp-editor,
    .fdp-section { padding-left: 18px; padding-right: 18px; }
    .fdp-toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fdp-field,
    .fdp-field--tracking { min-width: 0; }
    .fdp-style-grid { grid-template-columns: 1fr; }
    .fdp-face-card:nth-child(odd) { border-right: 0; }
    .fdp-scale-row { grid-template-columns: 1fr; }
    .fdp-add-preview { margin-left: 18px; }
}

@media (max-width: 460px) {
    .fdp-specimen__header { flex-direction: column; }
    .fdp-toolbar { grid-template-columns: 1fr; }
    .fdp-editor__input-row { flex-direction: column; align-items: stretch; }
}

@media (prefers-reduced-motion: reduce) {
    .fdp-specimen * { scroll-behavior: auto !important; }
}
