/* Shared building blocks for Overview / Patterns / Icons / Templates (prefix dp-). */
.dp { padding: 0 20px 40px; --dp-line: var(--color-border-primary-subtle); --dp-muted: var(--color-content-secondary); }
.dp-toolbar { position: sticky; top: 0; z-index: 20; height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); }
.dp-search { width: min(342px, 100%); height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--color-border-primary); border-radius: 8px; color: var(--dp-muted); background: #fff; transition: border-color 150ms, box-shadow 150ms; }
.dp-search:hover { border-color: #c7d7fb; box-shadow: 0 0 0 3px rgba(37,99,235,.06); }
.dp-search svg { width: 14px; height: 14px; flex: none; }
.dp-search input { border: 0; outline: 0; flex: 1; min-width: 0; font: 400 12px var(--font-family); color: var(--color-content-primary); background: none; }
.dp-toolbar__right { display: flex; align-items: center; gap: 14px; }
.dp-toolbar__right > svg { width: 18px; height: 18px; color: var(--dp-muted); border-radius: 50%; }
.dp-toolbar__right > svg:hover { color: var(--color-content-primary); }
.dp-exit { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 16px; border: 0; border-radius: 17px; background: #f04438; color: #fff; font: 400 13px var(--font-family); cursor: pointer; }
.dp-exit:hover { background: #d92d20; }
.dp-exit svg { width: 12px; height: 12px; }

.dp-grid { display: grid; grid-template-columns: minmax(0, 1fr) 232px; gap: 24px; align-items: start; }
.dp-main { display: flex; flex-direction: column; gap: 32px; min-width: 0; }
.dp-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 70px; }

/* hero */
.dp-hero { position: relative; overflow: hidden; border-radius: 12px; padding: 40px 36px; min-height: 220px; display: flex; align-items: center; background: linear-gradient(135deg, #f6f1ff 0%, #eef0ff 55%, #e8f2ff 100%); }
.dp-hero__text { position: relative; z-index: 1; max-width: 420px; }
.dp-kicker { font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .08em; color: var(--dp-muted); }
.dp-hero h1 { font-size: 26px; line-height: 34px; font-weight: 600; margin: 6px 0 8px; letter-spacing: -.01em; }
.dp-hero p { font-size: 13px; line-height: 20px; color: var(--dp-muted); }
.dp-hero__cta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.dp-hero__art { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); width: 280px; height: 187px; opacity: .95; pointer-events: none; }

/* buttons */
.dp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--color-border-primary); background: #fff; color: var(--color-content-primary); font: 500 13px var(--font-family); cursor: pointer; white-space: nowrap; }
.dp-btn:hover { border-color: #c7d7fb; background: #f8faff; color: var(--color-content-brand); }
.dp-btn--primary { background: var(--color-brand-primary); border-color: var(--color-brand-primary); color: #fff; }
.dp-btn--primary:hover { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.dp-btn--sm { height: 30px; padding: 0 12px; font-size: 12px; }
.dp-btn svg { width: 14px; height: 14px; flex: none; }
.dp-btn:active { transform: scale(.98); }

/* stats */
.dp-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: -8px; }
.dp-stat { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--dp-line); border-radius: 12px; background: #fff; box-shadow: var(--shadow-xs); color: inherit; }
.dp-badge { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.dp-badge svg { width: 22px; height: 22px; }
.dp-badge--purple { background: #f3ebff; color: #a855f7; } .dp-badge--blue { background: #e6f4ff; color: #3c82f6; } .dp-badge--pink { background: #ffecf3; color: #ec4899; } .dp-badge--green { background: #e6f9ee; color: #039855; }
.dp-badge--orange { background: #fff3e0; color: #f59e0b; } .dp-badge--indigo { background: #e8eaff; color: #4f46e5; } .dp-badge--red { background: #ffe9e7; color: #f04438; } .dp-badge--teal { background: #def7f3; color: #0d9488; } .dp-badge--lime { background: #effbdb; color: #65a30d; }
.dp-stat__v { font-size: 22px; line-height: 28px; font-weight: 500; font-variant-numeric: tabular-nums; }
.dp-stat__l { font-size: 12px; color: var(--dp-muted); }

/* sections */
.dp-sec { display: flex; flex-direction: column; gap: 14px; scroll-margin-top: 72px; }
.dp-sec__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dp-sec__title { font-size: 16px; line-height: 22px; font-weight: 600; }
.dp-sec__desc { font-size: 12px; line-height: 18px; color: var(--dp-muted); margin-top: 2px; }
.dp-link { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--color-content-brand); background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit; }
.dp-link svg { width: 14px; height: 14px; transition: transform 150ms; }
.dp-link:hover svg { transform: translateX(3px); }

/* cards */
.dp-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 12px; }
.dp-card { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px solid var(--dp-line); border-radius: 12px; background: #fff; box-shadow: var(--shadow-xs); color: inherit; text-align: left; font: inherit; cursor: pointer; position: relative; }
.dp-card h3 { font-size: 14px; line-height: 20px; font-weight: 600; }
.dp-card p { font-size: 12px; line-height: 18px; color: var(--dp-muted); }
.dp-card__ico { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; margin-bottom: 8px; }
.dp-card__ico svg { width: 18px; height: 18px; }
.dp-card__foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 10px; font-size: 12px; font-weight: 500; }
.dp-card__foot svg { width: 14px; height: 14px; color: var(--color-content-brand); transition: transform 150ms; }
.dp-card:hover .dp-card__foot svg { transform: translateX(3px); }
.dp-card.is-active { border-color: var(--color-brand-primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); background: #fbfcff; }
.dp-card[hidden] { display: none; }

/* chips / tags / segmented / select */
.dp-tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: #eff4ff; color: #2e5bd1; font-size: 11px; line-height: 16px; white-space: nowrap; }
.dp-tag--gray { background: #f2f4f7; color: #475467; }
.dp-tag--green { background: #e6f9ee; color: #067647; } .dp-tag--amber { background: #fff6e0; color: #b54708; }
.dp-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.dp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dp-chip { height: 30px; padding: 0 12px; border-radius: 15px; border: 1px solid var(--color-border-primary); background: #fff; color: var(--dp-muted); font: 400 12px var(--font-family); cursor: pointer; }
.dp-chip:hover { border-color: #c7d7fb; color: var(--color-content-brand); }
.dp-chip[aria-pressed="true"], .dp-chip.is-on { background: var(--color-brand-primary); border-color: var(--color-brand-primary); color: #fff; }
.dp-seg { display: inline-flex; padding: 3px; border-radius: 9px; background: #f2f4f7; gap: 2px; }
.dp-seg button { height: 28px; padding: 0 12px; border: 0; border-radius: 7px; background: none; font: 500 12px var(--font-family); color: var(--dp-muted); cursor: pointer; }
.dp-seg button:hover { color: var(--color-content-primary); }
.dp-seg button[aria-pressed="true"], .dp-seg button[aria-selected="true"] { background: #fff; color: var(--color-content-brand); box-shadow: 0 1px 3px rgba(16,24,40,.12); }
.dp-field { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border: 1px solid var(--color-border-primary); border-radius: 8px; background: #fff; color: var(--dp-muted); transition: border-color 150ms, box-shadow 150ms; }
.dp-field:focus-within { border-color: var(--color-brand-primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.dp-field svg { width: 14px; height: 14px; flex: none; }
.dp-field input, .dp-field select { border: 0; outline: 0; background: none; font: 400 13px var(--font-family); color: var(--color-content-primary); min-width: 0; flex: 1; }
.dp-field select { cursor: pointer; }
.dp-toolrow { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.dp-toolrow .dp-field { flex: 1 1 200px; max-width: 360px; }

/* tabs */
.dp-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--color-border-primary); overflow-x: auto; scrollbar-width: none; }
.dp-tabs::-webkit-scrollbar { display: none; }
.dp-tab { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border: 0; background: none; color: var(--dp-muted); font: 400 13px var(--font-family); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.dp-tab svg { width: 14px; height: 14px; }
.dp-tab:hover { color: var(--color-content-primary); }
.dp-tab[aria-selected="true"] { color: var(--color-content-brand); border-bottom-color: var(--color-brand-primary); font-weight: 500; }
.dp-panel[hidden] { display: none; }
.dp-panel { animation: d-in 220ms var(--docs-ease) both; }

/* panels / side boxes */
.dp-box { padding: 16px; border: 1px solid var(--dp-line); border-radius: 12px; background: #fff; box-shadow: var(--shadow-xs); }
.dp-box h3 { font-size: 14px; line-height: 20px; font-weight: 600; }
.dp-box__sub { font-size: 12px; line-height: 18px; color: var(--dp-muted); margin-top: 2px; }
.dp-checks { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--dp-line); }
.dp-checks li { display: flex; gap: 8px; font-size: 12px; line-height: 17px; }
.dp-checks svg { width: 14px; height: 14px; flex: none; margin-top: 2px; }
.dp-links { display: flex; flex-direction: column; margin-top: 8px; }
.dp-links a { display: flex; align-items: center; gap: 10px; padding: 9px 8px; margin: 0 -8px; border-radius: 8px; font-size: 12px; }
.dp-links a:hover { background: #f5f8ff; color: var(--color-content-brand); }
.dp-links a svg:first-child { width: 16px; height: 16px; color: var(--dp-muted); flex: none; }
.dp-links a small { display: block; color: var(--dp-muted); font-size: 11px; line-height: 15px; }
.dp-links a > svg:last-child { width: 13px; height: 13px; margin-left: auto; color: var(--color-content-brand); flex: none; }
.dp-help .dp-btn { width: 100%; margin-top: 12px; color: var(--color-content-brand); border-color: var(--color-brand-primary); }
.dp-help .dp-btn:hover { background: var(--color-brand-primary-subtle); }
.dp-steps { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; counter-reset: s; }
.dp-steps li { display: grid; grid-template-columns: 24px 1fr; gap: 10px; font-size: 12px; line-height: 17px; color: var(--dp-muted); }
.dp-steps li::before { counter-increment: s; content: counter(s); width: 24px; height: 24px; border-radius: 50%; background: var(--color-brand-primary-subtle); color: var(--color-content-brand); display: grid; place-items: center; font-weight: 600; font-size: 12px; }
.dp-steps b { display: block; color: var(--color-content-primary); font-weight: 600; font-size: 13px; }

/* empty state */
.dp-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 40px 16px; border: 1px dashed var(--color-border-primary); border-radius: 12px; color: var(--dp-muted); font-size: 12px; }
.dp-empty[hidden] { display: none; }
.dp-empty svg { width: 28px; height: 28px; color: #98a2b3; }
.dp-empty b { font-size: 14px; color: var(--color-content-primary); font-weight: 600; }

/* code */
.dp-code { position: relative; border-radius: 10px; background: #0f172a; color: #e2e8f0; }
.dp-code pre { margin: 0; padding: 14px 16px; overflow: auto; max-height: 300px; font: 12px/18px ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre; }
.dp-code .dp-btn { position: absolute; top: 8px; right: 8px; background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.18); color: #fff; height: 28px; font-size: 11px; }
.dp-code .dp-btn:hover { background: rgba(255,255,255,.2); color: #fff; }

/* dialog + drawer */
.dp-ov { position: fixed; inset: 0; z-index: 140; background: rgba(16,24,40,.42); display: flex; align-items: center; justify-content: center; padding: 16px; animation: d-fade 160ms ease both; }
.dp-ov--drawer { justify-content: flex-end; padding: 0; }
.dp-dialog { width: min(920px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: #fff; border-radius: 16px; box-shadow: 0 24px 64px rgba(16,24,40,.3); display: flex; flex-direction: column; animation: d-in 240ms var(--docs-ease) both; }
.dp-ov--drawer .dp-dialog { width: min(520px, 100%); max-height: none; height: 100%; border-radius: 16px 0 0 16px; animation: dp-slide 260ms var(--docs-ease) both; }
@keyframes dp-slide { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.dp-dialog__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; }
.dp-dialog__head h2 { font-size: 18px; line-height: 24px; font-weight: 600; }
.dp-dialog__head p { font-size: 12px; color: var(--dp-muted); margin-top: 2px; }
.dp-x { width: 32px; height: 32px; border-radius: 8px; border: 0; background: none; color: var(--dp-muted); cursor: pointer; display: grid; place-items: center; flex: none; }
.dp-x:hover { background: #f2f4f7; color: var(--color-content-primary); }
.dp-x svg { width: 16px; height: 16px; }
.dp-dialog__body { padding: 0 20px 20px; display: flex; flex-direction: column; gap: 16px; }
.dp-dialog__foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--dp-line); margin-top: auto; }

@media (max-width: 1100px) {
  .dp-grid { grid-template-columns: minmax(0, 1fr); }
  .dp-side { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); align-items: start; }
  .dp-hero__art { opacity: .5; right: 0; }
}
@media (max-width: 900px) {
  .dp-toolbar { position: static; padding-left: 48px; }
  .dp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .dp { padding: 0 16px 32px; }
  .dp-toolbar { padding-left: 48px; }
  .dp-hero { padding: 28px 20px; }
  .dp-hero h1 { font-size: 22px; line-height: 29px; }
  .dp-hero__art { display: none; }
  .dp-stats { gap: 8px; } .dp-stat { padding: 10px; gap: 10px; } .dp-badge { width: 38px; height: 38px; }
  .dp-cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .dp-ov--drawer .dp-dialog { border-radius: 0; }
  .dp-search { flex: 1; }
}

.dp ol { margin: 0; padding: 0; list-style: none; }
.dp-dialog ol { margin: 0; padding: 0; list-style: none; }
.dp dl, .dp dd, .dp blockquote { margin: 0; }
