.footnote-create-panel,
.footnote-active-card,
.footnote-collection-panel { padding: 12px 14px; border: 1px solid #dbe2ec; border-radius: 8px; background: #fff; }
.footnote-create-panel { border-color: #ef9dc7; background: #fff8fc; }
.footnote-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.footnote-section-heading > div { min-width: 0; flex: 1; }
.footnote-section-heading h3, .footnote-section-heading p { margin: 0; }
.footnote-section-heading h3 { color: #202635; font-size: 13px; font-weight: 700; line-height: 1.3; }
.footnote-section-heading p { margin-top: 3px; color: #7c8798; font-size: 9px; line-height: 1.45; }
.footnote-section-heading > span, .footnote-section-heading div > span { color: #75839a; font-size: 9px; font-weight: 700; }

.footnote-relation-visual { display: grid; grid-template-columns: auto minmax(28px, 1fr) auto; align-items: center; gap: 8px; margin-bottom: 10px; padding: 9px 10px; border: 1px solid #e1e7ef; border-radius: 6px; background: #fff; }
.footnote-relation-visual span { color: #31455e; font-size: 9px; font-weight: 650; white-space: nowrap; }
.footnote-relation-visual sup { color: #ec168c; font-size: 8px; }
.footnote-relation-visual i { position: relative; border-top: 1px dashed #90a4ba; }
.footnote-relation-visual i::after { position: absolute; top: -3px; right: -1px; width: 5px; height: 5px; border-top: 1px solid #90a4ba; border-right: 1px solid #90a4ba; content: ""; transform: rotate(45deg); }
.footnote-create-panel .demo-field-label { margin-top: 0; color: #66758b; font-size: 9px; }
.footnote-create-panel textarea.demo-text-input { min-height: 64px; resize: vertical; }
.footnote-create-panel .demo-text-input { margin-top: 4px; padding: 7px 9px; font-size: 10px; }
.footnote-input-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(86px, .6fr); gap: 8px; margin-top: 9px; }
.footnote-create-panel > .btn { margin-top: 11px; }

.footnote-active-card { min-height: 92px; overflow: hidden; }
.footnote-active-card:not(.is-empty) { border-color: #f06aaa; box-shadow: 0 10px 30px rgba(26, 40, 61, .08); }
.footnote-active-empty { display: flex; align-items: center; gap: 10px; min-height: 62px; }
.footnote-active-empty div { display: grid; gap: 2px; }
.footnote-active-empty strong { color: #202635; font-size: 11px; }
.footnote-active-empty small { color: #77859a; font-size: 9px; line-height: 1.4; }
.footnote-reference-icon { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: 50%; background: #eaf1f8; color: #51779f; font-size: 10px; font-weight: 800; vertical-align: super; }
.footnote-section-heading--active { align-items: center; }
.footnote-section-heading--active h3 { margin-top: 2px; overflow-wrap: anywhere; font-size: 15px; }
.footnote-number-badge { display: grid; width: 28px; height: 28px; flex: 0 0 28px; place-items: center; border-radius: 50%; background: var(--footnote-highlight, #fff2a8); color: #253a51 !important; font-size: 10px !important; }

.footnote-link-visual { display: grid; grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr); align-items: center; gap: 7px; margin-bottom: 10px; padding: 9px; border-radius: 6px; background: #f7f9fc; box-shadow: inset 0 0 0 1px #e1e7ef; }
.footnote-link-visual div { display: grid; min-width: 0; gap: 2px; }
.footnote-link-visual div:last-child { text-align: right; }
.footnote-link-visual span { color: #7b889a; font-size: 7px; }
.footnote-link-visual strong { overflow: hidden; color: #263a51; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.footnote-link-visual i { position: relative; border-top: 1px dashed #8da2ba; }
.footnote-link-visual i::before, .footnote-link-visual i::after { position: absolute; top: -3px; width: 5px; height: 5px; border-top: 1px solid #8da2ba; content: ""; }
.footnote-link-visual i::before { left: 0; border-left: 1px solid #8da2ba; transform: rotate(-45deg); }
.footnote-link-visual i::after { right: 0; border-right: 1px solid #8da2ba; transform: rotate(45deg); }
.footnote-property-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid #e0e6ef; border-radius: 6px; background: #e0e6ef; }
.footnote-property-grid div { display: grid; min-width: 0; gap: 2px; padding: 8px 10px; background: #f9fbfd; }
.footnote-property-grid span { color: #78869a; font-size: 9px; }
.footnote-property-grid strong { overflow: hidden; font-size: 10px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.footnote-active-actions { display: grid; grid-template-columns: repeat(2, minmax(0, max-content)); gap: 7px; margin-top: 11px; padding-top: 11px; border-top: 1px solid #e4e9f0; }

.footnote-numbering-controls { display: grid; grid-template-columns: minmax(80px, .55fr) minmax(120px, 1fr); align-items: end; gap: 8px; margin-bottom: 11px; padding: 9px; border: 1px solid #e1e7ef; border-radius: 6px; background: #f8fafc; }
.footnote-numbering-controls .demo-field-label { margin: 0; color: #66758b; font-size: 9px; }
.footnote-numbering-controls .demo-text-input { margin-top: 4px; padding: 7px 9px; font-size: 10px; }
.footnote-numbering-controls .btn { grid-column: 1 / -1; justify-self: start; margin: 0; white-space: nowrap; }
.footnote-collection-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 7px; }
.footnote-collection-list > p { margin: 0; color: #7b889b; font-size: 9px; }
.footnote-collection-item { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: center; gap: 8px; min-width: 0; padding: 7px 9px; border: 1px solid #e1e7ef; border-radius: 6px; background: #f9fbfd; color: #18263a; text-align: left; }
.footnote-collection-item:hover, .footnote-collection-item:focus-visible, .footnote-collection-item.is-active { border-color: #ec168c; background: #fff4fa; outline: 0; }
.footnote-collection-item__number { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; background: #eaf1f8; color: #426b94; font-size: 9px; font-weight: 800; }
.footnote-collection-item > span:last-child { display: grid; min-width: 0; gap: 2px; }
.footnote-collection-item strong, .footnote-collection-item small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.footnote-collection-item strong { font-size: 10px; }
.footnote-collection-item small { color: #77859a; font-size: 8px; }

@media (max-width: 620px) {
    .footnote-input-grid, .footnote-property-grid, .footnote-numbering-controls { grid-template-columns: 1fr; }
    .footnote-link-visual { grid-template-columns: 1fr; }
    .footnote-link-visual i { display: none; }
    .footnote-link-visual div:last-child { text-align: left; }
}

@media (min-width: 992px) {
    .demo-info-panel.is-code-expanded .footnote-numbering-controls { grid-template-columns: minmax(80px, .55fr) minmax(120px, 1fr) auto; }
    .demo-info-panel.is-code-expanded .footnote-numbering-controls .btn { grid-column: auto; justify-self: stretch; }
}
