/* One style's page (#/style/<kit>/<style>, pages/style_edit.js). Uses the colours of app.css. */
a.st-card { color: var(--ink); text-decoration: none; }
.sted { display: grid; gap: 14px; }
.sted-back { justify-self: start; color: var(--muted); text-decoration: none; font-size: 14px; }
.sted-back:hover { color: var(--ink); }
.sted-main { display: grid; gap: 14px; }
.sted-top { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.sted-cover { width: 120px; height: 120px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); flex: none; }
.sted-names { flex: 1 1 260px; display: grid; gap: 10px; min-width: 0; }
.sted-names p { margin: 0; }
.sted-rules-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.sted-tabs { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.sted-tabs button { border: 0; background: var(--panel); color: var(--muted); padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.sted-tabs button.on { background: var(--soft); color: var(--ink); font-weight: 600; }
.st-field textarea.sted-rules { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.5; min-height: 320px; }
.sted-preview { min-height: 320px; max-height: 70vh; overflow-y: auto; padding: 12px 16px; }
.sted-save { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sted-section h2 { margin: 0; font-size: 17px; }
.sted-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.sted-pics { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-top: 10px; }
.sted-pic { margin: 0; display: grid; gap: 6px; padding: 6px; border-radius: 10px; background: var(--soft); border: 2px solid transparent; min-width: 0; }
.sted-pic.shown { border-color: var(--brand); }
.sted-pic img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 7px; display: block; background: var(--panel); }
.sted-pic figcaption { display: grid; gap: 6px; }
.sted-tags { display: flex; gap: 4px; flex-wrap: wrap; min-height: 22px; }
.sted-pic .st-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.sted-versions { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.sted-versions li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0; border-top: 1px solid var(--line); }
.sted-versions li .btn { margin-left: auto; }
.sted-delete { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
@media (max-width: 560px) {
  .sted-pics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sted-cover { width: 88px; height: 88px; }
}

/* "Ask AI to change" (features/style_chat.js) */
.sted-rules-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
dialog.schat { width: min(760px, 96vw); max-height: 92vh; display: none; padding: 16px; box-sizing: border-box; }
dialog.schat[open] { display: flex; flex-direction: column; gap: 10px; }
.schat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.schat-head h2 { margin: 0; font-size: 18px; min-width: 0; overflow-wrap: anywhere; }
.schat-log { flex: 1 1 auto; min-height: 220px; max-height: 58vh; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px; }
.schat-msg { max-width: 88%; padding: 9px 12px; border-radius: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.schat-msg.ai { align-self: flex-start; background: var(--soft); }
.schat-msg.me { align-self: flex-end; background: var(--brand); color: var(--brand-ink); white-space: pre-wrap; }
.schat-msg .md > :first-child { margin-top: 0; } .schat-msg .md > :last-child { margin-bottom: 0; }
.schat-proposal { margin-top: 8px; padding: 10px; border: 1px solid var(--brand); border-radius: 10px; background: var(--panel); display: grid; gap: 6px; }
.schat-proposal details summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.schat-rules { margin-top: 6px; max-height: 40vh; overflow-y: auto; font-size: 13px; }
.schat-input { display: flex; gap: 8px; align-items: flex-end; }
.schat-input textarea { flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 9px; padding: 8px 10px; font: inherit; resize: vertical; }
.schat-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
@media (max-width: 560px) { .schat-msg { max-width: 96%; } .schat-input { flex-direction: column; align-items: stretch; } }
.schat-note { align-self: center; }
