
.gr-panel, .gr-seq {
  border: 1px solid var(--glass-border);
  border-radius: var(--r-card-lg);
  background: var(--glass-bg);
  box-shadow: var(--glass-shadow);
}
.gr-panel { margin-top: 18px; padding: 18px 22px 20px; container-type: inline-size; }

.gr-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.gr-head h3, .sq-head h3 { margin: 0; font-size: 1.02rem; font-weight: 600; color: var(--text-hi); letter-spacing: -0.01em; }
.gr-head > .src-switch { margin-left: auto; }

.gr-empty { margin: 0; font-size: 0.86rem; color: var(--text-low); }
.gr-warn { margin: 0 0 14px; font-size: 0.86rem; color: var(--bad); }
.gr-busy { opacity: 0.55; transition: opacity var(--dur-1) var(--ease-out); }

.gr-code, .gr-mx code {
  font-family: var(--font-mono);
  font-weight: var(--fw-mono);
  font-size: 0.84rem;
  color: var(--text-hi);
  letter-spacing: 0.01em;
}
.gr-mx code { color: var(--text-mid); }

.gr-sources {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 22px 40px;
  align-items: start;
}
.gr-sources .gr-mx + .gr-mx { margin-top: 22px; }
.gr-mx-row {
  --gr-share: 0%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(var(--gr-cols, 3), 4.6rem);
  column-gap: 6px;
  align-items: center;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-hi);
  background: linear-gradient(90deg, rgba(42, 91, 255, 0.16) var(--gr-share), transparent var(--gr-share));
}
.gr-mx-row + .gr-mx-row { margin-top: 3px; }
.gr-mx-row > span:not(:first-child) { text-align: right; }
.gr-mx-row.is-head, .gr-row.is-head { font-size: 0.72rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-low); }
.gr-mx-row.is-head { min-height: 30px; background: none; }
.gr-mx-row.is-head > span:first-child { color: var(--text-mid); letter-spacing: 0.06em; }
.gr-mx-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 10px; }
.gr-mx-row .is-zero { color: var(--text-low); opacity: 0.6; }
.gr-mx-row.is-none { color: var(--text-low); }
.gr-mx-row.is-empty { display: block; background: none; color: var(--text-low); font-size: 0.86rem; line-height: 38px; }
.gr-other { margin: 10px 10px 0; font-size: 0.82rem; line-height: 1.5; color: var(--text-mid); }
.gr-other span { color: var(--text-low); }

.gr-form { margin: 0 0 18px; padding-bottom: 18px; border-bottom: 1px solid var(--border-soft); }
.gr-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) 7rem minmax(0, 2fr);
  gap: 12px;
}
.gr-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; font-size: 0.78rem; color: var(--text-low); }
.gr-field input, .gr-field textarea, .sq-row input {
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border-mid);
  background: rgba(2, 3, 10, 0.45);
  color: var(--text-hi);
  font: inherit;
  font-size: 0.88rem;
  box-sizing: border-box;
  color-scheme: dark;
}
.gr-field input { width: 100%; }
.gr-field input:focus, .gr-field textarea:focus, .sq-row input:focus { outline: none; border-color: rgba(120, 160, 255, 0.36); }
.gr-field input[name="code"] { font-family: var(--font-mono); font-weight: var(--fw-mono); text-transform: uppercase; letter-spacing: 0.02em; }
.gr-suffix { position: relative; display: block; }
.gr-suffix input { padding-right: 28px; -moz-appearance: textfield; appearance: textfield; }
.gr-suffix input::-webkit-inner-spin-button, .gr-suffix input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.gr-suffix i { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 0.86rem; color: var(--text-low); pointer-events: none; }
.gr-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-top: 14px; }
.gr-form-foot p { margin: 0; font-size: 0.8rem; color: var(--text-low); }
.gr-form-actions { display: flex; gap: 8px; margin-left: auto; }
.gr-form-actions .btn { min-height: 36px; }

.gr-link { padding: 0; border: 0; background: none; font: inherit; color: var(--text-hi); text-decoration: underline; text-decoration-color: rgba(150, 180, 255, 0.4); text-underline-offset: 3px; cursor: pointer; }
.gr-link:hover { text-decoration-color: currentColor; }
.gr-link:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; border-radius: 4px; }

