/* =====================================================================================
   Strings (#/strings) — strings.js. The Doodle Brutal system of styles.css and studio.css on
   its own sx- classes; the stat tiles and the Apply bar are Sounds › In game's (gs-).
   ===================================================================================== */

.sx-stats { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.sx-stats .gs-stat.is-zero { opacity: .55; }
.sx-tools { margin-bottom: 14px; }
.sx-search { flex: 1 1 280px; max-width: 460px; }

.sx-wrap { display: grid; grid-template-columns: 196px minmax(0, 1fr); gap: 16px; align-items: start; }
.sx-main { min-width: 0; }

/* ---------- the rail: one link a group ---------- */

.sx-rail {
  position: sticky; top: 72px;
  max-height: calc(100vh - 92px); overflow-y: auto;
  display: flex; flex-direction: column; gap: 1px;
  padding: 2px 4px 12px 0;
}
.sx-rail-link {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px; border: 2px solid transparent; border-radius: 9px;
  color: var(--ink); text-decoration: none; font-size: 13.5px; font-weight: 600;
}
.sx-rail-link span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-rail-link:hover { border-color: var(--ink); background: var(--panel); }
.sx-rail-link.is-active { background: var(--lemon); border-color: var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.sx-rail-link.is-sub { padding-left: 22px; font-weight: 500; font-size: 13px; }
.sx-rail-link.is-empty { color: var(--off-ink); }
.sx-rail-n { font-size: 11.5px; font-weight: 700; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

/* ---------- the table ---------- */

.sx-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.15fr) repeat(var(--langs, 3), minmax(0, 1fr));
  gap: 0;
  background: var(--panel);
  border: 2px solid var(--ink);
  border-top-width: 0;
  transition: background .2s ease;
}
.sx-group + .sx-row, .sx-headrow { border-top-width: 2px; }
.sx-headrow {
  position: sticky; top: 56px; z-index: 3;
  background: var(--ink); color: var(--bg);
  border-radius: 12px 12px 0 0;
  font-weight: 700; font-size: 13px;
}
.sx-headrow .sx-cell, .sx-headrow .sx-keycell { padding: 8px 12px; cursor: default; }
.sx-headrow .sx-code { color: rgba(253, 243, 233, .6); }
.sx-code { margin-inline-start: 6px; font: 500 11px/1 Consolas, Menlo, monospace; color: var(--ink-soft); }

.sx-group {
  display: flex; align-items: baseline; gap: 4px;
  margin: 18px 0 0; padding: 8px 12px;
  background: var(--p-lemon); border: 2px solid var(--ink); border-bottom-width: 0;
  font-size: 14px;
}
.sx-body > .sx-group:first-child { margin-top: 0; border-top-width: 0; }

.sx-keycell { padding: 10px 12px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.sx-keyline { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.sx-key {
  font: 600 12.5px/1.3 Consolas, Menlo, monospace; overflow-wrap: anywhere; cursor: copy;
  padding: 1px 4px; margin-inline-start: -4px; border-radius: 5px;
}
.sx-key:hover { background: var(--p-lemon); }
.sx-key.is-copied { animation: sx-copied .5s ease; }
@keyframes sx-copied { 30% { background: var(--lemon); transform: scale(1.04); } }
.sx-doc { margin: 0; font-size: 12.5px; line-height: 1.35; color: var(--ink); }
.sx-const { margin: 0; font: 500 11px/1.3 Consolas, Menlo, monospace; color: var(--ink-soft); overflow-wrap: anywhere; }
.sx-where { font-size: 12px; padding: 0; }
.sx-where.is-none { color: var(--off-ink); text-decoration: none; cursor: default; }
.sx-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
/* The row's tools float over the corner of its key cell while the pointer is on the row, so a
   row takes no more room than its texts need. */
.sx-keycell { position: relative; }
.sx-acts {
  position: absolute; bottom: 6px; inset-inline-end: 8px; z-index: 2;
  display: flex; gap: 4px; padding: 3px;
  background: var(--panel); border-radius: 10px; box-shadow: 0 0 0 6px var(--panel);
  opacity: 0; pointer-events: none; transform: translateY(3px);
  transition: opacity .12s ease, transform .12s ease;
}
.sx-row:hover .sx-acts, .sx-row:focus-within .sx-acts { opacity: 1; pointer-events: auto; transform: none; }
.sx-row.is-waiting .sx-acts { background: #F6F7FF; box-shadow: 0 0 0 6px #F6F7FF; }
@media (hover: none) {
  .sx-acts { position: static; opacity: 1; pointer-events: auto; transform: none; box-shadow: none; padding: 0; }
}
.sx-verdict.is-on { background: var(--lemon); box-shadow: 2px 2px 0 var(--ink); }
.sx-pill-waiting { background: var(--p-peri); color: var(--ink); animation: gs-pop .3s cubic-bezier(.3, 1.6, .5, 1); }
.sx-pill-fix { background: var(--orange); color: var(--ink); }

.sx-cell {
  padding: 8px 10px; min-width: 0;
  border-inline-start: 1.5px solid var(--hair);
  display: flex; flex-direction: column; gap: 4px;
}
.sx-cell-lang { display: none; }
.sx-val {
  position: relative;
  display: flex; flex-direction: column; gap: 2px;
  padding: 5px 7px; border: 1.5px solid transparent; border-radius: 8px;
  font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; cursor: text;
}
.sx-val[role="button"]:hover, .sx-val:focus-visible { border-color: var(--ink); background: #FFFEF4; outline: none; }
.sx-val.is-empty { border: 1.5px dashed rgba(22, 22, 22, .3); color: var(--ink-soft); font-size: 12.5px; }
.sx-val.is-empty[role="button"]:hover { border-style: solid; }
.sx-val.is-changed { background: var(--p-peri); border-color: var(--ink); }
.sx-val.has-error { box-shadow: inset 3px 0 0 var(--tomato); }
[dir="rtl"] .sx-val.has-error { box-shadow: inset -3px 0 0 var(--tomato); }
.sx-val.is-dropped { text-decoration: line-through; color: var(--off-ink); cursor: default; }
.sx-form {
  align-self: flex-start; padding: 0 6px; border-radius: 999px;
  background: var(--off-fill); font: 600 10.5px/16px var(--font); color: var(--ink-soft); direction: ltr;
}
.sx-add { font-weight: 600; }
.sx-val.is-fallback { border-color: rgba(22, 22, 22, .15); color: var(--off-ink); font-size: 12px; padding-block: 2px; }
.sx-was { font-size: 12px; color: var(--ink-soft); text-decoration: line-through; text-decoration-color: rgba(22, 22, 22, .35); }
.sx-ph {
  display: inline-block; padding: 0 4px; margin: 0 1px; border-radius: 5px;
  background: var(--p-aqua); font: 600 12px/1.45 Consolas, Menlo, monospace; direction: ltr; unicode-bidi: isolate;
}
.sx-ph.is-off { background: var(--off-fill); color: var(--off-ink); text-decoration: line-through; }
.sx-ph.is-bad { background: var(--tomato); }
.sx-tag { display: inline-block; padding: 0 3px; border-radius: 4px; background: var(--p-tomato); font-size: 11px; color: var(--ink-soft); cursor: help; }
.sx-nl { color: var(--off-ink); font-size: 11px; }
.sx-prob { font-size: 11.5px; line-height: 1.3; color: #7a5300; text-align: start; }
.sx-prob.is-err { color: #a12b1f; font-weight: 600; }
.sx-hint { margin: 0; font-size: 11.5px; color: var(--ink-soft); }

/* ---------- editing a text in place ---------- */

.sx-edit { display: flex; flex-direction: column; gap: 4px; animation: gs-open .15s ease; }
.sx-ta { width: 100%; resize: vertical; min-height: 34px; font-size: 14px; }
.sx-ref { font-size: 12px; color: var(--ink-soft); }
.sx-live { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.sx-keys { font-size: 11px; color: var(--off-ink); margin-inline-start: auto; }

/* ---------- under a row ---------- */

.sx-extra {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; gap: 8px;
  padding: 0 12px 10px;
}
.sx-waiting {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
  padding: 7px 10px; border: 1.5px solid var(--ink); border-radius: 10px; background: var(--p-peri);
  font-size: 13px;
}
.sx-waiting-title { font-weight: 700; }
.sx-waiting-who { color: var(--ink-soft); font-size: 12.5px; }
.sx-why { flex: 1 1 220px; padding: 4px 8px; font-size: 13px; border-width: 1.5px; }
.sx-applied { margin: 0; font-size: 12px; color: var(--green-text); }
.sx-note { width: 100%; }
.sx-refs { list-style: none; margin: 0; padding: 8px 10px; border: 1.5px solid var(--hair); border-radius: 10px; background: var(--bg);
           display: flex; flex-direction: column; gap: 4px; animation: gs-open .15s ease; }
.sx-ref-row { display: grid; grid-template-columns: 52px minmax(140px, max-content) minmax(0, 1fr); gap: 8px; align-items: baseline; font-size: 12.5px; }
.sx-ref-kind { justify-self: start; padding: 0 6px; border-radius: 999px; border: 1px solid var(--ink); font-size: 10.5px; font-weight: 700; line-height: 16px; background: var(--panel); }
.sx-ref-kind.is-prefab { background: var(--p-green); }
.sx-ref-kind.is-asset { background: var(--p-lemon); }
.sx-ref-kind.is-runtime { background: var(--p-aqua); }
.sx-ref-where { font-weight: 600; overflow-wrap: anywhere; }
.sx-ref-code { font: 11.5px/1.4 Consolas, Menlo, monospace; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- row states ---------- */

.sx-row.is-waiting { background: #F6F7FF; }
.sx-row.is-drop { background: var(--p-tomato); }
.sx-row.is-drop .sx-key { text-decoration: line-through; }
.sx-row.is-asked .sx-key { color: #a12b1f; }
.sx-row.is-saved { animation: sx-saved .7s ease; }
@keyframes sx-saved { 0% { background: var(--p-green); } 100% { } }
.sx-none { padding: 32px 4px; text-align: center; }
.sx-body > .sx-row:last-child { border-radius: 0 0 12px 12px; }

@media (max-width: 1100px) {
  .sx-wrap { grid-template-columns: minmax(0, 1fr); }
  /* One strip that scrolls sideways, so the groups never push the texts off the screen. */
  .sx-rail { position: static; max-height: none; flex-direction: row; gap: 4px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
  .sx-rail-link, .sx-rail-link.is-sub { flex: none; padding: 3px 10px; border-color: var(--hair); }
  .sx-rail-link span:first-child { overflow: visible; }
}
@media (max-width: 760px) {
  .sx-headrow { display: none; }
  .sx-row { grid-template-columns: minmax(0, 1fr); }
  .sx-cell { border-inline-start: 0; border-top: 1.5px solid var(--hair); }
  .sx-cell-lang { display: block; font-size: 11px; font-weight: 700; color: var(--ink-soft); }
}
