/* Plans studio: tabs per plan, an editor on the left, the Figma-designed PDF
   on the right (two iframes, swapped when the next render is ready). */
.ps-tabs { display: flex; gap: 10px; flex-wrap: wrap; }
.ps-tab { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; text-align: left; min-width: 200px; }
.ps-tab b { font-size: 14px; }
.ps-tab span { font-size: 12px; color: var(--ink-2); }
.ps-tab:hover { border-color: var(--brand-line); }
.ps-tab.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-tint); background: var(--brand-tint); }
.ps-tab.new { border-style: dashed; border-color: var(--accent); background: var(--accent-tint); }
.ps-tab.new.on { box-shadow: 0 0 0 2px var(--accent); }

.ps { position: relative; display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 20px; align-items: start; }
.ps-side { position: sticky; top: 84px; max-height: calc(100vh - 104px); overflow: auto; padding: 18px; }
.ps-side > header { display: flex; justify-content: space-between; margin-bottom: 12px; }
.ps-side > header p { font-size: 12.5px; color: var(--ink-2); }
.ps-chat { display: flex; flex-direction: column; gap: 8px; background: #EFE7DD; border-radius: 12px; padding: 12px; margin-bottom: 14px; max-height: 360px; overflow: auto; }
.ps-chat .bubble { max-width: 90%; }
.ps-chat .bubble.in { background: #fff; }
.ps-go { width: 100%; justify-content: center; height: 44px; font-size: 14.5px; }
.ps-go svg, .ps-empty svg, .head-actions .btn svg { width: 14px; height: 14px; }
.ps-steps { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ps-steps li { display: flex; gap: 8px; align-items: center; font-size: 13px; animation: pop-in .25s ease-out; }
.ps-steps li i { width: 16px; height: 16px; border-radius: 50%; flex: none; display: grid; place-items: center; }
.ps-steps li.doing i { border: 2px solid var(--brand); border-top-color: transparent; animation: spin .7s linear infinite; }
.ps-steps li.done i { background: var(--good); color: #fff; }
.ps-steps li.done i svg { width: 10px; height: 10px; }

.ps-ed { display: flex; flex-direction: column; gap: 18px; }
.ps-ed section { display: flex; flex-direction: column; gap: 10px; }
.ps-ed h3 { font-size: 14px; display: flex; justify-content: space-between; align-items: baseline; }
.ps-ed h3 em { font-style: normal; font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.ps-f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.ps-f input, .ps-f textarea { font: inherit; font-size: 13px; font-weight: 400; color: var(--ink); border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 10px; background: #fff; resize: vertical; }
.ps-f input:focus, .ps-f textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.ps-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ps-block { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 10px; background: var(--tile); }
.ps-designs { display: grid; grid-template-columns: 1fr; gap: 6px; }
.ps-designs button { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; cursor: pointer; font: inherit; text-align: left; }
.ps-designs button span { font-size: 12px; color: var(--ink-2); }
.ps-designs button.on { border: 2px solid var(--brand); padding: 8px 11px; background: var(--brand-tint); }
.ps-pal { display: flex; gap: 8px; }
.ps-pal button { flex: 1; display: flex; align-items: center; gap: 3px; padding: 7px 8px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; }
.ps-pal button i { width: 12px; height: 12px; border-radius: 50%; }
.ps-pal button span { margin-left: 4px; }
.ps-pal button.on { border: 2px solid var(--ink); padding: 6px 7px; }
.ps-photo { display: flex; align-items: center; gap: 10px; padding: 6px; border: 1px dashed var(--line-2); border-radius: 10px; background: #fff; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; color: var(--brand-text); }
.ps-photo img { width: 72px; height: 48px; object-fit: cover; border-radius: 6px; }
.ps-photo i { width: 72px; height: 48px; border-radius: 6px; background: var(--tile); display: grid; place-items: center; font-style: normal; font-size: 20px; color: var(--ink-2); }
.ps-photo:hover { border-color: var(--brand); }
details[data-day] { border: 1px solid var(--line-2); border-radius: 12px; padding: 0 12px; }
details[data-day][open] { padding-bottom: 12px; display: flex; flex-direction: column; gap: 8px; }
details[data-day] summary { display: flex; align-items: center; gap: 8px; padding: 10px 0; cursor: pointer; list-style: none; font-size: 13px; }
details[data-day] summary::-webkit-details-marker { display: none; }
details[data-day] summary b { flex: none; color: var(--brand-text); }
details[data-day] summary span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-mv { display: flex; gap: 2px; font-style: normal; }
.ps-mv button { width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; font-size: 13px; }
.ps-mv button:disabled { opacity: .35; cursor: default; }
.ps-secs { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.ps-secs label { display: flex; gap: 8px; align-items: center; }
.ps-secs input { accent-color: var(--brand); }
.ps-vers { display: flex; flex-direction: column; gap: 4px; }
.ps-vers span { font-size: 12.5px; color: var(--ink-2); padding: 4px 8px; border-radius: 8px; }
.ps-vers span.on { background: var(--brand-tint); color: var(--ink); }

.ps-main { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.ps-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.ps-bar b { display: block; font-size: 16px; }
.ps-bar span { font-size: 13px; color: var(--ink-2); }
.ps-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ps-frame { position: relative; background: #2C2F36; border-radius: 16px; overflow: hidden; height: calc(100vh - 230px); min-height: 520px; }
.ps-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; opacity: 0; transition: opacity .2s; }
.ps-frame iframe.on { opacity: 1; z-index: 1; }
.ps-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; color: #fff; padding: 32px; }
.ps-empty svg { width: 26px !important; height: 26px !important; color: var(--accent); }
.ps-empty b { font-size: 17px; }
.ps-empty p { max-width: 460px; color: rgba(255,255,255,.85); font-size: 14px; }

.ps-picker, .ps-figma { position: fixed; inset: 0; z-index: 45; background: rgba(17,19,24,.35); display: grid; place-items: center; padding: 16px; }
.ps-picker[hidden], .ps-figma[hidden] { display: none; }
.ps-pick-card { width: min(640px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: #fff; border-radius: 18px; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 24px 64px rgba(16,24,40,.24); animation: pop-in .2s ease-out; }
.ps-pick-card > header { display: flex; justify-content: space-between; align-items: center; font-size: 16px; }
.ps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.ps-grid button { padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; cursor: pointer; background: none; aspect-ratio: 3 / 2; }
.ps-grid button:hover { border-color: var(--brand); }
.ps-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ps-pick-card footer { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ps-pick-card footer span { font-size: 12px; color: var(--ink-2); margin-left: auto; }
.ps-fig ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; line-height: 1.5; }
.ps-fig code { font-size: 12.5px; background: var(--tile); padding: 1px 5px; border-radius: 4px; }

@media (max-width: 1180px) {
  .ps { grid-template-columns: 1fr; }
  .ps-side { position: static; max-height: none; }
  .ps-frame { height: 70vh; }
}
.ps-pal { flex-wrap: wrap; }
@media (max-width: 1180px) { .ps-main { order: -1; } }