.gr-row {
  display: grid;
  align-items: center;
  gap: 4px 16px;
  min-height: 48px;
  padding: 6px 4px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.88rem;
  color: var(--text-hi);
}
.gr-row:last-child { border-bottom: 0; }
.gr-row.is-head { min-height: 0; padding-top: 0; }
.gr-codes .gr-row { grid-template-columns: minmax(150px, 1fr) minmax(120px, 1.3fr) 4.5rem 7rem 7rem minmax(200px, auto); }
.gr-sales .gr-row { grid-template-columns: 7rem 7rem minmax(0, 1fr) 6.5rem 6.5rem 5.5rem 4.5rem; }
.gr-refs .gr-row { grid-template-columns: minmax(0, 1.6fr) 8rem 5rem minmax(0, 1fr) 7rem; }
.gr-c-st.is-earned { color: var(--ok); }
.gr-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gr-num.is-owed { color: var(--warn); }

.gr-c-code { display: flex; align-items: center; gap: 8px; min-width: 0; }
.gr-pct { font-size: 0.8rem; color: var(--text-low); font-variant-numeric: tabular-nums; }
.gr-c-who { min-width: 0; overflow-wrap: anywhere; }
.gr-c-who small, .gr-c-st small { display: block; margin-top: 2px; font-size: 0.78rem; color: var(--text-low); }
.gr-c-act { display: flex; justify-content: flex-end; gap: 6px; }
.gr-c-act .btn { min-height: 32px; }
.gr-row.is-off .gr-code, .gr-row.is-off .gr-c-who, .gr-row.is-off .gr-num { opacity: 0.45; }
.gr-c-date, .gr-c-prod { color: var(--text-mid); }
.gr-c-prod { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gr-c-st { font-size: 0.84rem; color: var(--text-low); }
.gr-c-st.is-owed { color: var(--warn); }
.gr-sub-h { margin: 26px 0 8px; font-size: 0.9rem; font-weight: 600; color: var(--text-hi); }

@container (max-width: 980px) {
  .gr-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 7rem; }
  .gr-field.is-wide { grid-column: 1 / -1; }
}
@container (max-width: 860px) {
  .gr-codes .gr-row, .gr-sales .gr-row, .gr-refs .gr-row, .gr-beta .gr-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 18px;
    padding: 14px 2px;
  }
  .gr-c-code, .gr-c-who { flex: 1 1 100%; }
  .gr-c-who { margin-top: -2px; color: var(--text-mid); }
  .gr-num { text-align: left; }
  .gr-num[data-label]::before { content: attr(data-label) " "; color: var(--text-low); font-size: 0.8rem; }
  .gr-c-act { flex: 1 1 100%; justify-content: flex-start; margin-top: 4px; }
  .gr-c-act:empty { display: none; }
  .gr-sales .gr-c-prod { flex: 1 1 100%; order: -1; color: var(--text-hi); white-space: normal; }
  .gr-sales .gr-c-date { order: -2; flex: 1 1 100%; font-size: 0.8rem; color: var(--text-low); }
  .gr-codes .gr-row.is-head, .gr-sales .gr-row.is-head, .gr-refs .gr-row.is-head, .gr-beta .gr-row.is-head { display: none; }
  .gr-beta .gr-c-st { flex: 1 1 100%; }
  .gr-beta .gr-c-prod.is-none { display: none; }
}
@container (max-width: 520px) {
  .gr-fields { grid-template-columns: 1fr; }
  .gr-field.is-pct { max-width: 8rem; }
  .gr-mx-row { grid-template-columns: minmax(0, 1fr) repeat(var(--gr-cols, 3), 3.9rem); column-gap: 4px; padding: 0 8px; }
  .gr-mx-row.is-head { font-size: 0.64rem; letter-spacing: 0.02em; }
  .gr-form-actions { width: 100%; }
  .gr-form-actions .btn, .gr-c-act .btn { flex: 1 1 auto; }
}
@media (max-width: 560px) {
  .gr-panel { padding: 16px 14px; }
}

