/* Design (دیزاین) — a clone of the Hambord panel, 1440px wide in its own pixels and scaled to fill the studio page. prefix dsn- */
.dsn-stage { width: 100%; }
.dsn-fit { position: relative; overflow: hidden; border: 1px solid var(--border); border-radius: 14px; background: var(--background); }
.dsn-panel { position: absolute; top: 0; left: 0; display: flex; flex-direction: column; transform-origin: 0 0; background: var(--background); color: var(--foreground); }

/* header (the panel's SiteHeader): sidebar toggle · breadcrumb · search · share */
.dsn-head { flex: none; height: 56px; display: flex; align-items: center; gap: 8px; padding: 0 16px; border-bottom: 1px solid var(--border); background: var(--background); }
.dsn-sep { width: 1px; height: 16px; background: var(--border); margin-inline: 4px 8px; }
.dsn-bc { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted-foreground); }
.dsn-bc b { color: var(--foreground); font-weight: 500; }
.dsn-bc .i { width: 14px; height: 14px; }
.dsn-sp { flex: 1; }
.dsn-search { display: flex; align-items: center; gap: 6px; width: 240px; height: 36px; padding: 0 10px; border: 1px solid var(--input); border-radius: 8px; background: var(--field-empty); color: var(--muted-foreground); }
.dsn-search input { all: unset; flex: 1; min-width: 0; font-size: 13.5px; color: var(--foreground); }

/* sidebar (the panel's AppSidebar): tenant switcher · nav · secondary nav · user */
.dsn-body { flex: 1; min-height: 0; display: flex; }
.dsn-side { flex: none; width: 256px; display: flex; flex-direction: column; gap: 8px; padding: 8px; background: var(--card); border-inline-end: 1px solid var(--border); overflow: auto; }
.dsn-tenant { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 8px; }
.dsn-tenant b { display: block; font-size: 14px; font-weight: 500; }
.dsn-tenant small, .dsn-user small { display: block; font-size: 12px; color: var(--muted-foreground); }
.dsn-tenant > div, .dsn-user > div { flex: 1; min-width: 0; }
.dsn-tl { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--primary); color: var(--primary-foreground); }
.dsn-tl .i { width: 16px; height: 16px; }
.dsn-sort { color: var(--muted-foreground); } .dsn-sort .i { width: 16px; height: 16px; }
.dsn-group { display: flex; flex-direction: column; gap: 2px; }
.dsn-gl { padding: 8px; font-size: 12px; color: var(--muted-foreground); }
.dsn-group nav { display: flex; flex-direction: column; gap: 2px; }
.dsn-sec { margin-top: auto; }
.dsn-ni { display: flex; align-items: center; gap: 8px; width: 100%; height: 32px; padding: 0 8px; border: 0; border-radius: 8px; background: transparent; color: var(--foreground); font: inherit; font-size: 14px; text-align: start; cursor: pointer; text-decoration: none; }
.dsn-ni .i { width: 16px; height: 16px; flex: none; }
.dsn-ni:hover { background: var(--muted); }
.dsn-ni[aria-current="true"] { background: var(--secondary); font-weight: 500; }
.dsn-user { display: flex; align-items: center; gap: 8px; padding: 8px; border-top: 1px solid var(--border); }
.dsn-user b { display: block; font-size: 14px; font-weight: 500; }
.dsn-av { width: 32px; height: 32px; flex: none; border-radius: 8px; display: grid; place-items: center; background: var(--secondary); font-weight: 700; }

/* the widget grid: 12 columns · rows of 80px · gap 16px — the panel's own numbers */
.dsn-main { flex: 1; min-width: 0; overflow: auto; background: color-mix(in srgb, var(--muted) 35%, var(--background)); overscroll-behavior: contain; }
.dsn-grid { position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: repeat(var(--rows, 8), 80px); gap: 16px; padding: 16px; min-height: 100%; direction: rtl; }
.dsn-empty { grid-column: 1 / -1; grid-row: 1 / span 4; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; border: 2px dashed var(--border); border-radius: 14px; color: var(--muted-foreground); padding: 24px; }
.dsn-empty b { color: var(--foreground); font-size: 16px; }
.dsn-grid.is-empty .dsn-empty { display: flex; }

