.studio { position: relative; isolation: isolate; background: #121212; color: #f7f7f4; }
.studio [hidden] { display: none !important; }
.studio .studio-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.studio-body { width: min(1240px,88%); margin-inline: auto; display: grid; grid-template-columns: minmax(0,.95fr) minmax(0,1.05fr); gap: clamp(30px,5vw,82px); align-items: start; }
.studio-stage { grid-column: 2; grid-row: 1; position: sticky; top: var(--mast-h,64px); height: calc(100svh - var(--mast-h,64px)); display: grid; place-items: center; overflow: clip; background: radial-gradient(ellipse 54% 38% at 63% 49%,#353534,#181818 72%,transparent); }
.studio-steps { grid-column: 1; grid-row: 1; min-width: 0; }
.studio .feature-card { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; min-height: 90svh; padding-block: clamp(66px,9vh,110px); gap: 0; }
.studio .feature-card + .feature-card { border-top: 1px solid #424240; }
.studio .card-copy h3 { font-size: clamp(36px,4.25vw,70px); font-weight: 720; letter-spacing: -.075em; line-height: 1.13; color: inherit; }
.studio .card-copy p { max-width: 31em; margin-top: 18px; color: #d0d0ca; font-size: clamp(15px,1.2vw,18px); letter-spacing: -.035em; line-height: 1.65; }
.studio-editor { width: min(100%,408px); margin-top: 26px; }
.studio-segments { display: flex; gap: 3px; padding: 3px; border: 1px solid #50504e; border-radius: 100px; width: fit-content; max-width: 100%; margin-bottom: 14px; }
.studio-segments button { min-height: 37px; min-width: 0; padding: 5px clamp(11px,1.3vw,20px); border: 0; border-radius: 100px; color: #d8d8d3; background: transparent; font-size: 13px; font-weight: 680; cursor: pointer; }
.studio-segments button[aria-pressed="true"] { color: #151515; background: #f3f3ed; }
.studio button:focus-visible,.studio select:focus-visible,.studio input:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.studio .sim-switch:has(:focus-visible) { outline: 2px solid white; }
.studio-items { list-style: none; margin: 0; padding: 0; border-top: 1px solid #474745; }
.studio-items li { display: flex; align-items: center; justify-content: space-between; min-height: 45px; padding-inline: 3px; border-bottom: 1px solid #41413f; font-size: 15px; font-weight: 650; }
.sim-switch { display: grid; place-items: center; min-width: 44px; min-height: 44px; cursor: pointer; position: relative; border-radius: 6px; }
.sim-switch input { position: absolute; opacity: 0; }
.sim-switch i { width: 35px; height: 21px; border: 1px solid #90908b; border-radius: 20px; background: #373735; }
.sim-switch i::before { content: ""; display: block; border-radius: 50%; margin: 3px; width: 13px; height: 13px; background: #aaa; }
.sim-switch input:checked + i { background: #efefeb; }
.sim-switch input:checked + i::before { background: #141414; transform: translateX(14px); }
.sim-arrows { display: flex; gap: 3px; }
.sim-arrows button { border: 0; color: white; background: transparent; width: 42px; height: 44px; font: 19px/1 system-ui,sans-serif; cursor: pointer; }
.sim-arrows button:disabled { opacity: .25; cursor: default; }
.studio-grip { display: none; }
.studio-items[data-mode=order] li { justify-content: flex-start; gap: 4px; }
.studio-items[data-mode=order] .sim-arrows { margin-left: auto; }
.studio-items[data-mode=order] .studio-grip { display: grid; place-items: center; order: -1; width: 34px; height: 44px; cursor: grab; touch-action: none; }
.studio-grip::after { content: ""; width: 11px; height: 17px; background: radial-gradient(circle at 2px 2px,#bebeb9 1.4px,transparent 1.55px) 0 0/6px 6px; }
.studio-items .dragging { opacity: .55; }
.studio-items [data-drop=after] { box-shadow: inset 0 -2px #f5f5ec; }
.studio-items [data-drop=before] { box-shadow: inset 0 2px #f5f5ec; }
.studio-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 18px; border-top: 1px solid #474745; }
.studio-field-title { grid-column: 1/-1; margin-top: 12px; font-size: 13px; color: #f3f3ee; }
.studio-fields label { min-height: 54px; min-width: 0; padding: 8px 2px; border-bottom: 1px solid #424240; font-size: 12px; color: #c7c7c0; }
.studio-fields label:has(select), .studio-range { display: grid; align-items: center; gap: 4px; }
.studio-fields .studio-color, .studio-range > span { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.studio-fields select { width: 100%; min-width: 0; padding: 4px; border-radius: 5px; border: 1px solid #66665f; background: #242423; color: #fff; font: inherit; font-size: 14px; cursor: pointer; color-scheme: dark; }
.studio-fields input[type=color] { height: 30px; width: 34px; padding: 1px; border-radius: 6px; border: 1px solid #a7a7a2; background: transparent; cursor: pointer; }
.studio-fields input[type=color]::-webkit-color-swatch-wrapper { padding: 1px; }
.studio-fields input[type=color]::-webkit-color-swatch { border: 0; border-radius: 3px; }
.studio-range input { width: 100%; min-width: 0; margin: 0; accent-color: #eee; }
.studio-range output { font-variant-numeric: tabular-nums; min-width: 3.3em; text-align: right; color: white; }

.studio-icon-picker { grid-column:1 / -1; min-width:0; padding:0 0 12px; margin:12px 0 0; border:none; }
.studio-icon-picker legend { padding:0; font-size:13px; font-weight:680; }
.studio-icon-picker label:has(select) { display:flex; align-items:center; gap:8px; min-height:44px; padding:5px 0; border:0; }
.studio-icon-picker select { width:auto; flex:1; }
.studio-icon-options { display:grid; grid-template-columns:repeat(auto-fill,minmax(43px,1fr)); gap:4px; }
.studio-icon-options button, .studio-current-icon { display:grid; place-items:center; font-size:19px; line-height:1; }
.studio-current-icon { flex:none; width:26px; }
.studio-icon-options button { min-height:40px; border:1px solid #50504e; border-radius:8px; background:#262625; color:#eee; cursor:pointer; }
.studio-icon-options button[aria-pressed=true] { background:#f3f3ee; color:#171717; border-color:#f3f3ee; }
.studio-icon-picker svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.studio-icon-picker .nav-brand-logo { display:block; width:20px; height:20px; background:currentColor; mask:url("/favicon.svg") center / contain no-repeat; }

.studio-device { position: relative; width: clamp(232px,79%,356px); aspect-ratio: 65/104; max-height: 71svh; border: 5px solid #30302e; outline: 1px solid #666660; border-radius: 30px; overflow: hidden; box-shadow: 12px 30px 48px #0008; background: #f3f3f1; transform: perspective(1100px) rotateY(-9deg) rotateZ(2deg); transition: transform .65s cubic-bezier(.22,.75,.2,1); }
.studio[data-chapter=design] .studio-device { transform: perspective(1100px) rotateY(5deg) rotateZ(-1.5deg); }
.studio-home { display: block; width: 100%; height: 100%; border: 0; background: #fff; }

.studio-widget-stage { position:absolute; inset:14px; display:grid; place-items:center; grid-template:minmax(0,1fr) / minmax(0,1fr); }
@media (min-width:741px) {
  .studio[data-chapter=widgets] .studio-stage {
    top:calc(var(--mast-h) + (100svh - var(--mast-h)) * .17);
    height:calc((100svh - var(--mast-h)) * .66);
  }
  .studio [data-studio-step=widgets] { min-height:100svh; }
}
.studio .studio-widget.wd-preview {
  width:min(92%,394px); max-width:none; padding:18px; box-shadow:0 0 0 1px #ffffff30, 8px 24px 44px #0005;
  transform:perspective(1000px) translateY(calc(8px - var(--widget-progress,0) * 16px)) rotateY(calc(var(--widget-progress,0) * 12deg - 7deg)) rotateZ(calc(var(--widget-progress,0) * 2deg - 1deg)) scale(var(--widget-fit,1));
}
.studio .studio-widget.wd-preview[data-size=compact] { width:min(76%,262px); }
.studio-widget .wd-demo-copy { min-width:0; }
.studio-widget .wd-week-event { overflow-wrap:anywhere; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.studio-widget .wd-demo-copy > span:first-child { min-width:0; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.widget-more { align-self:flex-start; color:var(--wd-accent); font-size:.75em; font-weight:600; }
.wd-demo-today-label .widget-more { float:right; }
.studio-widget .wd-month-day.has-events b::after { content:''; width:3px; height:3px; display:inline-block; margin:0 -4px 2px 1px; border-radius:50%; background:var(--wd-accent); }
.studio-widget [role=button] { cursor: pointer; }
.studio-widget [role=button]:focus-visible { outline: 2px solid currentColor; outline-offset: -2px; }
.studio-widget [role=button][aria-pressed=true]:not(.wd-demo-row) { box-shadow: inset 0 0 0 1px currentColor; }
.studio-widget .wd-demo-row[hidden] { display:none!important; }
.widget-demo-form { display:flex; flex-wrap:wrap; gap:6px; }
.widget-demo-form input { width:100%; color:inherit; background:transparent; font:inherit; border:0; border-bottom:1px solid currentColor; padding:8px 0; }
.widget-demo-form button { background:transparent; border:1px solid currentColor; color:inherit; padding:5px 8px; border-radius:6px; }

@media (max-width: 740px) {
  .studio-body { width: 100%; display: block; }
  .studio-stage { top: var(--mast-h,56px); z-index: 2; height: clamp(172px,31svh,242px); align-items: end; border-block: 1px solid #3b3b37; background: radial-gradient(ellipse at 58% 90%,#373734,#181818 72%); }
  .studio .studio-device { width: min(87%,360px); height: calc(100% - 10px); aspect-ratio: auto; max-height: none; border-width: 3px; border-radius: 17px 17px 0 0; transform: none; }
  .studio-widget-stage { inset:8px 12px; }
  .studio .studio-widget.wd-preview { width:min(94%,350px); padding:10px 12px; }
  .studio .studio-widget.wd-preview[data-size=compact] { width:min(75%,244px); }
  .studio .widget-design-card .wd-preview .wd-demo-row { padding:4px 0; }
  .studio .widget-design-card .wd-preview .wd-demo-today-label { margin:4px 0 0; }
  .studio .studio-widget:is([data-kind=today],[data-kind=routines],[data-kind=calendar_day]) .wd-demo-copy { display:flex; flex:1; flex-direction:row; align-items:baseline; gap:4px; }
  .studio-widget .wd-demo-copy > span:first-child { -webkit-line-clamp:1; }
  .studio-widget .wd-demo-copy .wd-demo-detail { white-space:nowrap; margin-left:auto; }
  .studio .widget-design-card .wd-preview .wd-demo-calendar-navigation { margin:0 0 3px; line-height:1; }
  .studio .widget-design-card .wd-preview .wd-demo-calendar-navigation>span { flex-basis:24px; }
  .studio .widget-design-card .wd-preview .wd-month-grid { gap:1px; }
  .studio .widget-design-card .wd-preview .wd-month-day { min-height:20px; padding:0; gap:0; }
  .studio .widget-design-card .wd-preview .wd-month-day b { line-height:15px; min-width:15px; }
  .studio .widget-design-card .wd-preview .wd-month-event { line-height:1.1; }
  .studio-widget .wd-demo-header { margin-bottom:4px; }
  .studio-steps { width: min(88%,510px); margin-inline: auto; }
  .studio-steps :is(button,select,input) { scroll-margin-block: calc(var(--mast-h,56px) + clamp(172px,31svh,242px) + 12px) 18px; }
  .studio .feature-card { min-height: 62svh; padding: 37px 0 45px; }
  .studio .card-copy h3 { font-size: clamp(29px,7.8vw,42px); }
  .studio .card-copy p { margin-top: 13px; font-size: 15px; }
  .studio-editor { margin-top: 17px; }
  .studio-fields { gap: 0 12px; }
  .studio-segments button { min-height: 38px; }
}
@media (min-width: 741px) and (max-height: 560px) {
  .studio-device { max-height: 89svh; }
  .studio[data-chapter=widgets] .studio-stage { top:var(--mast-h); height:calc(100svh - var(--mast-h)); }
  .studio .feature-card { padding-block: 48px; min-height: 95svh; }
}
@media (max-width: 740px) and (max-height: 460px) {
  .studio-stage { height: 138px; }
  .studio-steps :is(button,select,input) { scroll-margin-top: calc(var(--mast-h,56px) + 146px); }
  .studio-widget { padding-block: 4px; }
}
@media (max-width:420px) and (min-height:461px) and (max-height:660px) {
  .studio-stage { height:clamp(196px,39svh,246px); }
  .studio-steps :is(button,select,input) { scroll-margin-top:calc(var(--mast-h) + clamp(196px,39svh,246px) + 12px); }
}
@media (min-width:540px) and (max-width:740px) and (max-height:460px) {
  .studio-body { width:94%; display:grid; gap:16px; grid-template-columns:minmax(0,1.08fr) minmax(0,1fr); }
  .studio-stage { height:calc(100svh - var(--mast-h)); border:0; align-items:center; }
  .studio-steps { width:100%; }
  .studio-steps :is(button,select,input) { scroll-margin-top:calc(var(--mast-h) + 8px); }
}
@media (prefers-reduced-motion: reduce) {
  .studio-device { transition:none; }
  .studio .studio-widget.wd-preview { transform:scale(var(--widget-fit,1)); }
}