.gr-split { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 22px 40px; align-items: start; }
.gr-facts { display: grid; gap: 18px; margin: 0; }
.gr-facts div { display: flex; flex-direction: column-reverse; gap: 2px; }
.gr-facts dd, .gr-band dd { margin: 0; font-size: 1.5rem; font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; color: var(--text-hi); font-variant-numeric: tabular-nums; }
.gr-facts dd small { font-size: 0.9rem; font-weight: 400; color: var(--text-low); letter-spacing: 0; }
.gr-facts dt, .gr-band dt { font-size: 0.8rem; color: var(--text-low); }

.gr-tools { margin-left: auto; flex-wrap: nowrap; }
.gr-tools .pn-field { flex: 0 1 auto; width: 260px; }
.gr-tools .src-switch { flex: 0 0 auto; max-width: 100%; overflow-x: auto; }

.gr-who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.gr-who > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gr-who .u-av { width: 26px; height: 26px; font-size: 0.7rem; }
.gr-anon { color: var(--text-low); }
.gr-ver { font-family: var(--font-mono); font-weight: var(--fw-mono); font-size: 0.8rem; color: var(--text-low); }
.gr-when { text-align: right; white-space: nowrap; color: var(--text-low); font-variant-numeric: tabular-nums; }

.un-list .gr-row { grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.3fr) minmax(0, 1.1fr) 8.5rem 5rem; }
.un-what { min-width: 0; }
.un-what b { font-weight: 500; color: var(--text-hi); }
.un-what q { display: block; margin-top: 3px; font-size: 0.86rem; line-height: 1.45; color: var(--text-mid); overflow-wrap: anywhere; }
.un-then { color: var(--text-mid); }
.gr-row.is-kept .un-then { color: var(--ok); }
.un-plan { color: var(--text-mid); white-space: nowrap; }
.cf-list .gr-row { grid-template-columns: minmax(0, 2.6fr) minmax(0, 1.1fr) 6.5rem 5rem; }
.cf-reasons { margin-bottom: 14px; }

.ra-dist { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; align-items: end; }
.ra-col { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.ra-n { min-height: 1.1em; font-size: 0.78rem; color: var(--text-mid); font-variant-numeric: tabular-nums; }
.ra-bar { position: relative; width: 100%; height: 92px; border-bottom: 1px solid var(--border-mid); }
.ra-bar i { position: absolute; left: 0; right: 0; bottom: 0; height: var(--h, 0%); border-radius: 6px 6px 2px 2px; background: rgba(150, 180, 255, 0.3); }
.ra-col.is-low .ra-bar i { background: rgba(251, 138, 138, 0.55); }
.ra-col.is-high .ra-bar i { background: rgba(42, 91, 255, 0.85); }
.ra-s { font-size: 0.8rem; color: var(--text-low); font-variant-numeric: tabular-nums; }
.ra-col.is-low .ra-s { color: rgba(251, 138, 138, 0.8); }

.ra-list .gr-row { grid-template-columns: 3rem minmax(0, 1fr) minmax(0, 13rem) 5rem 5rem; }
.ra-score { font-size: 1.12rem; font-weight: 500; color: var(--text-hi); font-variant-numeric: tabular-nums; }
.ra-score.is-low { color: var(--bad); }
.ra-what { min-width: 0; color: var(--text-mid); line-height: 1.45; overflow-wrap: anywhere; }

@container (max-width: 760px) {
  .gr-tools { flex-wrap: wrap; width: 100%; margin-left: 0; }
  .gr-tools .pn-field { flex: 1 1 100%; width: auto; }
  .gr-split { grid-template-columns: 1fr; }
  .gr-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .gr-facts dd { font-size: 1.3rem; }
  .ra-bar { height: 72px; }
  .un-list .gr-row, .ra-list .gr-row, .cf-list .gr-row { gap: 6px 12px; padding: 14px 2px; }
  .un-list .gr-row.is-head, .ra-list .gr-row.is-head, .cf-list .gr-row.is-head { display: none; }
  .cf-list .gr-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "what when" "who plan";
  }
  .un-list .gr-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "what when" "then then" "who plan";
  }
  .un-what { grid-area: what; }
  .un-then { grid-area: then; }
  .un-plan { grid-area: plan; text-align: right; }
  .un-list .gr-who, .cf-list .gr-who { grid-area: who; }
  .un-list .gr-when, .cf-list .gr-when { grid-area: when; align-self: start; }
  .ra-list .gr-row {
    grid-template-columns: 2.4rem minmax(0, 1fr) auto auto;
    grid-template-areas: "score who ver when" "score what what what";
    align-items: center;
  }
  .ra-score { grid-area: score; line-height: 1.6; }
  .ra-what { grid-area: what; }
  .ra-what:empty { display: none; }
  .ra-list .gr-who { grid-area: who; }
  .ra-list .gr-when { grid-area: when; }
  .ra-list .gr-ver { grid-area: ver; }
}
@container (max-width: 420px) {
  .gr-facts dt { font-size: 0.74rem; }
  .ra-dist { gap: 4px; }
}

