/* Photo Studio */
.pstd-app, .pstd-login {
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e5e7eb;
  --soft: #f1f5f9;
  --stage: #e9edf2;
  --accent: #2563eb;
  --accent-ink: #ffffff;
  --danger: #dc2626;
  --radius: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
.pstd-app *, .pstd-login * { box-sizing: border-box; }
html.pstd-open, body.pstd-open { overflow: hidden !important; }

/* Reset theme styles inside the app */
.pstd-app :where(button, a.pstd-btn) {
  all: unset; box-sizing: border-box; cursor: pointer; font: inherit; color: inherit;
  -webkit-tap-highlight-color: transparent;
}
.pstd-app button:disabled { opacity: .35; cursor: default; }
.pstd-app button:focus-visible, .pstd-app a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pstd-app input, .pstd-app select, .pstd-app textarea { font: inherit; color: var(--ink); margin: 0; box-shadow: none; letter-spacing: normal; text-transform: none; }
.pstd-app svg { width: 20px; height: 20px; flex: none; }
.pstd-app [hidden] { display: none !important; }

/* Layout — mobile first */
.pstd-app {
  position: fixed; left: 0; right: 0; bottom: 0; top: 0; z-index: 100000;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  grid-template-areas: "top" "stage" "panel" "dock";
  background: var(--stage);
  font-size: 15px; line-height: 1.4;
}
.pstd-boot { grid-column: 1 / -1; grid-row: 1 / -1; display: grid; place-items: center; color: var(--muted); padding: 24px; text-align: center; }

.pstd-top {
  grid-area: top; display: flex; align-items: center; gap: 4px;
  padding: 8px 10px; background: #fff; border-bottom: 1px solid var(--line);
}
.pstd-title {
  flex: 1; min-width: 0; height: 38px; padding: 0 10px; border: 1px solid transparent; border-radius: 10px;
  background: transparent; font-weight: 600; font-size: 15px; outline: none;
}
.pstd-title:hover, .pstd-title:focus { border-color: var(--line); background: var(--soft); }

.pstd-ib { width: 40px; height: 40px; display: inline-grid !important; place-items: center; border-radius: 10px; color: var(--ink); }
.pstd-ib:hover:not(:disabled) { background: var(--soft); }

.pstd-btn {
  display: inline-flex !important; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px; border-radius: 10px; font-weight: 600; font-size: 14px;
  background: var(--soft); color: var(--ink); white-space: nowrap; text-decoration: none;
}
.pstd-btn:hover { background: #e2e8f0; }
.pstd-primary { background: var(--accent); color: var(--accent-ink); }
.pstd-primary:hover { background: #1d4ed8; }
.pstd-ghost { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.pstd-ghost:hover { background: var(--soft); }
.pstd-block { display: flex !important; width: 100%; }
.pstd-lg { min-height: 50px; font-size: 15px; }
.pstd-link { color: var(--muted); font-size: 14px; text-decoration: underline; padding: 6px; }

/* Stage */
.pstd-stage { grid-area: stage; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.pstd-canvas-wrap {
  box-shadow: 0 10px 40px rgba(15, 23, 42, .18), 0 0 0 1px rgba(15, 23, 42, .06);
  background-color: #fff;
  background-image: linear-gradient(45deg, #e5e7eb 25%, transparent 25%), linear-gradient(-45deg, #e5e7eb 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e5e7eb 75%), linear-gradient(-45deg, transparent 75%, #e5e7eb 75%);
  background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  line-height: 0;
}
.pstd-empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; background: var(--stage); }
.pstd-empty-card {
  width: 100%; max-width: 360px; background: #fff; border-radius: 20px; padding: 32px 24px; text-align: center;
  box-shadow: 0 10px 40px rgba(15, 23, 42, .1); display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.pstd-empty-card > svg { width: 44px; height: 44px; color: var(--accent); }
.pstd-empty-card h2 { margin: 4px 0 0; font-size: 21px; font-weight: 700; color: var(--ink); }
.pstd-empty-card p { margin: 0 0 10px; color: var(--muted); }
.pstd-empty-card .pstd-btn { width: 100%; }

/* Dock */
.pstd-dock {
  grid-area: dock; display: grid; grid-template-columns: repeat(7, 1fr);
  background: #fff; border-top: 1px solid var(--line);
  padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
}
.pstd-dock button {
  display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 58px; border-radius: 12px; font-size: 11px; font-weight: 600; color: var(--ink); min-width: 0;
}
.pstd-dock button svg { width: 24px; height: 24px; }
.pstd-dock button:hover { background: var(--soft); color: var(--accent); }

/* Panel */
.pstd-panel { grid-area: panel; background: #fff; border-top: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; max-height: 42vh; }
.pstd-panel-head {
  display: flex !important; align-items: center; justify-content: space-between; padding: 10px 16px; flex: none;
  font-size: 14px;
}
.pstd-panel-head svg { transition: transform .2s; color: var(--muted); }
.pstd-collapsed .pstd-panel-head svg { transform: rotate(180deg); }
.pstd-collapsed .pstd-panel-body { display: none; }
.pstd-panel-body { overflow-y: auto; padding: 0 16px 16px; -webkit-overflow-scrolling: touch; }

.pstd-group { display: flex; flex-direction: column; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--soft); }
.pstd-group:last-child { border-bottom: 0; }
.pstd-g-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.pstd-row { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; }
.pstd-row-wrap { flex-wrap: wrap; }
.pstd-push { margin-left: auto; }
.pstd-grow { flex: 1; min-width: 0; }
.pstd-tip { color: var(--muted); font-size: 13px; margin: 10px 0 0; }
.pstd-hint { color: var(--muted); font-size: 12px; margin: -2px 0 0; text-align: center; }
.pstd-err { color: var(--danger); }

.pstd-f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 500; margin: 0; }
.pstd-f select {
  height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; background: #fff; width: 100%;
}
.pstd-ta {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; resize: vertical; min-height: 56px;
  font-size: 16px; background: #fff; outline: none;
}
.pstd-ta:focus, .pstd-f select:focus { border-color: var(--accent); }

.pstd-rng { display: flex; align-items: center; gap: 10px; }
.pstd-rng input[type=range] { flex: 1; min-width: 0; accent-color: var(--accent); height: 28px; background: transparent; padding: 0; border: 0; }
.pstd-rng output { min-width: 44px; text-align: right; font-size: 13px; color: var(--ink); font-variant-numeric: tabular-nums; }

.pstd-app input[type=color] {
  -webkit-appearance: none; appearance: none; width: 42px; height: 42px; padding: 3px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; cursor: pointer; flex: none;
}
.pstd-app input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.pstd-app input[type=color]::-webkit-color-swatch { border: 0; border-radius: 7px; }
.pstd-app input[type=color]::-moz-color-swatch { border: 0; border-radius: 7px; }
.pstd-app input[type=color]:disabled { opacity: .35; }
.pstd-swatch { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 500; flex: none; margin: 0; }

.pstd-check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; margin: 0; color: var(--ink); }
.pstd-check input { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; }

.pstd-seg { display: flex; background: var(--soft); border-radius: 10px; padding: 3px; gap: 3px; }
.pstd-seg button { flex: 1; text-align: center; min-height: 36px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); display: grid !important; place-items: center; padding: 0 8px; }
.pstd-seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.pstd-seg-sm { margin-left: auto; }
.pstd-seg-sm button { width: 40px; flex: none; font-size: 16px; }

.pstd-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 4px 0 12px; border-bottom: 1px solid var(--soft); }
.pstd-actions button {
  display: flex !important; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px; border-radius: 10px;
  font-size: 11px; font-weight: 600; color: var(--ink); background: var(--soft);
}
.pstd-actions button:hover { background: #e2e8f0; }
.pstd-actions .pstd-danger { color: var(--danger); background: #fef2f2; }

.pstd-more { border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; }
.pstd-more summary { cursor: pointer; padding: 12px 0; font-size: 13px; font-weight: 600; color: var(--ink); }
.pstd-more[open] { padding-bottom: 12px; }
.pstd-more[open] > .pstd-f { margin-bottom: 10px; }

/* Modal / bottom sheet */
.pstd-modal { position: absolute; inset: 0; background: rgba(15, 23, 42, .45); display: flex; align-items: flex-end; justify-content: center; z-index: 5; }
.pstd-sheet {
  background: #fff; width: 100%; max-height: 88vh; border-radius: 20px 20px 0 0; display: flex; flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom); animation: pstdUp .2s ease-out;
}
@keyframes pstdUp { from { transform: translateY(30px); opacity: 0; } }
.pstd-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 6px 20px; font-size: 17px; }
.pstd-sheet-body { overflow-y: auto; padding: 8px 20px 20px; }

.pstd-sizes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pstd-size {
  display: flex !important; flex-direction: column; align-items: center; gap: 4px; padding: 14px 6px 10px;
  border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); text-align: center;
}
.pstd-size i { display: block; height: 46px; max-width: 64px; border-radius: 4px; border: 2px solid var(--muted); margin-bottom: 4px; }
.pstd-size b { font-size: 13px; }
.pstd-size small { font-size: 11px; color: var(--muted); }
.pstd-size.on { box-shadow: inset 0 0 0 2px var(--accent); }
.pstd-size.on i { border-color: var(--accent); background: rgba(37, 99, 235, .08); }

.pstd-choices { display: grid; gap: 10px; }
.pstd-choice { display: flex !important; flex-direction: column; gap: 2px; padding: 16px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.pstd-choice:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.pstd-choice b { font-size: 16px; }
.pstd-choice small { color: var(--muted); font-size: 13px; }

.pstd-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 16px; }
.pstd-card { border-radius: 12px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); display: flex; flex-direction: column; }
.pstd-card.cur { box-shadow: inset 0 0 0 2px var(--accent); }
.pstd-card-img { display: block !important; aspect-ratio: 1 / 1; background: var(--soft); }
.pstd-card-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pstd-card-meta { padding: 8px 10px 0; display: flex; flex-direction: column; min-width: 0; }
.pstd-card-meta b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pstd-card-meta small { font-size: 11px; color: var(--muted); }
.pstd-card-act { display: flex; gap: 12px; padding: 6px 10px 10px; font-size: 12px; font-weight: 600; flex-wrap: wrap; }
.pstd-card-act button, .pstd-card-act a { color: var(--accent); text-decoration: none; padding: 4px 0; }
.pstd-card-act .pstd-danger { color: var(--danger); }

/* Busy + toast */
.pstd-busy { position: absolute; inset: 0; background: rgba(255, 255, 255, .7); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 10; }
.pstd-busy-card { background: #fff; border-radius: 16px; padding: 22px 26px; box-shadow: 0 10px 40px rgba(15, 23, 42, .15); display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 280px; text-align: center; }
.pstd-busy-card p { margin: 0; font-size: 14px; font-weight: 600; }
.pstd-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--soft); border-top-color: var(--accent); animation: pstdSpin .8s linear infinite; }
@keyframes pstdSpin { to { transform: rotate(360deg); } }
.pstd-toast {
  position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 11; max-width: calc(100% - 32px);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 500;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .25); text-align: center;
}
.pstd-toast.err { background: var(--danger); }