/* a placed widget: the widget itself, the same look as in the templates; move / resize tools show on hover */
.dsn-it { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.dsn-it.is-drag { z-index: 5; outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 14px; }
.dsn-bd { flex: 1; min-height: 0; position: relative; }
.dsn-bd > .demo-shell { height: 100%; display: flex; flex-direction: column; }
.dsn-it.is-widget .demo-top, .dsn-it.is-widget .transport, .dsn-it.is-widget .stepcard, .dsn-it.is-widget .storyboard, .dsn-it.is-widget .mode-desc { display: none !important; }
.dsn-it.is-widget .demo-shell { gap: 0; }
/* no stage frame: no dotted backdrop, border or padding — the widget's own card (.w) is the cell */
.dsn-it.is-widget .stage-box { flex: 1; height: auto !important; min-height: 0; border: 0; border-radius: 12px; background: none; outline: none !important; box-shadow: none !important; }
.dsn-it.is-widget .stage { position: absolute; top: 0; left: 0; padding: 0; transform: none !important; }
.dsn-it.is-widget .stage > :first-child:not(.cursor) { inset: 0 !important; }
.dsn-gone { padding: 16px; font-size: 13px; color: var(--muted-foreground); }
.dsn-tools { position: absolute; top: -4px; inset-inline-start: 50%; translate: 50% 0; z-index: 9; display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 6px 0 10px; max-width: 80%; border: 1px solid var(--border); border-radius: 99px; background: var(--popover); box-shadow: var(--shadow-pop); cursor: grab; opacity: 0; pointer-events: none; transition: opacity .15s; }
.dsn-tools b { min-width: 0; font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dsn-tools .dsn-grip { display: inline-flex; color: var(--muted-foreground); } .dsn-grip .i { width: 14px; height: 14px; }
.dsn-tools .dsn-ds { width: auto; max-width: 140px; height: 22px; font-size: 11.5px; }
.dsn-tools .dsn-rm { width: 22px; height: 22px; min-width: 22px; color: var(--destructive); }
.dsn-it:hover .dsn-tools, .dsn-it.is-drag .dsn-tools, .dsn-tools:focus-within { opacity: 1; pointer-events: auto; }
.dsn-it.is-drag .dsn-tools { cursor: grabbing; }
.dsn-rz { position: absolute; bottom: 4px; left: 4px; width: 22px; height: 22px; z-index: 9; cursor: nesw-resize; opacity: 0; transition: opacity .15s; background: linear-gradient(45deg, var(--primary) 0 2px, transparent 2px 5px, var(--primary) 5px 7px, transparent 7px) 0 100% / 14px 14px no-repeat; }
.dsn-it:hover .dsn-rz, .dsn-it.is-drag .dsn-rz { opacity: .9; }

/* the «افزودن ویجت» pop-up: scrollable list of the studio's widgets */
.dsn-lq { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; margin-bottom: 10px; border: 1px solid var(--input); border-radius: 8px; background: var(--field-empty); color: var(--muted-foreground); }
.dsn-lq input { all: unset; flex: 1; min-width: 0; font-size: 13.5px; color: var(--foreground); }
.dsn-pl { max-height: min(56vh, 520px); overflow: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 2px; }
.dsn-pk { display: flex; flex-direction: column; align-items: stretch; gap: 6px; text-align: start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); color: var(--foreground); font: inherit; cursor: pointer; }
.dsn-pk:hover, .dsn-pk:focus-visible { border-color: var(--primary); outline: none; }
.dsn-pk > span:first-child { display: flex; flex-direction: column; gap: 2px; }
.dsn-pk b { font-size: 14px; font-weight: 500; }
.dsn-pk small { font-size: 12px; color: var(--muted-foreground); }
.dsn-pk p { margin: 0; font-size: 12.5px; line-height: 1.8; color: var(--muted-foreground); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.dsn-pk-add { display: inline-flex; align-items: center; gap: 4px; margin-top: auto; font-size: 12.5px; color: var(--primary); }
.dsn-pk-add .i { width: 14px; height: 14px; }
.dsn-icons { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 700px) { .dsn-pl { grid-template-columns: 1fr; } }