.gr-seq { margin-top: 14px; padding: 20px 22px 4px; container-type: inline-size; }

.sq-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.sq-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 2px;
  border: 0;
  background: none;
  color: var(--text-low);
  font: inherit;
  font-size: 0.84rem;
  cursor: pointer;
}
.sq-switch-track {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-mid);
  background: rgba(150, 180, 255, 0.08);
  transition: background-color var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out);
}
.sq-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #c7d3ee;
  transition: transform var(--dur-1) var(--ease-out), background-color var(--dur-1) var(--ease-out);
}
.sq-switch[aria-checked="true"] { color: var(--text-mid); }
.sq-switch[aria-checked="true"] .sq-switch-track { background: var(--accent); border-color: rgba(140, 170, 255, 0.6); }
.sq-switch[aria-checked="true"] .sq-switch-thumb { transform: translateX(16px); background: #fff; }
.sq-switch:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; border-radius: 10px; }
.sq-switch:disabled { opacity: 0.45; cursor: default; }

.sq-track {
  --sq-line: rgba(120, 155, 255, 0.45);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) 28px repeat(5, minmax(0, 1fr));
  margin: 16px -4px 0;
  padding: 0;
  list-style: none;
}
.sq-stop { position: relative; min-width: 0; }
.sq-stop::before {
  content: "";
  position: absolute;
  top: 21px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--sq-line);
}
.sq-stop:first-child::before { left: 22px; }
.sq-stop.is-hand::before { background: repeating-linear-gradient(90deg, rgba(251, 191, 92, 0.5) 0 6px, transparent 6px 11px); }
.sq-stop.is-hand:last-child::before { right: calc(100% - 22px); }
.sq-stop.is-auto.is-paused::before, .sq-stop.is-auto.is-closed::before { background: rgba(150, 180, 255, 0.16); }

.sq-hit {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: calc(100% - 8px);
  margin: 0 4px;
  padding: 12px 10px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color var(--dur-1) var(--ease-out);
}
.sq-hit:hover { background: rgba(150, 180, 255, 0.05); }
.sq-hit:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.sq-stop.is-picked .sq-hit { background: rgba(42, 91, 255, 0.1); }

.sq-node {
  width: 16px;
  height: 16px;
  margin: 2px 0 10px;
  border-radius: 50%;
  box-sizing: border-box;
  border: 2px solid var(--text-low);
  background: var(--bg-0);
}
.sq-stop.is-live .sq-node { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 4px rgba(42, 91, 255, 0.18); }
.sq-stop.is-waiting .sq-node { border-color: var(--warn); }
.sq-stop.is-manual .sq-node { border: 2px dashed rgba(251, 191, 92, 0.75); }
.sq-stop.is-sending .sq-node { position: relative; border-color: var(--warn); background: var(--warn); box-shadow: 0 0 0 4px rgba(251, 191, 92, 0.18); }
.sq-stop.is-sending .sq-node::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; background: rgba(251, 191, 92, 0.12); animation: sq-pulse 1.8s ease-in-out infinite; }
.sq-stop.is-closed .sq-node { border-color: rgba(150, 180, 255, 0.25); }
@keyframes sq-pulse { 0%, 100% { transform: scale(0.7); opacity: 0; } 50% { transform: scale(1.15); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sq-stop.is-sending .sq-node::after { animation: none; } }

.sq-when { font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-low); }
.sq-name { font-size: 0.9rem; font-weight: 500; color: var(--text-hi); line-height: 1.3; }
.sq-count { margin-top: 4px; font-size: 0.78rem; color: var(--text-low); font-variant-numeric: tabular-nums; }
.sq-stop.is-closed .sq-name { color: var(--text-low); }