/* Logos & membership cards */
.pstd-asset-title { margin: 18px 0 8px; }
.pstd-assets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pstd-asset { display: grid !important; place-items: center; aspect-ratio: 1 / 1; padding: 10px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line);
  background: #fff linear-gradient(45deg, #f1f5f9 25%, transparent 25%, transparent 75%, #f1f5f9 75%) 0 0 / 14px 14px; }
.pstd-asset:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.pstd-asset img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }

/* Text styles */
.pstd-tpresets { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.pstd-tp-wrap { position: relative; min-width: 0; }
.pstd-tp { display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 100%; height: 92px; padding: 10px; border-radius: 12px;
  background: #f8fafc; box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.pstd-tp.dark { background: #1e293b; }
.pstd-tp:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.pstd-tp span { font-size: 22px; line-height: 1.15; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.pstd-tp small { font-size: 11px; color: #94a3b8; font-family: inherit; font-weight: 500; }
.pstd-tp-del { position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; border-radius: 50%; background: var(--danger); color: #fff; display: grid !important; place-items: center; }
.pstd-tp-del svg { width: 14px; height: 14px; }
@media (min-width: 900px) { .pstd-tpresets { grid-template-columns: repeat(3, 1fr); } }

/* GIF / Video */
.pstd-vgrid { margin-top: 8px; }
.pstd-vpick { position: relative; display: flex !important; flex-direction: column; gap: 4px; min-width: 0; border-radius: 12px; padding: 6px; box-shadow: inset 0 0 0 1px var(--line); }
.pstd-vpick img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; background: var(--soft); border-radius: 8px; display: block; }
.pstd-vpick small { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.pstd-vpick.on { box-shadow: inset 0 0 0 3px var(--accent); }
.pstd-vpick i { position: absolute; top: 10px; left: 10px; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-style: normal; font-weight: 800; display: grid; place-items: center; font-size: 14px; }
.pstd-vopts { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 16px 0 8px; }
@media (min-width: 600px) { .pstd-vopts { grid-template-columns: repeat(3, 1fr); } }
.pstd-vopts select { height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; background: #fff; width: 100%; }
.pstd-vcustom { margin-top: 0; padding: 12px; background: var(--soft); border-radius: 12px; }
@media (min-width: 600px) { .pstd-vcustom { grid-template-columns: repeat(2, 1fr); } }
.pstd-vmusic { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); margin-bottom: 10px; }
.pstd-mrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pstd-mname { font-weight: 600; font-size: 14px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#v-mstart { height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; background: #fff; width: 140px; }
.pstd-vsec { display: flex; flex-direction: column; gap: 10px; padding: 12px 0 16px; border-bottom: 1px solid var(--soft); }
.pstd-vsec .pstd-vopts { margin: 0; }
.pstd-vopts input[type=text] { height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; background: #fff; width: 100%; font-size: 14px; outline: none; }
.pstd-vopts input[type=text]:focus { border-color: var(--accent); }
@media (min-width: 600px) { .pstd-vopts4 { grid-template-columns: repeat(2, 1fr); } }
.pstd-muted-t { color: var(--muted); font-size: 12px; }
.pstd-vrow { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--soft); }
.pstd-vrow b { flex: 1; min-width: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pstd-vthumb { flex: none; width: 40px; height: 40px; border-radius: 8px; overflow: hidden; background: var(--soft); }
.pstd-vthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pstd-vrow select { flex: none; height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 0 6px; background: #fff; font-size: 13px; max-width: 120px; }
.pstd-vrow .pstd-ib { width: 34px; height: 34px; }
.pstd-vrow .pstd-ib svg { width: 16px; height: 16px; }
.pstd-vprev { background: var(--soft); border-radius: 12px; padding: 10px; display: grid; place-items: center; }
.pstd-vprev img, .pstd-vprev video { max-width: 100%; max-height: 55vh; display: block; border-radius: 6px; }

.pstd-print { display: flex; flex-direction: column; gap: 8px; }
.pstd-print-row { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.pstd-print-row span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pstd-print-row small { color: var(--muted); font-size: 12px; }
.pstd-print-row .pstd-btn { min-height: 38px; padding: 0 14px; }

/* Shapes & stickers */
.pstd-shapes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 8px; }
.pstd-shape { display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 6px; height: 96px; padding: 10px; border-radius: 12px; background: #f8fafc; box-shadow: inset 0 0 0 1px var(--line); }
.pstd-shape:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.pstd-shape svg { width: 100%; height: 100%; min-height: 0; flex: 1; }
.pstd-shape small { font-size: 11px; color: var(--muted); flex: none; }
.pstd-stickers .pstd-shape { height: 104px; }
@media (min-width: 900px) { .pstd-shapes { grid-template-columns: repeat(4, 1fr); } }
.pstd-seg-wrap { flex-wrap: wrap; }
.pstd-seg-wrap button { flex: 1 0 auto; min-width: 54px; }

/* Share */
.pstd-app a.pstd-choice { text-decoration: none; color: var(--ink); cursor: pointer; }
.pstd-choice-hi { box-shadow: inset 0 0 0 2px var(--accent) !important; background: #eff6ff; }
.pstd-choice-hi b { display: flex; align-items: center; gap: 8px; color: var(--accent); }
.pstd-btn svg { width: 18px; height: 18px; }

/* Batch extra fields */
.pstd-bcommon { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 12px; background: var(--soft); }
.pstd-bcommon small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.pstd-bcommon-f { display: grid; grid-template-columns: 1fr; gap: 6px; }
@media (min-width: 600px) { .pstd-bcommon-f { grid-template-columns: repeat(3, 1fr); } }
.pstd-bcommon input { width: 100%; min-width: 0; height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; font-size: 14px; background: #fff; outline: none; }
.pstd-bcommon input:focus { border-color: var(--accent); }
.pstd-bextra input { height: 32px; font-size: 13px; }

/* Layers */
.pstd-layers { display: flex; flex-direction: column; gap: 6px; }
.pstd-layer { display: flex; align-items: center; gap: 4px; padding: 6px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); background: #fff; }
.pstd-layer.on { box-shadow: inset 0 0 0 2px var(--accent); }
.pstd-layer.off .pstd-lprev, .pstd-layer.off .pstd-lname { opacity: .4; }
.pstd-layer.drag { box-shadow: 0 8px 24px rgba(15, 23, 42, .2), inset 0 0 0 2px var(--accent); position: relative; z-index: 1; }
.pstd-lh { flex: none; width: 28px; height: 40px; display: grid; place-items: center; color: var(--muted); cursor: grab; touch-action: none; }
.pstd-lprev { flex: none; width: 44px; height: 44px; border-radius: 8px; overflow: hidden; display: grid !important; place-items: center; color: var(--muted);
  background: #fff linear-gradient(45deg, #f1f5f9 25%, transparent 25%, transparent 75%, #f1f5f9 75%) 0 0 / 10px 10px; box-shadow: inset 0 0 0 1px var(--line); }
.pstd-lprev img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.pstd-lname { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 6px; }
.pstd-layer .pstd-ib { width: 36px; height: 36px; flex: none; }
.pstd-layer .pstd-ib svg { width: 18px; height: 18px; }
.pstd-ib.pstd-muted { color: var(--muted); }
.pstd-ib.pstd-on { color: #b45309; background: #fef3c7; }
.pstd-tip svg { width: 14px; height: 14px; vertical-align: -2px; }

/* Template mode */
.pstd-badge { flex: none; background: #fef3c7; color: #92400e; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 4px 8px; border-radius: 6px; }
.pstd-tplf { background: #fffbeb; border-radius: 10px; padding: 10px 12px !important; border: 1px solid #fde68a !important; margin-top: 10px; }
.pstd-tplf .pstd-f { color: #92400e; font-weight: 700; }
.pstd-warn { color: #b45309; }

/* Batch */
.pstd-batch { display: flex; flex-direction: column; gap: 6px; }
.pstd-step { display: flex; flex-direction: column; gap: 10px; padding: 12px 0 16px; border-bottom: 1px solid var(--soft); }
.pstd-step h4 { margin: 0; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 10px; color: var(--ink); }
.pstd-step h4 i { font-style: normal; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 13px; }
.pstd-step .pstd-tip { margin: 0; }
.pstd-tpls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pstd-tpl { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 12px; }
.pstd-tpl-img { display: block !important; aspect-ratio: 1 / 1; border-radius: 10px; background: var(--soft); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.pstd-tpl-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pstd-tpl.on .pstd-tpl-img { box-shadow: inset 0 0 0 3px var(--accent); }
.pstd-tpl b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pstd-tpl-act { display: flex; gap: 10px; }
.pstd-tpl-act button { color: var(--accent); font-weight: 600; }
.pstd-tpl-act .pstd-danger { color: var(--danger); }
.pstd-brow { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--soft); }
.pstd-bn { flex: none; width: 22px; text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.pstd-bthumb { flex: none; width: 60px; height: 60px; border-radius: 10px; overflow: hidden; background: var(--soft); box-shadow: inset 0 0 0 1px var(--line); display: grid !important; place-items: center; text-align: center; }
.pstd-bthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pstd-bthumb small { font-size: 10px; color: var(--muted); line-height: 1.2; padding: 2px; }
.pstd-bthumb.empty { box-shadow: inset 0 0 0 1px #fcd34d; background: #fffbeb; }
.pstd-bthumb.sel { box-shadow: 0 0 0 3px var(--accent); }
.pstd-bfields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.pstd-bprices { display: flex; gap: 6px; }
.pstd-bfields input { width: 100%; min-width: 0; height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; font-size: 14px; background: #fff; outline: none; }
.pstd-bfields input:focus { border-color: var(--accent); }
.pstd-batch-foot { position: sticky; bottom: -20px; background: #fff; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0 4px; border-top: 1px solid var(--line); margin-bottom: -4px; }
.pstd-batch-foot span { font-size: 13px; color: var(--muted); }

/* Desktop */
@media (min-width: 900px) {
  .pstd-app {
    grid-template-columns: 92px minmax(0, 1fr) 340px;
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: "top top top" "dock stage panel";
  }
  .pstd-top { padding: 10px 16px; gap: 6px; }
  .pstd-title { max-width: 420px; margin-right: auto; }
  .pstd-dock { grid-template-columns: 1fr; grid-auto-rows: min-content; align-content: start; gap: 6px; padding: 14px 10px; border-top: 0; border-right: 1px solid var(--line); }
  .pstd-dock button { min-height: 72px; }
  .pstd-panel { max-height: none; border-top: 0; border-left: 1px solid var(--line); }
  .pstd-panel-head { pointer-events: none; padding: 16px 20px 6px; font-size: 16px; }
  .pstd-panel-head svg { display: none; }
  .pstd-collapsed .pstd-panel-body { display: block; }
  .pstd-panel-body { padding: 0 20px 20px; }
  .pstd-modal { align-items: center; }
  .pstd-sheet { max-width: 640px; border-radius: 20px; max-height: 84vh; }
  .pstd-grid { grid-template-columns: repeat(3, 1fr); }
  .pstd-toast { bottom: 28px; }
}

/* Login card (shown inside the theme page) */
.pstd-login { display: flex; justify-content: center; padding: 40px 16px; }
.pstd-login-card {
  width: 100%; max-width: 380px; background: #fff; border-radius: 20px; padding: 32px 26px;
  box-shadow: 0 10px 40px rgba(15, 23, 42, .1), 0 0 0 1px rgba(15, 23, 42, .04);
  display: flex; flex-direction: column; gap: 14px; text-align: left;
}
.pstd-login-logo { width: 52px; height: 52px; border-radius: 14px; background: var(--accent); color: #fff; display: grid; place-items: center; }
.pstd-login-logo svg { width: 28px; height: 28px; }
.pstd-login-card h2 { margin: 4px 0 0; font-size: 24px; font-weight: 700; color: var(--ink); }
.pstd-login-card p { margin: -8px 0 4px; color: var(--muted); }
.pstd-login-card label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink); margin: 0; }
.pstd-login-card input[type=text], .pstd-login-card input[type=password] {
  height: 48px; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; font-size: 16px; width: 100%; background: #fff; color: var(--ink);
}
.pstd-login-card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
.pstd-login-card .pstd-login-remember { flex-direction: row; align-items: center; font-weight: 500; }
.pstd-login-remember input { width: 18px; height: 18px; accent-color: var(--accent); }
.pstd-login-btn {
  display: flex; align-items: center; justify-content: center; height: 50px; border: 0; border-radius: 12px; cursor: pointer;
  background: var(--accent); color: #fff !important; font-size: 16px; font-weight: 700; text-decoration: none; width: 100%;
}
.pstd-login-btn:hover { background: #1d4ed8; }
.pstd-login-err { background: #fef2f2; color: var(--danger); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
