/* Buddy Studio (/studio/, /en/studio/): loaded after style.css, on those two pages only. */
.st-tag { padding-left: 12px; border-left: 1px solid var(--line-2); color: var(--dim); font-weight: 650; font-size: 0.92rem; white-space: nowrap; }
.nav-pill .lang-switch { margin-left: auto; } /* no menu on these pages */
.st-hero { padding-bottom: 8px; }
.st-hero h1 { margin-bottom: 18px; }
.st-hero .lead { margin-bottom: 0; }
/* the editor needs the room: the hero shrinks to its title */
[data-view="editor"] .st-hero { padding-top: 40px; }
[data-view="editor"] .st-hero .pill-label, [data-view="editor"] .st-hero .lead { display: none; }
[data-view="editor"] .st-hero h1 { font-size: clamp(1.8rem, 3.4vw, 2.4rem); margin: 0; }
.st-section { padding: 28px 0 72px; }
.st-loading { color: var(--muted); }
.st-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.st h2.st-h2 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); letter-spacing: -0.03em; margin: 0; }
.st-h2:focus { outline: none; }

/* login */
.st-login { max-width: 460px; gap: 22px; }
.st-login input[type=password] { width: 100%; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: 16px; background: rgba(255, 255, 255, 0.03); color: var(--text); font: 1rem var(--font); }
.st-login input[type=password]:focus { border-color: var(--em-2); outline: none; box-shadow: 0 0 0 2px var(--em-2); }
.st-login .fine { margin: 14px 0 0; }

/* who is logged in */
.st-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 30px; padding: 8px 8px 8px 20px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.st-bar[hidden] { display: none; }
.st-bar p { margin: 0; color: var(--dim); font-size: 0.95rem; overflow-wrap: anywhere; }
.st-bar b { color: var(--text); }

.st-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.st-head-2 { margin-top: 44px; }
.st-notice { margin: 0 0 14px; padding: 11px 16px; border-radius: 14px; border: 1px solid rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.08); color: var(--text); font-size: 0.93rem; }
.st-err { margin: 0 0 14px; color: var(--rose); font-weight: 600; font-size: 0.92rem; }
.st-notice:empty, .st-err:empty { display: none; }
.st-empty { margin: 0; padding: 22px; color: var(--dim); }
.st-empty[hidden] { display: none; }

/* status chips: plain, except "approved" in the one green */
.st-chip { display: inline-flex; align-items: center; padding: 3px 11px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--dim); font-size: 0.78rem; font-weight: 700; letter-spacing: 0; line-height: 1.5; white-space: nowrap; }
.st-chip[data-s=review] { color: var(--text); background: rgba(255, 255, 255, 0.07); }
.st-chip[data-s=changes] { color: var(--text); border-color: rgba(255, 255, 255, 0.34); }
.st-chip[data-s=approved] { color: var(--em-2); border-color: rgba(52, 211, 153, 0.42); background: rgba(52, 211, 153, 0.1); }

/* the designer's drafts */
.st-drafts { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.st-draft { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px 22px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 20px; background: var(--card); }
.st-draft h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 4px; font-size: 1.08rem; }
.st-draft-name { min-width: 0; overflow-wrap: anywhere; }
.st-meta { margin: 0; color: var(--muted); font-size: 0.88rem; }
.st-note { margin: 12px 0 0; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.03); color: var(--dim); font-size: 0.92rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.st-note b, .st-banner b { color: var(--text); }
.st-acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.st-help { margin-top: 30px; padding: 16px 22px; border: 1px solid var(--line); border-radius: 20px; background: var(--card); color: var(--dim); }
.st-help summary { cursor: pointer; color: var(--text); font-weight: 700; }
.st-help summary:focus-visible { outline-offset: 4px; }
.st-help ol { display: grid; gap: 8px; margin: 14px 0 4px; padding-left: 1.3em; font-size: 0.95rem; line-height: 1.6; }
.st-help b { color: var(--text); }
.st-help code { overflow-wrap: anywhere; color: var(--text); }