.sq-tools {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 16px 32px;
  margin-top: 14px;
  padding: 18px 0;
  border-top: 1px solid var(--border-soft);
}
.sq-form { margin: 0; min-width: 0; }
.sq-label { display: block; margin-bottom: 8px; font-size: 0.8rem; color: var(--text-low); }
.sq-label b { color: var(--text-hi); font-weight: 500; }
.sq-row { display: flex; flex-wrap: wrap; gap: 8px; }
.sq-row input { flex: 1 1 200px; min-width: 0; }
.sq-row .btn, .sq-broadcast > .btn { min-height: 38px; }

.sq-broadcast { padding: 18px 0; border-top: 1px solid var(--border-soft); }
.sq-bc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.sq-bc-head h4 { margin: 0; font-size: 0.9rem; font-weight: 600; color: var(--text-hi); }
.sq-bc-count { font-size: 0.86rem; color: var(--text-mid); font-variant-numeric: tabular-nums; }
.sq-seg { margin: 0; width: fit-content; max-width: 100%; }
.sq-confirm { margin-top: 14px; }
.sq-confirm .sq-label b { color: var(--warn); font-weight: 600; letter-spacing: 0.04em; }
.sq-bar { display: block; height: 4px; margin: 0 0 14px; border-radius: 2px; background: rgba(150, 180, 255, 0.1); overflow: hidden; }
.sq-bar i { display: block; height: 100%; border-radius: 2px; background: var(--warn); }

@container (max-width: 720px) {
  .sq-track { grid-template-columns: 1fr; margin: 12px 0 0; }
  .sq-stop::before, .sq-stop:first-child::before, .sq-stop.is-hand:last-child::before {
    top: 0;
    bottom: 0;
    left: 20px;
    right: auto;
    width: 2px;
    height: auto;
  }
  .sq-stop:first-child::before { top: 20px; }
  .sq-stop.is-hand:last-child::before { bottom: calc(100% - 20px); }
  .sq-stop.is-hand::before { background: repeating-linear-gradient(180deg, rgba(251, 191, 92, 0.5) 0 6px, transparent 6px 11px); }
  .sq-gap { height: 10px; }
  .sq-hit {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr) auto;
    column-gap: 14px;
    row-gap: 1px;
    align-items: center;
    width: 100%;
    margin: 0;
    padding: 9px 12px 9px 13px;
  }
  .sq-node { grid-row: 1 / span 2; margin: 0; }
  .sq-when, .sq-name { grid-column: 2; }
  .sq-count { grid-column: 3; grid-row: 1 / span 2; margin: 0; }
  .sq-tools { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .gr-seq { padding: 16px 14px 2px; }
  .sq-row .btn { flex: 1 1 auto; }
}

.wl-src-meta { display: block; margin-top: 2px; font-size: 0.76rem; color: var(--text-low); }

.gr-head-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }

.gr-band {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 0 0 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-soft);
}
.gr-band > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 2px 16px; border-left: 1px solid var(--border-soft); }
.gr-band > div:first-child { padding-left: 0; border-left: 0; }
.gr-band dd { order: -1; white-space: nowrap; }
.gr-band dd small { margin-left: 4px; font-size: 0.86rem; font-weight: 400; letter-spacing: 0; color: var(--text-low); }
.gr-band .is-zero dd { color: var(--text-low); }
.gr-band .is-waiting dd { color: var(--warn); }
.gr-seat-line { display: block; max-width: 8rem; height: 2px; margin-top: 6px; border-radius: 2px; background: rgba(150, 180, 255, 0.1); overflow: hidden; }
.gr-seat-line i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
@container (max-width: 720px) {
  .gr-band { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 18px; }
}
@container (441px <= width <= 720px) {
  .gr-band > div:nth-child(3n + 1) { padding-left: 0; border-left: 0; }
}
@container (max-width: 440px) {
  .gr-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gr-band > div:nth-child(2n + 1) { padding-left: 0; border-left: 0; }
}
.gr-fields.gr-beta-fields { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.gr-field textarea { width: 100%; height: auto; min-height: 64px; padding: 9px 12px; font-family: var(--font-mono); font-weight: var(--fw-mono); font-size: 0.84rem; resize: vertical; }
.gr-field textarea::placeholder { font-family: var(--font-sans); font-weight: 400; color: var(--text-low); }
.gr-field .src-switch { width: fit-content; max-width: 100%; margin-left: 0; }
.gr-beta-preview { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 0.84rem; color: var(--text-mid); }
.gr-beta-preview code { font-family: var(--font-mono); color: var(--text-low); }
.gr-beta-filter { width: fit-content; max-width: 100%; margin: 4px 0 10px; }
.gr-c-who small.gr-id { font-family: var(--font-mono); font-weight: var(--fw-mono); font-size: 0.74rem; letter-spacing: 0.01em; }
.gr-beta .gr-row { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.3fr) minmax(0, 1.2fr) 6.5rem 5.5rem 5rem minmax(190px, auto); }
.gr-beta .gr-c-prod { white-space: normal; }
.gr-beta-finish { margin-top: 18px; }
@container (max-width: 520px) {
  .gr-fields.gr-beta-fields { grid-template-columns: 1fr; }
}

:is([data-panel="growth"], [data-panel="rewards"]) .gr-mx-row {
  padding: 0 2px;
  border-radius: 0;
  background: linear-gradient(90deg, rgba(92, 132, 255, 0.85) var(--gr-share), rgba(150, 180, 255, 0.09) var(--gr-share)) left bottom / 100% 2px no-repeat;
}
:is([data-panel="growth"], [data-panel="rewards"]) .gr-mx-row.is-head, :is([data-panel="growth"], [data-panel="rewards"]) .gr-mx-row.is-empty { background: none; }
:is([data-panel="growth"], [data-panel="rewards"]) .gr-mx-row.is-head, [data-panel="growth"] .gr-row.is-head { font-size: 0.78rem; letter-spacing: 0; text-transform: none; }
:is([data-panel="growth"], [data-panel="rewards"]) .gr-mx-row.is-head > span:first-child { color: var(--text-mid); font-weight: 500; letter-spacing: 0; }
:is([data-panel="growth"], [data-panel="rewards"]) .gr-mx:has(.is-empty) .gr-mx-row.is-head > span:not(:first-child) { visibility: hidden; }
@container (max-width: 520px) {
  [data-panel="growth"] .gr-mx-row { grid-template-columns: minmax(0, 1fr) repeat(var(--gr-cols, 3), 3.4rem); column-gap: 4px; }
  [data-panel="growth"] .gr-mx-row.is-head { font-size: 0.7rem; }
  [data-panel="growth"] .gr-mx-label { padding: 8px 6px 8px 0; line-height: 1.3; white-space: normal; overflow-wrap: anywhere; }
}

@media (pointer: coarse) {
  [data-panel="growth"] .btn-sm,
  [data-panel="growth"] .sel-sm .sel-btn { height: 40px; min-height: 40px; }
  [data-panel="growth"] .src-btn-text { height: 36px; }
  [data-panel="growth"] .u-copy { width: 38px; height: 38px; margin: -8px -8px -8px -4px; }
  [data-panel="growth"] .gr-link { padding: 11px 6px; margin: -11px -6px; }
}

.rw-alert {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin-top: 18px;
  padding: 10px 12px 10px 14px;
  border: 1px solid rgba(251, 191, 92, 0.28);
  border-radius: var(--r-tile);
  background: rgba(251, 191, 92, 0.07);
  color: var(--warn);
  font-size: 0.86rem;
}
.rw-alert[hidden] { display: none; }
.rw-alert .ic { width: 16px; height: 16px; flex-shrink: 0; }
.rw-alert p { flex: 1 1 14rem; margin: 0; color: var(--text-hi); }