/* editor */
.st-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; margin-bottom: 14px; }
.st-name { flex: 1 1 260px; min-width: 0; max-width: 460px; }
.st-name label { display: block; margin-bottom: 6px; color: var(--text); font-weight: 700; font-size: 0.9rem; }
.st-name input { width: 100%; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: 16px; background: rgba(255, 255, 255, 0.03); color: var(--text); font: 600 1rem var(--font); }
.st-name input:focus { border-color: var(--em-2); outline: none; box-shadow: 0 0 0 2px var(--em-2); }
.st-state { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-bottom: 9px; color: var(--muted); font-size: 0.88rem; }
.st-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.st-banner { margin: 0 0 14px; padding: 11px 16px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.04); color: var(--dim); font-size: 0.93rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.st-banner[hidden] { display: none; }
.st-tools .st-tools-gap { flex: 1; }
.st-tools .st-icon { width: 38px; padding: 8px 0; }
.st-phone-note { display: none; }
[data-view="editor"] .st-section { padding-bottom: 28px; }

/* three columns the height of the window: the parts, the preview, the settings; each scrolls on its own */
.st-grid {
  display: grid; gap: 14px;
  grid-template-columns: 250px minmax(0, 1fr) 340px;
  grid-template-areas: "parts stage side";
  height: calc(100vh - 100px); min-height: 620px;
}
.st-panel { min-width: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 20px; background: var(--card); }
.st-panel h3 { display: flex; align-items: center; gap: 9px; margin: 0 0 10px; font-size: 0.98rem; }
.st-panel h3 i { color: var(--dim); font-size: 0.9rem; }
.st-parts { grid-area: parts; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
#st-parts { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.st-stage { grid-area: stage; display: flex; flex-direction: column; gap: 12px; min-width: 0; min-height: 0; overflow: auto; }
.st-side { grid-area: side; display: flex; flex-direction: column; min-height: 0; padding: 0; overflow: hidden; }
.st-preview { position: relative; flex: none; display: grid; place-items: center; min-height: 260px; padding: 12px; border: 1px solid var(--line); border-radius: 20px; background: #0b0c12; }
.st-preview-empty { display: grid; justify-items: center; gap: 8px; max-width: 340px; text-align: center; }
.st-preview-empty[hidden] { display: none; }
.st-preview-empty i { font-size: 2rem; color: var(--muted); margin-bottom: 4px; }
.st-preview-empty span { color: var(--muted); font-size: 0.9rem; line-height: 1.5; }
.st-tests { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.st-tests > span { margin-right: 4px; color: var(--dim); font-size: 0.86rem; font-weight: 650; }
.st-test { padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.03); color: var(--text); font: 650 0.84rem var(--font); cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.st-test:hover:not(:disabled) { border-color: rgba(255, 255, 255, 0.28); background: rgba(255, 255, 255, 0.07); }
.st-test[aria-pressed="true"] { border-color: var(--em-2); background: rgba(52, 211, 153, 0.14); }
.st-test:disabled { cursor: not-allowed; opacity: 0.5; }
.st-check { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line-2); color: var(--dim); font-size: 0.86rem; line-height: 1.5; }
.st-check:empty { display: none; }
.st-check.ok { border-color: rgba(52, 211, 153, 0.4); background: rgba(52, 211, 153, 0.08); color: var(--text); }
.st-check.ok i { color: var(--em-2); }
.st-check.bad i { color: var(--rose); }
.st-check.bad b { color: var(--text); }
.st-check code { color: var(--text); overflow-wrap: anywhere; }
.st-check .sx-hint { flex-basis: 100%; margin: 0; }

/* the preview: Poni's square, its notch and what goes round the Buddy (sized from Poni's 76 px: --k) */
.sx-square { position: relative; margin: 0 auto; border-radius: 14px; overflow: hidden; --k: 5; --lift: 0; }
.sx-square[data-bg="dark"] { background: linear-gradient(160deg, #1d2233, #0e1018); }
.sx-square[data-bg="mid"] { background: linear-gradient(160deg, #75839c, #4b566c); }
.sx-square[data-bg="light"] { background: linear-gradient(160deg, #f1f3f7, #cfd5df); }
.sx-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.sx-canvas:active { cursor: grabbing; }
.sx-notch { position: absolute; left: 0; right: 0; top: 0; height: 22%; background: #000; border-radius: 0 0 22px 22px; pointer-events: none; }
.sx-hit { position: absolute; border: 2px dashed rgba(52, 211, 153, 0.95); border-radius: 6px; pointer-events: none; }
.sx-notch[hidden], .sx-hit[hidden] { display: none; }
.sx-fx { position: absolute; inset: 0; pointer-events: none; }
.sx-zzz { position: absolute; left: 78%; top: calc((0.45 - var(--lift)) * 100%); opacity: 0; transition: opacity 0.6s; }
.sx-zzz.on { opacity: 1; }
.sx-zzz span { position: absolute; font-weight: 800; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7); animation: sxZzz 3s ease-in-out infinite; opacity: 0; }
.sx-zzz span:nth-child(1) { font-size: calc(9px * var(--k)); }
.sx-zzz span:nth-child(2) { font-size: calc(11px * var(--k)); animation-delay: 1s; }
.sx-zzz span:nth-child(3) { font-size: calc(14px * var(--k)); animation-delay: 2s; }
.sx-zzz:not(.on) span { animation-play-state: paused; }
.sx-zzz.still span { animation: none; opacity: 0.9; }
.sx-zzz.still span:nth-child(1) { transform: translate(calc(2px * var(--k)), calc(4px * var(--k))); }
.sx-zzz.still span:nth-child(2) { transform: translate(calc(7px * var(--k)), calc(-3px * var(--k))); }
.sx-zzz.still span:nth-child(3) { transform: translate(calc(13px * var(--k)), calc(-11px * var(--k))); }
@keyframes sxZzz { 0% { opacity: 0; transform: translate(0, calc(10px * var(--k))); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(14px * var(--k)), calc(-16px * var(--k))); } }
.sx-hearts { position: absolute; left: 50%; top: calc((0.55 - var(--lift)) * 100%); }
.sx-hearts i { position: absolute; color: #ff5c8a; font-size: calc(11px * var(--k)); animation: sxHeart 1.4s ease-out forwards; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5)); }
@keyframes sxHeart { from { opacity: 1; transform: translateY(0) scale(0.6); } to { opacity: 0; transform: translateY(calc(-22px * var(--k))) scale(1.2); } }
.sx-hearts .sx-bulb { color: #ffd60a; font-size: calc(14px * var(--k)); filter: drop-shadow(0 0 6px rgba(255, 214, 10, 0.85)); animation: sxBulb 1.25s cubic-bezier(0.2, 1.4, 0.4, 1) forwards; }
.sx-hearts .sx-spark { font-size: calc(8px * var(--k)); opacity: 0; animation: sxSpark 0.95s ease-out forwards; }
@keyframes sxBulb { 0% { opacity: 0; transform: scale(0.3); } 25% { opacity: 1; transform: translate(calc(30px * var(--k)), calc(-10px * var(--k))) scale(1.15); } 70% { opacity: 1; transform: translate(calc(30px * var(--k)), calc(-12px * var(--k))); } 100% { opacity: 0; transform: translate(calc(30px * var(--k)), calc(-16px * var(--k))) scale(0.9); } }
@keyframes sxSpark { 0% { opacity: 0; transform: scale(0.3); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(var(--dx) * var(--k)), calc(var(--dy) * var(--k))) rotate(120deg); } }
.sx-think { position: absolute; left: 68%; top: calc((0.24 - var(--lift)) * 100%); width: calc(46px * var(--k)); height: calc(34px * var(--k)); opacity: 0; transition: opacity 0.25s; }
.sx-think.on { opacity: 1; }
.sx-think > i, .sx-think .cloud { position: absolute; background: #f2f3f7; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); }
.sx-think > i { border-radius: 50%; }
.sx-think .t1 { width: calc(5px * var(--k)); height: calc(5px * var(--k)); left: 0; bottom: calc(2px * var(--k)); }
.sx-think .t2 { width: calc(8px * var(--k)); height: calc(8px * var(--k)); left: calc(6px * var(--k)); bottom: calc(8px * var(--k)); }
.sx-think .cloud { left: calc(13px * var(--k)); top: 0; width: calc(32px * var(--k)); height: calc(20px * var(--k)); border-radius: calc(11px * var(--k)); display: flex; align-items: center; justify-content: center; gap: calc(3px * var(--k)); }
.sx-think .cloud b { width: calc(4px * var(--k)); height: calc(4px * var(--k)); border-radius: 50%; background: #6b7080; animation: sxDot 1s ease-in-out infinite; }
.sx-think .cloud b:nth-child(2) { animation-delay: 0.15s; }
.sx-think .cloud b:nth-child(3) { animation-delay: 0.3s; }
.sx-think:not(.on) b { animation-play-state: paused; }
@keyframes sxDot { 0%, 60%, 100% { transform: translateY(0); opacity: 0.45; } 30% { transform: translateY(calc(-3px * var(--k))); opacity: 1; } }

/* under the preview: palettes, view switches */
.st-view-tools { display: grid; gap: 8px; }
.st-view-tools .sx-hint { margin: 0; }
.sx-viewrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sx-palchips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sx-palchips > .sx-label { margin: 0 4px 0 0; }
.sx-palchip, .sx-toggle, .sx-mini { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.03); color: var(--dim); font: 650 0.8rem var(--font); cursor: pointer; transition: border-color 0.15s, background 0.15s, color 0.15s; }
.sx-palchip { padding-left: 6px; }
.sx-palchip:hover, .sx-toggle:hover, .sx-mini:hover { border-color: rgba(255, 255, 255, 0.28); color: var(--text); }
.sx-palchip[aria-pressed="true"], .sx-toggle[aria-pressed="true"] { border-color: var(--em-2); background: rgba(52, 211, 153, 0.12); color: var(--text); }
.sx-mini { color: var(--text); }
.sx-palchip .sx-swatch { width: 16px; height: 16px; border-radius: 50%; }
.sx-bg { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border: 1px solid var(--line-2); border-radius: 999px; }
.sx-bgdot { width: 20px; height: 20px; padding: 0; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.2); cursor: pointer; }
.sx-bgdot.dark { background: #161a26; }
.sx-bgdot.mid { background: #607089; }
.sx-bgdot.light { background: #e4e8ef; }
.sx-bgdot[aria-checked="true"] { border-color: var(--em-2); box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.35); }

/* the parts list */
.sx-tools { position: relative; display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.sx-tool { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 30px; height: 30px; padding: 0 7px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.03); color: var(--text); font: 650 0.8rem var(--font); cursor: pointer; }
.sx-tool:hover:not(:disabled) { border-color: rgba(255, 255, 255, 0.28); background: rgba(255, 255, 255, 0.07); }
.sx-tool:disabled { opacity: 0.4; cursor: not-allowed; }
.sx-addwrap { position: relative; width: 100%; }
.sx-add { width: 100%; }
.sx-menu { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 20; display: grid; gap: 2px; padding: 6px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--card-solid); box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.8); }
.sx-menu[hidden] { display: none; }
.sx-menu button { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 0; border-radius: 9px; background: none; color: var(--text); font: 600 0.86rem var(--font); text-align: left; cursor: pointer; }
.sx-menu button i { width: 16px; color: var(--dim); }
.sx-menu button:hover, .sx-menu button:focus-visible { background: rgba(255, 255, 255, 0.08); }
.sx-tree { flex: 1; min-height: 0; overflow: auto; list-style: none; margin: 0 -6px; padding: 0 6px; display: grid; align-content: start; gap: 2px; }
.sx-node { width: 100%; display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px calc(8px + var(--depth, 0) * 16px); border: 1px solid transparent; border-radius: 10px; background: none; color: var(--dim); font: 600 0.86rem var(--font); text-align: left; cursor: pointer; }
.sx-node:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.sx-node[aria-current="true"] { border-color: rgba(52, 211, 153, 0.6); background: rgba(52, 211, 153, 0.12); color: var(--text); }
.sx-node > i:first-child { width: 16px; flex: none; color: var(--muted); font-size: 0.8rem; }
.sx-node.out .sx-node-name { color: var(--muted); font-style: italic; }
.sx-node-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-badges { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 0.74rem; }
.sx-tag { padding: 0 6px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 0.7rem; line-height: 1.5; }
.sx-count { margin: 10px 0 0; color: var(--muted); font-size: 0.78rem; line-height: 1.5; }
.sx-count.stale { font-style: italic; }

/* the settings: tabs and fields */
.st-tabs { display: flex; gap: 2px; padding: 8px 10px 0; border-bottom: 1px solid var(--line); }
.st-tab { flex: 1; padding: 9px 6px 10px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--dim); font: 700 0.84rem var(--font); cursor: pointer; }
.st-tab:hover { color: var(--text); }
.st-tab[aria-selected="true"] { border-bottom-color: var(--em-2); color: var(--text); }
.st-tabpanel { flex: 1; min-height: 0; overflow: auto; padding: 14px 16px 18px; }
.st-tabpanel[hidden] { display: none; }
.sx-field { margin: 0 0 12px; }
.sx-label { display: block; margin: 0 0 5px; color: var(--text); font-weight: 700; font-size: 0.8rem; }
.sx-text, .sx-select { width: 100%; padding: 8px 11px; border: 1px solid var(--line-2); border-radius: 12px; background: rgba(255, 255, 255, 0.03); color: var(--text); font: 0.88rem var(--font); }
textarea.sx-text { min-height: 64px; resize: vertical; line-height: 1.45; }
.sx-select option { background: var(--card-solid); color: var(--text); }
.sx-text:focus, .sx-select:focus { border-color: var(--em-2); outline: none; box-shadow: 0 0 0 2px var(--em-2); }
.sx-num { display: flex; align-items: center; min-width: 0; border: 1px solid var(--line-2); border-radius: 12px; background: rgba(255, 255, 255, 0.03); }
.sx-num:focus-within { border-color: var(--em-2); box-shadow: 0 0 0 2px var(--em-2); }
.sx-num-l { align-self: stretch; display: flex; align-items: center; padding: 0 8px; border-right: 1px solid var(--line); color: var(--dim); font-size: 0.76rem; font-weight: 700; white-space: nowrap; cursor: ew-resize; user-select: none; touch-action: none; }
.sx-num-l:hover { color: var(--text); }
.sx-num.wide .sx-num-l { min-width: 8.6em; }
.sx-num input { flex: 1; min-width: 0; width: 100%; padding: 7px 6px 7px 8px; border: 0; background: transparent; color: var(--text); font: 600 0.84rem var(--font); outline: none; }
.sx-num input::placeholder { color: var(--muted); }
.sx-unit { padding-right: 8px; color: var(--muted); font-size: 0.8rem; }
.sx-num.with-range { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; }
.sx-num.with-range .sx-num-l { min-width: 8.6em; }
.sx-range { grid-column: 1 / -1; width: calc(100% - 28px); margin: 2px 14px 8px; accent-color: var(--em); }
.sx-vec { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 5px; }
.sx-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 6px 10px; margin-bottom: 4px; }
.sx-check { display: flex; align-items: center; gap: 8px; margin: 2px 0 10px; color: var(--dim); font-size: 0.85rem; cursor: pointer; }
.sx-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--em); }
.sx-seg { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.sx-seg label { position: relative; }
.sx-seg input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.sx-seg span { display: inline-block; padding: 5px 11px; border: 1px solid var(--line-2); border-radius: 999px; color: var(--dim); font: 650 0.79rem var(--font); }
.sx-seg input:checked + span { border-color: var(--em-2); background: rgba(52, 211, 153, 0.12); color: var(--text); }
.sx-seg input:focus-visible + span { outline: 2px solid var(--em-2); outline-offset: 2px; }
.sx-sec { margin: 0 0 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.sx-sec > h4, .sx-sec > summary { margin: 0 0 10px; color: var(--dim); font-size: 0.8rem; font-weight: 800; }
.sx-sec > summary { cursor: pointer; }
.sx-sec .sx-sec { border-top: 0; padding-top: 4px; }
.sx-hint { margin: 4px 0 8px; color: var(--muted); font-size: 0.77rem; line-height: 1.45; }
.sx-err { margin: 4px 0; color: var(--rose); font-size: 0.8rem; font-weight: 600; }
.sx-err:empty { display: none; }
.sx-empty { padding: 6px 2px; color: var(--muted); font-size: 0.85rem; line-height: 1.5; }
.sx-indent { margin: 2px 0 10px; padding-left: 12px; border-left: 2px solid var(--line-2); }
.sx-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0; }
.sx-row .sx-text { flex: 1; width: auto; min-width: 0; }
.sx-x { display: inline-grid; place-items: center; flex: none; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.sx-x:hover { color: var(--text); background: rgba(255, 255, 255, 0.08); }
.sx-color { display: grid; gap: 6px; justify-items: start; margin-bottom: 12px; }
.sx-color-row { display: flex; align-items: center; gap: 6px; width: 100%; }
.sx-color-row .sx-select { flex: 1; min-width: 0; }
.sx-swatch { flex: none; width: 22px; height: 22px; border-radius: 7px; border: 1px solid rgba(255, 255, 255, 0.28); }
.sx-swatch.none { background: repeating-linear-gradient(45deg, #4a4f5c 0 4px, #23262f 4px 8px); }
.sx-pick { flex: none; width: 34px; height: 30px; padding: 0 2px; border: 1px solid var(--line-2); border-radius: 8px; background: none; cursor: pointer; }
.sx-missing { color: var(--rose); font-size: 0.74rem; font-weight: 650; white-space: nowrap; }
.sx-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.sx-chip { display: inline-flex; align-items: center; gap: 2px; padding: 4px 10px; border: 1px solid var(--line-2); border-radius: 999px; background: none; color: var(--dim); font: 650 0.78rem var(--font); cursor: pointer; }
.sx-chip.flag { border-style: dashed; }
.sx-chip[aria-pressed="true"], .sx-chip.on { border-color: var(--em-2); background: rgba(52, 211, 153, 0.12); color: var(--text); }
.sx-chip .sx-x { width: 20px; height: 20px; margin-right: -6px; }
.sx-colorline { display: grid; grid-template-columns: minmax(0, 1fr) 34px 84px 26px; align-items: center; gap: 6px; margin-bottom: 6px; }
.sx-diffs .sx-check { margin-bottom: 6px; }

/* "New Buddy": the starting points */
.st-pick { margin: 0 0 18px; padding: 16px; border: 1px solid var(--line); border-radius: 20px; background: var(--card); }
.st-pick[hidden] { display: none; }
.st-pick-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.st-pick-head h3 { margin: 0; font-size: 1rem; }
.st-pick-head h3:focus { outline: none; }
.st-pick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.st-pick-card { display: grid; justify-items: start; gap: 3px; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: 16px; background: rgba(255, 255, 255, 0.03); color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.st-pick-card:hover { border-color: rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.06); }
.st-pick-card i { margin-bottom: 4px; color: var(--em-2); font-size: 1.35rem; }
.st-pick-card b { font-size: 0.98rem; }
.st-pick-card span { color: var(--muted); font-size: 0.84rem; line-height: 1.45; }

@media (max-width: 1000px) {
  /* the preview on top, the parts and the settings side by side under it */
  .st-grid { height: auto; min-height: 0; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr); grid-template-areas: "stage stage" "parts side"; }
  .st-stage { overflow: visible; }
  .st-parts, .st-side { max-height: 80vh; }
}
@media (max-width: 760px) {
  /* no editor on a phone: a note, and the drafts list stays usable */
  .st-editor .st-grid, .st-editor .st-tools, .st-editor .st-name, .st-editor .st-state { display: none; }
  .st-phone-note { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 0; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: 16px; background: rgba(255, 255, 255, 0.04); color: var(--dim); font-size: 0.93rem; line-height: 1.5; }
  .st-phone-note i { margin-top: 3px; color: var(--em-2); }
}
@media (prefers-reduced-motion: reduce) {
  .sx-zzz span, .sx-think .cloud b, .sx-hearts i { animation: none !important; }
  .sx-zzz.on span { opacity: 0.9; }
}

/* the owner's tables */
.st-table-wrap { border: 1px solid var(--line); border-radius: 20px; background: var(--card); overflow: hidden; }
.st-table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.st-table[hidden] { display: none; }
.st-table th { padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--dim); font-size: 0.82rem; font-weight: 700; text-align: left; white-space: nowrap; }
.st-table td { padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--dim); vertical-align: top; }
.st-table tbody tr:last-child td { border-bottom: 0; }
.st-table td:first-child { min-width: 11em; }
.st-table td:nth-child(3), .st-table td:nth-child(4) { white-space: nowrap; } /* dates, sizes, chips */
.st-table .st-acts { justify-content: flex-end; }
.st-strong { color: var(--text); font-weight: 650; }
.st-dim { color: var(--muted); font-size: 0.86rem; }
.st-sub { display: block; margin-top: 2px; color: var(--muted); font-size: 0.84rem; overflow-wrap: break-word; }
.st-note-line { white-space: pre-wrap; max-width: 46ch; }
.st-note-line b { color: var(--dim); }
.st-note-row td { background: rgba(255, 255, 255, 0.025); }
.st-note-form { display: grid; gap: 10px; max-width: 640px; }
.st-note-form .dl-label { margin: 0; }
.st-note-form textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 16px; background: rgba(255, 255, 255, 0.03); color: var(--text); font: 0.95rem/1.55 var(--font); resize: vertical; }
.st-note-form textarea:focus { border-color: var(--em-2); outline: none; box-shadow: 0 0 0 2px var(--em-2); }
.st-note-form .st-err { margin: 0; }

.st-footer { margin-top: 0; padding-top: 0; }
.st-footer .footer-bottom { margin-top: 0; }

@media (max-width: 640px) {
  .st-tag { display: none; }
  .st-bar { border-radius: 20px; padding: 12px 12px 12px 16px; }
  .st-draft { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .st-acts, .st-table .st-acts { justify-content: flex-start; }
  /* tables fold into one card per row, each value under its column's name */
  .st-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .st-table, .st-table tbody, .st-table tr, .st-table td { display: block; }
  .st-table tr { padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .st-table tbody tr:last-child { border-bottom: 0; }
  .st-table td { padding: 3px 0; border: 0; }
  .st-table td[data-label]::before { content: attr(data-label); display: block; color: var(--muted); font-size: 0.76rem; font-weight: 650; }
  .st-table td:last-child { padding-top: 10px; }
}