.rw-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-soft);
}
.rw-kpi { display: flex; flex-direction: column; gap: 5px; min-width: 0; padding: 2px 18px; border-left: 1px solid var(--border-soft); }
.rw-kpi:first-child { padding-left: 0; border-left: 0; }
.rw-kpi p { margin: 0; }
.rw-kpi-label { font-size: 0.8rem; color: var(--text-mid); }
.rw-kpi-figure { font-size: 1.9rem; font-weight: 500; line-height: 1.1; letter-spacing: -0.03em; color: var(--text-hi); font-variant-numeric: tabular-nums; }
.rw-kpi.is-zero .rw-kpi-figure { color: var(--text-low); }

.rw-split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 22px 36px; align-items: start; }
.rw-sec { margin: 0 0 10px; font-size: 0.8rem; color: var(--text-mid); }
#rw-chart { position: relative; margin: 0 -4px; }
#rw-chart svg { display: block; width: 100%; height: 160px; }
.rw-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.rw-facts { display: grid; margin: 0; }
.rw-facts div { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--border-soft); }
.rw-facts div:first-child { padding-top: 0; }
.rw-facts dt { min-width: 0; font-size: 0.84rem; color: var(--text-mid); }
.rw-facts dd { margin: 0; font-size: 0.9rem; color: var(--text-hi); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.rw-facts .is-quiet { color: var(--text-low); }

.rw-list, .rw-reds { display: flex; flex-direction: column; }
.rw-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 6px 14px;
  min-height: 60px;
  padding: 9px 4px;
  border-bottom: 1px solid var(--border-soft);
}
.rw-item:last-child { border-bottom: 0; }
.rw-ic {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(120, 160, 255, 0.18);
  border-radius: 10px;
  background: rgba(42, 91, 255, 0.12);
  color: #b9cbff;
  flex-shrink: 0;
}
.rw-ic .ic { width: 17px; height: 17px; }
.rw-item-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rw-item-text b { font-size: 0.9rem; font-weight: 500; color: var(--text-hi); overflow-wrap: anywhere; }
.rw-item-text span { font-size: 0.8rem; line-height: 1.35; color: var(--text-low); overflow-wrap: anywhere; }
.rw-price { min-width: 4.5rem; font-size: 0.92rem; font-weight: 500; color: var(--text-hi); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.rw-price small { font-size: 0.78rem; font-weight: 400; color: var(--text-low); }
.rw-item.is-off .rw-ic, .rw-item.is-off .rw-item-text, .rw-item.is-off .rw-price { opacity: 0.45; }
.rw-list .rw-item { cursor: pointer; border-radius: 10px; transition: background-color var(--dur-1) var(--ease-out); }
.rw-list .rw-item:hover { background: rgba(150, 180, 255, 0.04); }
.rw-toggle { padding: 8px 4px; }
.rw-edit .ic { width: 14px; height: 14px; }

.rw-red {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) 6.5rem 5rem 9.5rem minmax(0, 1.3fr) 6.5rem;
  align-items: center;
  gap: 6px 14px;
  min-height: 58px;
  padding: 9px 4px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.86rem;
  color: var(--text-hi);
}
.rw-red:last-child { border-bottom: 0; }
.rw-red.is-head { min-height: 0; padding-top: 0; font-size: 0.78rem; color: var(--text-low); }
.rw-red-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rw-red-main .rw-ic { width: 30px; height: 30px; border-radius: 8px; }
.rw-red-main .rw-ic .ic { width: 15px; height: 15px; }
.rw-red-main > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rw-red-main b { font-weight: 500; overflow-wrap: anywhere; }
.rw-red-main code { font-family: var(--font-mono); font-weight: var(--fw-mono); font-size: 0.72rem; color: var(--text-low); }
.rw-red-who { min-width: 0; overflow-wrap: anywhere; }
.rw-red-who small { margin-left: 4px; color: var(--text-low); }
.rw-red-date { color: var(--text-mid); white-space: nowrap; }
.rw-red-pts { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rw-red-pts small { color: var(--text-low); }
.rw-red-what { min-width: 0; font-size: 0.82rem; color: var(--text-mid); overflow-wrap: anywhere; }
.rw-red-act { display: flex; justify-content: flex-end; }
.rw-status { justify-self: start; display: inline-flex; align-items: center; gap: 7px; font-size: 0.8rem; color: var(--text-mid); }
.rw-status::before { content: ''; width: 7px; height: 7px; flex-shrink: 0; border-radius: 50%; background: currentColor; }
.rw-status.is-granted { color: var(--ok); }
.rw-status.is-pending { color: var(--warn); }
.rw-status.is-failed { color: var(--bad); }
.rw-status.is-refunded { color: var(--text-low); }

#rw-edit-modal > div { max-width: 660px; }
.modal-shell > .rw-small { max-width: 470px; }
.rw-form .sel, .rw-form .sel-btn { width: 100%; }
.rw-form input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.rw-form input[type="number"]::-webkit-inner-spin-button,
.rw-form input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.rw-suffix input { padding-right: 58px; }
.rw-suffix i { font-size: 0.74rem; }
.rw-label { font-size: 0.72rem; font-weight: 500; color: var(--text-mid); }
.rw-label i, .rw-form-switch i { font-style: normal; font-weight: 400; color: var(--text-low); }
.rw-limit { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--text-mid); white-space: nowrap; }
.sr-field .rw-limit input { flex: 1 1 0; min-width: 0; max-width: 7rem; }
.rw-hint { margin: 0; }
.rw-err { font-size: 0.72rem; color: var(--bad); }
.rw-err:empty { display: none; }
.rw-form-switch { align-self: flex-start; color: var(--text-mid); }
.rw-foot-first { margin-left: auto; }
.rw-lead { margin: 0; font-size: 0.9rem; line-height: 1.5; color: var(--text-mid); }
.rw-lead b { font-weight: 500; color: var(--text-hi); }

@container (max-width: 860px) {
  .rw-red.is-head { display: none; }
  .rw-red {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "main status" "who pts" "what date" "act act";
    row-gap: 6px;
    padding: 12px 4px;
  }
  .rw-red-main { grid-area: main; }
  .rw-status { grid-area: status; justify-self: end; text-align: right; }
  .rw-red-who { grid-area: who; color: var(--text-mid); }
  .rw-red-pts { grid-area: pts; }
  .rw-red-what { grid-area: what; }
  .rw-red-date { grid-area: date; text-align: right; font-size: 0.8rem; }
  .rw-red-act { grid-area: act; }
  .rw-red-act:empty { display: none; }
}
@container (max-width: 760px) {
  .rw-split { grid-template-columns: minmax(0, 1fr); }
}
@container (max-width: 640px) {
  .rw-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 18px; }
  .rw-kpi:nth-child(odd) { padding-left: 0; border-left: 0; }
}
@container (max-width: 560px) {
  .rw-list .rw-item {
    grid-template-columns: 36px auto minmax(0, 1fr) auto;
    grid-template-areas: "ic text text text" "ic price toggle edit";
    align-items: center;
  }
  .rw-list .rw-ic { grid-area: ic; align-self: start; }
  .rw-list .rw-item-text { grid-area: text; }
  .rw-list .rw-price { grid-area: price; min-width: 0; text-align: left; }
  .rw-list .rw-toggle { grid-area: toggle; justify-self: end; }
  .rw-list .rw-edit { grid-area: edit; }
}
@container (max-width: 380px) {
  .rw-kpi { padding: 2px 10px; }
  .rw-kpi-figure { font-size: 1.5rem; }
}

@media (pointer: coarse) {
  [data-panel="rewards"] .btn-sm,
  #rw-edit-modal .btn-sm,
  #rw-refund-modal .btn-sm,
  #rw-edit-modal .sel-btn { height: 40px; min-height: 40px; }
  [data-panel="rewards"] .rw-edit { width: 40px; }
  [data-panel="rewards"] .src-btn-text { height: 36px; }
  .rw-toggle, .rw-form-switch { min-height: 40px; }
  #rw-edit-modal .sr-field input { height: 40px; }
}
.rw-adjust { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.rw-adjust input { padding: 6px 9px; border-radius: 8px; border: 1px solid rgba(150, 180, 255, 0.16); background: rgba(0, 0, 0, 0.25); color: var(--text-hi); font: inherit; font-size: 0.86rem; }
.rw-adjust input[name="delta"] { width: 8.5rem; }
.rw-adjust input[name="reason"] { flex: 1; min-width: 10rem; }
