:root {
  color-scheme: dark;
  --bg: #07090b;
  --panel: #111820;
  --panel2: #18222b;
  --grid: #2b3942;
  --grid2: #40515c;
  --text: #edf5df;
  --muted: #8ea09b;
  --yellow: #f3cc58;
  --cyan: #61d8d2;
  --red: #ff6b61;
  --green: #94df69;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #101923, var(--bg) 260px);
  color: var(--text);
  font: 14px/1.35 "Segoe UI", Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  cursor: pointer;
}

.app {
  width: calc(100vw - 28px);
  height: calc(100vh - 28px);
  margin: 14px auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  overflow: hidden;
}

.panel {
  border: 1px solid var(--grid2);
  border-radius: 6px;
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.4);
}

.transport {
  position: relative;
  padding: 9px 44px 9px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  overflow: visible;
}

.product-shell {
  --product-mark-color: var(--cyan);
}

.app-fullscreen-button {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  padding: 1px 0 0;
  border: 1px solid rgba(97, 216, 210, 0.42);
  border-radius: 3px;
  background: rgba(11, 16, 20, 0.72);
  color: var(--cyan);
  box-shadow: none;
  font: 800 13px/1 "Courier New", monospace;
}

.app-fullscreen-button:hover {
  border-color: var(--yellow);
  color: var(--yellow);
}

.transport-left,
.shell-brand-area {
  grid-column: 1;
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-logo {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0;
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 22px;
  line-height: 1;
  text-shadow: 0 1px 2px #000;
  user-select: none;
  transform: translateY(-2px);
}

.brand-mark-letter {
  color: var(--product-mark-color, var(--cyan));
  font-weight: 900;
}

.brand-mark-separator {
  color: rgba(231, 239, 218, 0.72);
  font-weight: 700;
  transform: translateY(-1px);
}

.brand-mark-play {
  color: var(--yellow);
  font-weight: 900;
  font-size: 0.9em;
  transform: translateY(-1px);
}

.project-name {
  grid-column: 2;
  width: min(360px, 38vw);
  max-width: min(360px, 38vw);
  min-height: 22px;
  padding: 1px 8px;
  border: 1px solid transparent;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font: 800 17px/22px "Courier New", monospace;
  text-transform: uppercase;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: text;
}

.project-name:hover {
  border-color: rgba(97, 216, 210, 0.28);
}

.project-name:focus {
  border-color: rgba(97, 216, 210, 0.72);
  background: rgba(3, 5, 7, 0.6);
  outline: none;
  box-shadow: 0 0 0 1px rgba(97, 216, 210, 0.14);
}

.project-block,
.shell-action-slots {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  padding: 0 2px;
}

.auth-block {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  min-width: 0;
}

.auth-signin,
.auth-user button,
.project-actions button {
  min-height: 0;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--cyan);
  box-shadow: none;
  font: 800 12px/1 "Courier New", monospace;
  opacity: 0.86;
  white-space: nowrap;
}

.auth-signin:hover,
.auth-user button:hover,
.project-actions button:hover {
  color: var(--yellow);
  opacity: 1;
}

.auth-user {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  min-width: 0;
}

.auth-user span {
  max-width: 260px;
  overflow: hidden;
  color: var(--text);
  font: 800 12px/1 "Courier New", monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-user-actions,
.project-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.loop-workspace {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) 56px;
  overflow: hidden;
}

.loop-settings {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(97, 216, 210, 0.18);
}

.upload-button input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.add-actions-stack {
  width: 132px;
  height: 58px;
  display: grid;
  grid-template-rows: repeat(2, 1fr);
  gap: 6px;
  align-self: stretch;
}

.add-actions-stack .upload-button,
.add-actions-stack .settings-button {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.add-actions-stack .upload-button span,
.add-actions-stack .settings-button {
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding-inline: 8px;
  font-size: 10px;
}

.select-actions-stack {
  width: 196px;
  height: 58px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, 1fr);
  gap: 6px;
  align-self: stretch;
}

.select-actions-stack .resolution-control,
.select-actions-stack .prompt-scope-control,
.select-actions-stack select {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.select-actions-stack select {
  padding: 0 20px 0 9px;
  font-size: 10px;
}

.upload-button span,
.settings-button,
.primary-action,
.row-action,
.icon-link,
.project-prompt-inline,
.resolution-control select,
.image-manager-actions button,
.image-manager-mini-actions button,
.image-manager-assets-head button,
.image-asset-actions button,
.prompt-modal footer button,
.events-modal footer button,
.video-modal footer a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  border: 1px solid rgba(97, 216, 210, 0.45);
  border-radius: 5px;
  background: rgba(11, 16, 20, 0.68);
  color: var(--cyan);
  font: 800 12px/1 "Courier New", monospace;
  text-align: center;
  text-decoration: none;
}

.project-prompt-inline {
  width: clamp(190px, 18vw, 320px);
  min-width: 190px;
  min-height: 58px;
  max-height: 150px;
  display: block;
  align-self: stretch;
  resize: vertical;
  padding: 9px 11px;
  outline: none;
  text-align: left;
  line-height: 1.25;
}

.project-prompt-inline::placeholder {
  color: var(--cyan);
  opacity: 0.92;
}

.project-prompt-inline:focus {
  border-color: var(--yellow);
  color: var(--text);
}

.upload-button span {
  min-width: 104px;
  line-height: 1.35;
  white-space: normal;
}

.compact-button {
  min-width: 0;
  padding-inline: 10px;
}

.primary-action {
  min-width: 250px;
  border-color: rgba(243, 204, 88, 0.65);
  color: var(--yellow);
}

.upload-button span:hover,
.settings-button:hover,
.primary-action:hover,
.row-action:hover,
.icon-link:hover,
.resolution-control select:hover,
.image-manager-actions button:hover,
.image-manager-mini-actions button:hover,
.image-manager-assets-head button:hover,
.image-asset-actions button:hover,
.prompt-modal footer button:hover,
.events-modal footer button:hover,
.video-modal footer a:hover {
  border-color: var(--yellow);
  color: var(--yellow);
}

.duration-control {
  display: grid;
  grid-template-rows: auto auto;
  gap: 4px;
  color: var(--muted);
  font: 800 11px/1 "Courier New", monospace;
}

.duration-row {
  display: grid;
  grid-template-columns: 52px 150px 40px;
  align-items: center;
  column-gap: 4px;
}

.duration-row > span {
  white-space: nowrap;
}

.duration-control input[type="range"] {
  width: 150px;
  accent-color: var(--cyan);
}

.resolution-control {
  display: flex;
  align-items: center;
  gap: 0;
  color: var(--muted);
  font: 800 12px/1 "Courier New", monospace;
}

.prompt-scope-control {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font: 800 11px/1 "Courier New", monospace;
  white-space: nowrap;
}

.prompt-scope-control input {
  width: 16px;
  height: 16px;
  accent-color: var(--cyan);
}

.project-ref-button {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px dashed rgba(97, 216, 210, 0.58);
  border-radius: 5px;
  background: #030507;
  color: var(--cyan);
  font: 900 30px/1 "Courier New", monospace;
  overflow: hidden;
  cursor: pointer;
}

.project-ref-button.has-ref {
  border-style: solid;
  border-color: rgba(243, 204, 88, 0.58);
}

.project-ref-button img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
  background: #030507;
}

.resolution-control select {
  min-height: 34px;
  padding-right: 22px;
}

.select-actions-stack .resolution-control select {
  height: 26px;
  min-height: 0;
  padding: 0 20px 0 9px;
  font-size: 10px;
}

.select-actions-stack .prompt-scope-control {
  justify-content: flex-start;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--cyan);
}

.duration-control strong {
  width: auto;
  color: var(--text);
  text-align: left;
  white-space: nowrap;
}

.status-line {
  color: var(--muted);
  font: 800 12px/1 "Courier New", monospace;
}

.status-line {
  margin-left: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-list {
  min-height: 0;
  overflow: auto;
  padding: 12px;
}

.image-row {
  display: grid;
  grid-template-columns: max-content minmax(360px, 1fr) max-content;
  gap: 12px;
  align-items: center;
  min-height: 100px;
  padding: 10px;
  border-bottom: 1px solid rgba(64, 81, 92, 0.65);
}

.image-row:last-child {
  border-bottom: 0;
}

.image-row.is-working {
  background: rgba(97, 216, 210, 0.06);
}

.image-row.is-error {
  background: rgba(255, 107, 97, 0.06);
}

.source-pair {
  position: relative;
  display: grid;
  grid-template-columns: max-content 8px max-content;
  align-items: center;
}

.source-swap-anchor {
  position: relative;
  z-index: 3;
  width: 8px;
  height: 78px;
  display: block;
  pointer-events: none;
}

.source-thumb,
.video-thumb {
  height: 78px;
  display: block;
  border: 1px solid rgba(64, 81, 92, 0.9);
  border-radius: 5px;
  background: #07090b;
  object-fit: contain;
  object-position: center;
}

img.source-thumb,
img.video-thumb {
  width: auto;
  max-width: 156px;
}

.source-thumb-button {
  height: 78px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
}

.source-thumb-button:hover .source-thumb {
  border-color: var(--yellow);
}

.source-thumb-empty {
  width: 112px;
  height: 78px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font: 800 11px/1 "Courier New", monospace;
}

.source-thumb-add {
  padding: 0;
  border-style: solid;
  border-color: rgba(97, 216, 210, 0.55);
  color: var(--cyan);
  font-size: 34px;
  cursor: pointer;
}

.source-thumb-add:hover {
  border-color: var(--yellow);
  color: var(--yellow);
}

.source-swap-button {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  padding: 0;
  border: 1px solid rgba(97, 216, 210, 0.75);
  border-radius: 50%;
  background: rgba(3, 5, 7, 0.94);
  color: var(--cyan);
  font: 800 16px/1 "Courier New", monospace;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 0 0 2px rgba(18, 28, 35, 0.94);
}

.source-swap-button:hover {
  border-color: var(--yellow);
  color: var(--yellow);
}

.source-swap-button:disabled {
  opacity: 0.45;
  cursor: default;
}

.row-main {
  width: 100%;
  min-width: 0;
}

.row-name {
  overflow: hidden;
  color: var(--text);
  font: 800 14px/1.2 "Courier New", monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-created {
  margin-top: 5px;
  color: var(--muted);
  font: 800 11px/1 "Courier New", monospace;
}

.row-prompts {
  position: relative;
  width: 100%;
  height: 78px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.row-prompts label {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.row-prompts span {
  color: var(--muted);
  font: 800 10px/1 "Courier New", monospace;
}

.row-prompt {
  width: 100%;
  height: 78px;
  min-height: 78px;
  resize: none;
  padding: 7px 8px;
  border: 1px solid rgba(64, 81, 92, 0.85);
  border-radius: 5px;
  background: rgba(7, 9, 11, 0.72);
  color: var(--text);
  font: 12px/1.3 "Segoe UI", Arial, sans-serif;
  outline: none;
}

.row-prompt:focus {
  border-color: rgba(97, 216, 210, 0.7);
}

.prompt-swap-button {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  padding: 0;
  border: 1px solid rgba(97, 216, 210, 0.75);
  border-radius: 50%;
  background: rgba(3, 5, 7, 0.94);
  color: var(--cyan);
  font: 800 16px/1 "Courier New", monospace;
  cursor: pointer;
  box-shadow: 0 0 0 2px rgba(18, 28, 35, 0.94);
}

.prompt-swap-button:hover {
  border-color: var(--yellow);
  color: var(--yellow);
}

.prompt-swap-button:disabled {
  opacity: 0.45;
  cursor: default;
}

.row-meta,
.row-progress {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.image-row.is-error .row-meta {
  color: var(--red);
}

.row-progress-bar {
  width: min(360px, 100%);
  height: 5px;
  margin-top: 8px;
  border-radius: 999px;
  background: rgba(64, 81, 92, 0.75);
  overflow: hidden;
}

.row-progress-bar span {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--cyan);
}

.row-actions {
  width: 218px;
  height: 78px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, 35px);
  gap: 8px;
  align-content: center;
  justify-content: end;
}

.row-actions .row-action,
.row-actions .icon-link {
  width: 100%;
  min-height: 0;
  height: 35px;
  padding: 0 5px;
  font-size: 11px;
}

.row-delete {
  border-color: rgba(255, 107, 97, 0.52);
  color: var(--red);
}

.row-delete:hover {
  border-color: var(--red);
  color: #ffb0aa;
}

.row-generation-progress {
  width: 230px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font: 800 12px/1.15 "Courier New", monospace;
}

.row-generation-progress strong {
  color: var(--cyan);
}

.row-generation-progress span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-generation-progress .row-progress-bar {
  grid-column: 1 / -1;
  width: 100%;
  margin-top: 0;
}

.video-cell {
  min-width: 0;
  display: grid;
  grid-template-columns: max-content 8px max-content max-content;
  column-gap: 0;
  row-gap: 8px;
  align-items: center;
  justify-content: end;
}

.video-cell .loop-video-slot:nth-last-child(1) {
  margin-left: 8px;
}

.video-swap-anchor {
  position: relative;
  z-index: 3;
  width: 8px;
  height: 78px;
  display: block;
  pointer-events: none;
}

.video-swap-button {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  padding: 0;
  border: 1px solid rgba(97, 216, 210, 0.75);
  border-radius: 50%;
  background: rgba(3, 5, 7, 0.94);
  color: var(--cyan);
  font: 800 16px/1 "Courier New", monospace;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 0 0 2px rgba(18, 28, 35, 0.94);
}

.video-swap-button:hover {
  border-color: var(--yellow);
  color: var(--yellow);
}

.image-row.is-working .video-swap-button {
  display: none;
}

.loop-video-slot {
  position: relative;
}

.video-thumb-button {
  position: relative;
  height: 78px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
}

.loop-video-slot .video-thumb-button,
.loop-video-slot.video-empty {
  width: 112px;
}

.loop-video-slot .video-thumb {
  width: 112px;
  object-fit: contain;
}

.video-thumb {
  border-color: rgba(148, 223, 105, 0.55);
  cursor: pointer;
}

.video-play-mark {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.video-play-mark::before {
  content: "";
  width: 0;
  height: 0;
  margin-left: 2px;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  border-left: 17px solid rgba(255, 255, 255, 0.72);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.55));
}

.video-thumb-button:hover .video-thumb {
  border-color: var(--yellow);
}

.video-slot-action {
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 2;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border: 1px solid rgba(97, 216, 210, 0.58);
  border-radius: 5px;
  background: rgba(3, 5, 7, 0.88);
  color: var(--cyan);
  font: 800 9px/1 "Courier New", monospace;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.34);
}

.video-slot-action:hover {
  border-color: var(--yellow);
  color: var(--yellow);
}

.video-slot-action:disabled {
  border-color: rgba(64, 81, 92, 0.64);
  color: rgba(155, 173, 169, 0.48);
  cursor: not-allowed;
  box-shadow: none;
}

.video-progress-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  grid-template-rows: 1fr auto auto 1fr;
  place-items: center;
  gap: 5px;
  padding: 8px;
  border-radius: 5px;
  background: rgba(3, 5, 7, 0.96);
  color: var(--muted);
  pointer-events: none;
  text-align: center;
  font: 800 9px/1.05 "Courier New", monospace;
}

.video-progress-overlay strong {
  grid-row: 2;
  color: var(--yellow);
  font-size: 16px;
}

.video-progress-overlay span {
  grid-row: 3;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-progress-overlay i {
  grid-row: 4;
  align-self: start;
  width: 82%;
  height: 4px;
  display: block;
  border-radius: 999px;
  background: rgba(64, 81, 92, 0.78);
  overflow: hidden;
}

.video-progress-overlay b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--cyan);
}

.video-part-empty {
  position: relative;
}

.video-part-add {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 800 10px/1 "Courier New", monospace;
  cursor: pointer;
}

.video-part-add:hover {
  color: var(--yellow);
}

.video-thumb-empty {
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--green);
  font: 800 11px/1 "Courier New", monospace;
}

.video-empty {
  width: 112px;
  height: 78px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(64, 81, 92, 0.85);
  border-radius: 5px;
  color: var(--muted);
  font: 800 11px/1 "Courier New", monospace;
}

.video-empty-action {
  cursor: pointer;
  background: rgba(7, 9, 11, 0.52);
}

.video-empty-action:hover {
  border-color: var(--yellow);
  color: var(--yellow);
}

.bulk-actions {
  min-height: 0;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 14px;
  border-top: 1px solid rgba(97, 216, 210, 0.18);
  overflow: hidden;
}

.project-health {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
  color: var(--muted);
  font: 800 11px/1 "Courier New", monospace;
  white-space: nowrap;
  overflow: hidden;
}

.project-health span {
  flex: 0 0 auto;
  padding: 5px 7px;
  border: 1px solid rgba(64, 81, 92, 0.75);
  border-radius: 4px;
  background: rgba(7, 9, 11, 0.46);
}

.project-health [data-health="running"] {
  color: var(--cyan);
  border-color: rgba(97, 216, 210, 0.45);
}

.project-health [data-health="done"] {
  color: var(--green);
  border-color: rgba(148, 223, 105, 0.42);
}

.project-health [data-health="warning"] {
  color: var(--yellow);
  border-color: rgba(243, 204, 88, 0.45);
  cursor: pointer;
}

.project-health [data-health="error"] {
  color: var(--red);
  border-color: rgba(255, 107, 97, 0.48);
  cursor: pointer;
}

.project-health [data-health="warning"]:hover,
.project-health [data-health="warning"]:focus-visible {
  border-color: var(--yellow);
  box-shadow: 0 0 0 1px rgba(243, 204, 88, 0.22);
}

.project-health [data-health="error"]:hover,
.project-health [data-health="error"]:focus-visible {
  border-color: var(--red);
  box-shadow: 0 0 0 1px rgba(255, 107, 97, 0.22);
}

.video-modal,
.image-preview-modal,
.prompt-modal,
.events-modal,
.image-manager-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
}

.image-preview-modal {
  z-index: 80;
}

.video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}

.video-modal-panel,
.image-preview-panel,
.prompt-modal-panel,
.events-modal-panel,
.image-manager-panel {
  position: relative;
  width: min(920px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border: 1px solid var(--grid2);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65);
}

.project-ref-panel {
  position: relative;
  width: min(760px, calc(100vw - 40px));
  max-height: calc(100vh - 48px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid var(--grid2);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65);
}

.project-ref-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
}

.project-ref-panel header strong {
  font: 800 13px/1 "Courier New", monospace;
}

.project-ref-panel header button {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(97, 216, 210, 0.42);
  border-radius: 4px;
  background: transparent;
  color: var(--cyan);
  font: 800 22px/0 Arial, sans-serif;
}

.project-ref-body {
  min-height: 0;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  overflow: hidden;
}

.video-asset-panel {
  width: min(900px, calc(100vw - 40px));
  height: min(760px, calc(100vh - 64px));
}

.video-asset-body {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  overflow: hidden;
}

.video-asset-toolbar {
  display: flex;
  justify-content: flex-start;
}

.video-asset-toolbar button {
  min-height: 34px;
  padding: 0 16px;
  border: 1px solid rgba(97, 216, 210, 0.58);
  border-radius: 5px;
  background: rgba(3, 5, 7, 0.72);
  color: var(--cyan);
  font: 800 12px/1 "Courier New", monospace;
  box-shadow: none;
}

.video-asset-toolbar button:hover,
.video-asset-toolbar button:focus {
  border-color: var(--yellow);
  color: var(--yellow);
}

#videoAssetList {
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
}

.project-ref-preview {
  position: relative;
  width: 220px;
  height: 220px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(64, 81, 92, 0.86);
  border-radius: 5px;
  background: #030507;
  color: var(--cyan);
  font: 900 42px/1 "Courier New", monospace;
  overflow: hidden;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(3, 5, 7, 0.8);
}

.project-ref-preview:hover,
.project-ref-preview:focus {
  border-color: rgba(97, 216, 210, 0.72);
  outline: none;
}

.project-ref-preview img {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  object-position: center;
  background: #030507;
}

.project-ref-body .dialog-error {
  grid-column: 1;
}

.project-ref-assets {
  grid-column: 2;
  grid-row: 1 / span 3;
}

.video-modal-panel header,
.image-preview-panel header,
.video-modal-panel footer,
.prompt-modal-panel header,
.prompt-modal-panel footer,
.events-modal-panel header,
.events-modal-panel footer,
.image-manager-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
}

.video-modal-panel header strong,
.image-preview-panel header strong,
.prompt-modal-panel header strong,
.events-modal-panel header strong,
.image-manager-panel header strong {
  overflow: hidden;
  font: 800 13px/1 "Courier New", monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-modal-panel header button,
.image-preview-panel header button,
.prompt-modal-panel header button,
.events-modal-panel header button,
.image-manager-panel header > button {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(97, 216, 210, 0.42);
  border-radius: 4px;
  background: transparent;
  color: var(--cyan);
  font: 800 22px/0 Arial, sans-serif;
}

.video-modal video {
  width: 100%;
  max-height: calc(100vh - 150px);
  background: #000;
}

.image-preview-panel {
  width: min(calc(100vw - 32px), 1280px);
  height: min(calc(100vh - 32px), 920px);
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: linear-gradient(180deg, rgba(17, 24, 32, 0.98), rgba(5, 7, 9, 0.98));
}

.image-preview-panel img {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: block;
  object-fit: contain;
  object-position: center;
  background: #000;
}

.video-modal-panel footer {
  justify-content: flex-start;
}

.video-modal-panel footer a,
.video-modal-panel footer button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid rgba(97, 216, 210, 0.56);
  border-radius: 5px;
  background: transparent;
  color: var(--cyan);
  font: 800 12px/1 "Courier New", monospace;
  text-decoration: none;
}

.video-modal-panel footer a:hover,
.video-modal-panel footer button:hover,
.video-modal-panel footer a:focus,
.video-modal-panel footer button:focus {
  border-color: var(--yellow);
  color: var(--yellow);
}

.video-modal-panel footer button:disabled {
  border-color: rgba(64, 81, 92, 0.64);
  color: rgba(155, 173, 169, 0.48);
  cursor: not-allowed;
}

.prompt-modal-panel {
  width: min(720px, calc(100vw - 36px));
}

.prompt-modal-panel textarea {
  width: calc(100% - 24px);
  min-height: 190px;
  margin: 0 12px 12px;
  resize: vertical;
  padding: 10px;
  border: 1px solid rgba(64, 81, 92, 0.9);
  border-radius: 5px;
  background: rgba(7, 9, 11, 0.82);
  color: var(--text);
  font: 13px/1.4 "Segoe UI", Arial, sans-serif;
  outline: none;
}

.prompt-modal-panel textarea:focus {
  border-color: rgba(97, 216, 210, 0.7);
}

.prompt-modal-panel footer {
  justify-content: flex-end;
}

.events-modal-panel {
  width: min(820px, calc(100vw - 36px));
}

.image-manager-panel {
  width: min(1180px, calc(100vw - 48px));
  height: calc(100vh - 48px);
  min-height: 720px;
  max-height: calc(100vh - 48px);
  background:
    linear-gradient(180deg, rgba(19, 27, 33, 0.98), rgba(10, 15, 19, 0.98));
}

.image-manager-panel header > div {
  min-width: 0;
}

.image-manager-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 16px;
  padding: 14px;
  overflow: hidden;
}

.image-manager-compose,
.image-manager-assets {
  min-height: 0;
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(64, 81, 92, 0.52);
  border-radius: 6px;
  background: rgba(4, 7, 9, 0.28);
}

.image-manager-compose {
  grid-template-rows: minmax(150px, 1fr) minmax(150px, 1.28fr) minmax(150px, 1fr) auto;
  align-content: stretch;
}

.image-manager-assets {
  grid-template-rows: auto minmax(0, 1fr);
  align-content: start;
}

.image-manager-compose label,
.image-manager-current,
.image-manager-reference {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 7px;
}

.image-manager-compose label {
  color: var(--muted);
  font: 800 12px/1 "Courier New", monospace;
}

.image-manager-compose textarea {
  width: 100%;
  height: 100%;
  min-height: 0;
  resize: none;
  padding: 10px;
  border: 1px solid rgba(64, 81, 92, 0.9);
  border-radius: 5px;
  background: rgba(7, 9, 11, 0.82);
  color: var(--text);
  font: 13px/1.4 "Segoe UI", Arial, sans-serif;
  outline: none;
}

.image-manager-compose textarea:focus {
  border-color: rgba(97, 216, 210, 0.7);
}

.manager-section-title {
  color: var(--muted);
  font: 800 12px/1 "Courier New", monospace;
}

.image-current-box {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(64, 81, 92, 0.86);
  border-radius: 5px;
  background: #030507;
  color: var(--muted);
  font: 800 12px/1 "Courier New", monospace;
  overflow: hidden;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(3, 5, 7, 0.8);
}

.image-current-box:hover,
.image-current-box:focus,
.image-reference-box:hover,
.image-reference-box:focus {
  border-color: rgba(97, 216, 210, 0.72);
  outline: none;
}

.image-current-box.is-working {
  cursor: progress;
}

.image-current-box img,
.image-reference-box img {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: block;
  object-fit: contain;
  object-position: center;
  background: #030507;
}

.image-current-empty {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(97, 216, 210, 0.42);
  background: #030507;
}

.image-current-empty span {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(97, 216, 210, 0.58);
  border-radius: 5px;
  color: var(--cyan);
  font: 800 36px/1 Arial, sans-serif;
}

.image-frame-action {
  position: absolute;
  z-index: 2;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border: 1px solid rgba(97, 216, 210, 0.56);
  border-radius: 5px;
  background: rgba(3, 5, 7, 0.88);
  color: var(--cyan);
  font: 800 11px/1 "Courier New", monospace;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.34);
}

.image-frame-action:hover,
.image-frame-action:focus {
  border-color: var(--yellow);
  color: var(--yellow);
}

.image-frame-action:disabled {
  border-color: rgba(64, 81, 92, 0.64);
  color: rgba(155, 173, 169, 0.48);
  cursor: not-allowed;
  box-shadow: none;
}

.image-current-box.is-working .image-frame-action {
  opacity: 0.35;
  pointer-events: none;
}

.image-frame-progress {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 20px;
  background: rgba(3, 5, 7, 0.82);
  color: var(--cyan);
  text-align: center;
  font: 800 12px/1 "Courier New", monospace;
}

.image-frame-progress strong {
  color: var(--yellow);
  font: 800 24px/1 "Courier New", monospace;
}

.image-frame-progress span {
  color: var(--muted);
}

.image-frame-progress div {
  width: min(220px, 72%);
  height: 6px;
  border-radius: 999px;
  background: rgba(64, 81, 92, 0.72);
  overflow: hidden;
}

.image-frame-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--cyan);
}

.image-frame-clear {
  top: 8px;
  left: 8px;
}

.image-frame-upload {
  bottom: 8px;
  left: 8px;
}

.image-frame-generate {
  right: 8px;
  bottom: 8px;
}

.image-reference-box {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(64, 81, 92, 0.86);
  border-radius: 5px;
  background: #030507;
  overflow: hidden;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(3, 5, 7, 0.8);
}

.image-manager-mini-actions,
.image-manager-actions,
.image-manager-assets-head,
.image-asset-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.image-manager-actions {
  width: 100%;
  align-items: stretch;
  justify-content: stretch;
}

.image-manager-actions button {
  flex: 1 1 0;
  min-height: 38px;
}

.image-manager-assets-head {
  justify-content: space-between;
}

.image-manager-assets-head > div {
  display: grid;
  gap: 4px;
}

.image-manager-assets-head span {
  color: var(--muted);
  font: 800 11px/1.25 "Courier New", monospace;
}

.image-assets-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  align-content: start;
  align-items: start;
  justify-items: start;
  gap: 12px;
  overflow: auto;
  padding-right: 3px;
}

.asset-picker-empty {
  grid-column: 1 / -1;
  min-height: 220px;
  display: grid;
  align-content: center;
  place-items: center;
  gap: 8px;
  border: 1px dashed rgba(64, 81, 92, 0.75);
  border-radius: 5px;
  color: var(--muted);
  font: 800 12px/1 "Courier New", monospace;
}

.asset-picker-empty strong {
  color: var(--cyan);
}

.asset-picker-empty span {
  color: var(--muted);
  font: 800 11px/1.25 "Courier New", monospace;
}

.image-asset-card {
  width: 100%;
  display: grid;
  grid-template-rows: 118px auto auto;
  gap: 7px;
  padding: 8px;
  border: 1px solid rgba(64, 81, 92, 0.82);
  border-radius: 5px;
  background: rgba(7, 9, 11, 0.46);
}

.image-asset-card img {
  width: 100%;
  height: 118px;
  display: block;
  object-fit: contain;
  object-position: center;
  border-radius: 4px;
  background: #000;
}

.image-asset-card video {
  width: 100%;
  height: 118px;
  object-fit: contain;
  border-radius: 4px;
  background: #000;
}

.image-asset-meta {
  overflow: hidden;
  color: var(--text);
  font: 800 11px/1.2 "Courier New", monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-asset-actions {
  justify-content: space-between;
}

.image-asset-actions button {
  flex: 1 1 0;
  min-height: 28px;
  padding: 0 8px;
  font-size: 11px;
}

.events-list {
  max-height: min(520px, calc(100vh - 160px));
  overflow: auto;
  padding: 0 12px 12px;
}

.events-empty {
  display: grid;
  place-items: center;
  min-height: 130px;
  color: var(--muted);
  font: 800 12px/1 "Courier New", monospace;
}

.event-row {
  display: grid;
  grid-template-columns: 138px 72px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 9px 0;
  border-bottom: 1px solid rgba(64, 81, 92, 0.55);
  color: var(--muted);
  font-size: 12px;
}

.event-row strong {
  color: var(--cyan);
  font: 800 11px/1.2 "Courier New", monospace;
}

.event-row span {
  color: var(--text);
}

.event-warning strong {
  color: var(--yellow);
}

.event-error strong {
  color: var(--red);
}

.event-done strong {
  color: var(--green);
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 36px));
  pointer-events: none;
}

.toast {
  padding: 10px 12px;
  border: 1px solid rgba(97, 216, 210, 0.42);
  border-radius: 5px;
  background: rgba(7, 9, 11, 0.94);
  color: var(--text);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.42);
  font: 800 12px/1.35 "Courier New", monospace;
}

.toast-warning {
  border-color: rgba(243, 204, 88, 0.62);
  color: var(--yellow);
}

.toast-error {
  border-color: rgba(255, 107, 97, 0.68);
  color: var(--red);
}

.toast-done {
  border-color: rgba(148, 223, 105, 0.62);
  color: var(--green);
}

.manager-dialog {
  width: min(1120px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 1px solid var(--grid2);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65);
}

.manager-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.manager-dialog form {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 10px;
  max-height: calc(100vh - 32px);
  padding: 12px;
}

.manager-dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.manager-dialog header strong {
  color: var(--cyan);
  font: 900 18px/1 "Courier New", monospace;
}

.manager-dialog header button,
.manager-dialog button,
.manager-table select {
  border: 1px solid rgba(97, 216, 210, 0.42);
  border-radius: 5px;
  background: rgba(7, 9, 11, 0.76);
  color: var(--cyan);
  font: 800 12px/1 "Courier New", monospace;
}

.manager-dialog header button {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  font: 800 22px/0 Arial, sans-serif;
}

.manager-dialog button {
  min-height: 34px;
  padding: 0 12px;
}

.dialog-error {
  padding: 10px 12px;
  border: 1px solid rgba(255, 107, 97, 0.65);
  border-radius: 5px;
  color: var(--red);
  background: rgba(255, 107, 97, 0.08);
  font: 800 12px/1.35 "Courier New", monospace;
}

.manager-search,
.feedback-manager-dialog textarea {
  width: 100%;
  min-height: 38px;
  padding: 9px 10px;
  border: 1px solid rgba(64, 81, 92, 0.9);
  border-radius: 5px;
  background: rgba(7, 9, 11, 0.82);
  color: var(--text);
  outline: none;
}

.manager-search:focus,
.feedback-manager-dialog textarea:focus {
  border-color: rgba(97, 216, 210, 0.7);
}

.manager-table-wrap {
  overflow: auto;
  border: 1px solid rgba(64, 81, 92, 0.72);
  border-radius: 5px;
}

.manager-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.manager-table th,
.manager-table td {
  padding: 10px;
  border-bottom: 1px solid rgba(64, 81, 92, 0.55);
  text-align: left;
  vertical-align: middle;
}

.manager-table th {
  color: var(--muted);
  font: 800 11px/1 "Courier New", monospace;
  text-transform: uppercase;
}

.manager-table td strong,
.feedback-list-item strong {
  color: var(--text);
  font: 800 13px/1.25 "Courier New", monospace;
}

.manager-table small,
.feedback-list-item span,
.feedback-list-item small {
  color: var(--muted);
}

.manager-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feedback-manager-dialog {
  width: min(980px, calc(100vw - 32px));
}

.feedback-tabs,
.feedback-mini-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.feedback-tabs button.is-active {
  border-color: var(--yellow);
  color: var(--yellow);
}

.feedback-manager-dialog textarea {
  min-height: 160px;
  resize: vertical;
  font: 13px/1.45 "Segoe UI", Arial, sans-serif;
}

#submitFeedbackButton {
  width: min(220px, 100%);
  border-color: var(--yellow);
  color: var(--yellow);
}

.feedback-grid {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 10px;
  min-height: 360px;
}

.feedback-list,
.feedback-reader {
  min-height: 360px;
  overflow: auto;
  border: 1px solid rgba(64, 81, 92, 0.72);
  border-radius: 5px;
  background: rgba(7, 9, 11, 0.34);
}

.feedback-list {
  display: grid;
  align-content: start;
}

.feedback-list-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px;
  border: 0;
  border-bottom: 1px solid rgba(64, 81, 92, 0.55);
  border-radius: 0;
  text-align: left;
}

.feedback-list-item.is-unread strong {
  color: var(--yellow);
}

.feedback-empty,
.feedback-reader {
  padding: 12px;
  color: var(--muted);
}

.feedback-reader header,
.feedback-reader footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.feedback-reader dl {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 5px 10px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
}

.feedback-reader dd,
.feedback-reader dt,
.feedback-reader p {
  margin: 0;
}

.feedback-reader p {
  color: var(--text);
  line-height: 1.45;
}

.feedback-attachment {
  display: inline-grid;
  place-items: center;
  min-height: 34px;
  margin-top: 12px;
  padding: 0 12px;
  border: 1px solid rgba(97, 216, 210, 0.42);
  border-radius: 5px;
  color: var(--cyan);
  text-decoration: none;
  font: 800 12px/1 "Courier New", monospace;
}

.project-dialog {
  width: min(440px, calc(100vw - 36px));
  padding: 10px;
  border: 1px solid rgba(97, 216, 210, 0.62);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(17, 24, 32, 0.98), rgba(9, 13, 17, 0.98));
  color: var(--text);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65);
}

.project-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.project-dialog form {
  display: grid;
  gap: 10px;
}

.project-dialog .dialog-title {
  color: var(--yellow);
  font: 900 18px/1 "Courier New", monospace;
}

.project-dialog label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font: 800 12px/1 "Courier New", monospace;
}

.project-dialog input,
.project-search {
  width: 100%;
  min-height: 32px;
  padding: 7px 9px;
  border: 1px solid rgba(64, 81, 92, 0.9);
  border-radius: 4px;
  background: rgba(7, 9, 11, 0.82);
  color: var(--text);
  outline: none;
}

.project-dialog input:focus,
.project-search:focus {
  border-color: rgba(97, 216, 210, 0.7);
}

.project-dialog .dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.project-dialog .dialog-actions button,
.project-list-item {
  border: 1px solid rgba(97, 216, 210, 0.42);
  border-radius: 4px;
  background: rgba(7, 9, 11, 0.76);
  color: var(--cyan);
  font: 800 12px/1 "Courier New", monospace;
}

.project-dialog .dialog-actions button {
  min-height: 30px;
  padding: 0 12px;
}

#openProjectDialog {
  width: min(560px, calc(100vw - 36px));
  min-width: min(560px, calc(100vw - 36px));
  height: min(620px, calc(100vh - 44px));
}

#openProjectDialog form {
  position: relative;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  height: 100%;
  overflow: hidden;
  padding-bottom: 40px;
}

#openProjectDialog .dialog-actions {
  position: absolute;
  right: 0;
  bottom: 0;
  padding: 0;
  margin: 0;
}

.project-list {
  display: grid;
  align-content: start;
  gap: 5px;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

.project-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  width: 100%;
}

.project-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  min-width: 0;
  min-height: 46px;
  padding: 0 9px;
  color: var(--text);
  text-align: left;
  overflow: hidden;
}

.project-list-item.has-thumbnail {
  grid-template-columns: 46px minmax(0, 1fr);
  column-gap: 12px;
  padding-left: 0;
}

.project-list-avatar {
  align-self: center;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-right: 1px solid rgba(64, 81, 92, 0.8);
  background: rgba(5, 8, 10, 0.72);
}

.project-list-avatar.is-empty {
  background: #050708;
}

.project-list-text {
  display: grid;
  gap: 3px;
  align-content: center;
  min-width: 0;
  padding: 6px 0;
}

.project-list-title-row {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.project-list-title,
.project-list-item small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-list-item small,
.project-list-empty {
  color: var(--muted);
  font: 11px/1.2 "Courier New", monospace;
}

.project-list-empty {
  padding: 10px;
  border: 1px solid var(--grid2);
  border-radius: 4px;
  background: rgba(11, 16, 20, 0.7);
}

.project-list-item:hover {
  border-color: var(--yellow);
  color: var(--yellow);
}

.users-dialog {
  width: min(980px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
}

.users-dialog form {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 10px;
  max-height: calc(100vh - 52px);
}

.users-table-wrap {
  min-height: 0;
  overflow: auto;
  border: 1px solid rgba(64, 81, 92, 0.72);
  border-radius: 5px;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text);
  font: 800 11px/1.25 "Courier New", monospace;
}

.users-table th,
.users-table td {
  padding: 8px;
  border-bottom: 1px solid rgba(64, 81, 92, 0.55);
  text-align: left;
  vertical-align: middle;
}

.users-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel);
  color: var(--muted);
}

.users-table select,
.users-actions button,
.user-email-button,
.users-delete-button {
  min-height: 28px;
  border: 1px solid rgba(97, 216, 210, 0.42);
  border-radius: 4px;
  background: rgba(7, 9, 11, 0.76);
  color: var(--cyan);
  font: 800 11px/1 "Courier New", monospace;
}

.users-table select {
  width: 100%;
}

.user-email-button {
  max-width: 220px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.users-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.users-actions button,
.users-delete-button {
  padding: 0 8px;
}

.users-delete-button {
  border-color: rgba(255, 107, 97, 0.62);
  color: var(--red);
}

.users-table button:hover,
.users-table select:hover {
  border-color: var(--yellow);
  color: var(--yellow);
}

.users-table button:disabled,
.users-table select:disabled {
  opacity: 0.42;
  cursor: default;
}

.admin-projects-dialog {
  width: min(1080px, calc(100vw - 32px));
}

.admin-project-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.admin-project-actions {
  min-width: 210px;
}

.feedback-dialog {
  width: min(1120px, calc(100vw - 48px));
  border-color: rgba(230, 238, 238, 0.9);
}

.feedback-manager-dialog form {
  display: flex;
  flex-direction: column;
  grid-template-rows: none;
  min-height: min(760px, calc(100vh - 72px));
  gap: 14px;
  padding: 16px;
}

.confirm-dialog {
  width: min(440px, calc(100vw - 32px));
  border-color: rgba(97, 216, 210, 0.62);
  background: linear-gradient(180deg, rgba(17, 24, 32, 0.98), rgba(9, 13, 17, 0.98));
}

.confirm-dialog form {
  grid-template-rows: auto auto auto auto;
  gap: 10px;
  padding: 14px 16px 16px;
}

.confirm-dialog header {
  padding-bottom: 4px;
}

.confirm-dialog header strong {
  color: var(--yellow);
  font: 900 18px/1 "Courier New", monospace;
}

.confirm-dialog-message {
  color: var(--muted);
  font: 800 12px/1.35 "Courier New", monospace;
  white-space: pre-line;
}

.confirm-dialog-input,
.confirm-dialog-select {
  min-height: 38px;
  padding: 0 34px 0 10px;
  border-color: rgba(97, 216, 210, 0.58);
  background-color: rgba(3, 5, 7, 0.78);
  color: var(--text);
  font: 800 13px/1 "Courier New", monospace;
}

.confirm-dialog-select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--cyan) 50%),
    linear-gradient(135deg, var(--cyan) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 16px,
    calc(100% - 12px) 16px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.confirm-dialog-input:focus,
.confirm-dialog-select:focus {
  border-color: var(--yellow);
  outline: none;
}

.confirm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

.confirm-dialog-actions button {
  min-width: 104px;
  min-height: 34px;
}

#confirmDialogOkButton.is-danger {
  border-color: rgba(255, 107, 97, 0.76);
  color: var(--red);
}

#confirmDialogOkButton.is-primary {
  border-color: rgba(255, 221, 85, 0.82);
  color: var(--yellow);
}

.feedback-head {
  display: flex;
  align-items: baseline;
  gap: 24px;
}

.feedback-head .dialog-title {
  color: var(--yellow);
  font: 900 18px/1 "Courier New", monospace;
}

.feedback-tabs {
  display: flex;
  gap: 12px;
  align-items: center;
}

.feedback-tabs button,
.feedback-toolbar button,
.feedback-dropzone button {
  height: 28px;
  min-height: 28px;
  min-width: max-content;
  padding: 0 9px;
  border: 1px solid rgba(97, 216, 210, 0.55);
  border-radius: 4px;
  background: rgba(11, 16, 20, 0.86);
  color: var(--cyan);
  box-shadow: none;
  font: 800 11px/1 "Courier New", monospace;
  white-space: nowrap;
  cursor: pointer;
}

.feedback-tabs button {
  height: 18px;
  min-height: 18px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(177, 232, 225, 0.62);
}

.feedback-tabs button.is-active {
  color: var(--yellow);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.feedback-pane {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow: auto;
}

#feedbackSendPane label {
  flex: 0 1 42%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 8px;
  color: var(--muted);
  font: 800 13px/1 "Courier New", monospace;
}

#feedbackTextInput {
  flex: 1 1 auto;
  min-height: 240px;
  height: auto;
  resize: vertical;
  font: 13px/1.45 "Segoe UI", Arial, sans-serif;
}

.feedback-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.feedback-toolbar .reference-option {
  flex: 0 0 auto;
  min-width: max-content;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 800 12px/1 "Courier New", monospace;
}

.feedback-dropzone span {
  overflow: hidden;
  color: var(--muted);
  font: 800 11px/1 "Courier New", monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feedback-dropzone {
  position: relative;
  flex: 1 1 180px;
  display: grid;
  place-items: center;
  min-height: 260px;
  border: 1px dashed rgba(97, 216, 210, 0.5);
  border-radius: 4px;
  background: rgba(4, 7, 9, 0.54);
  color: var(--muted);
  font: 800 12px/1 "Courier New", monospace;
  cursor: pointer;
  overflow: hidden;
}

.feedback-dropzone:hover,
.feedback-dropzone.is-dragging {
  border-color: var(--yellow);
  color: var(--yellow);
  background: rgba(37, 31, 12, 0.28);
}

.feedback-dropzone img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 360px;
  object-fit: contain;
}

.feedback-image-clear {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
}

.feedback-image-attach {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 2;
}

#feedbackImageName {
  position: absolute;
  right: 10px;
  bottom: 15px;
  max-width: calc(100% - 150px);
}

.feedback-toolbar .manager-search {
  flex: 1 1 auto;
  min-width: 180px;
}

.feedback-toolbar .feedback-user-filter {
  flex: 0 1 190px;
  min-width: 140px;
}

.feedback-grid {
  flex: 1 1 auto;
  grid-template-columns: minmax(260px, 0.9fr) minmax(360px, 1.2fr);
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.feedback-list,
.feedback-reader,
.feedback-reports {
  min-height: 0;
  overflow: auto;
  border: 1px solid rgba(79, 101, 114, 0.72);
  border-radius: 4px;
  background: rgba(11, 16, 20, 0.56);
}

.feedback-reader {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
}

.feedback-list-item.is-selected,
.feedback-list-item:hover {
  background: rgba(97, 216, 210, 0.09);
}

.feedback-list-item.is-new strong::before {
  content: "NEW ";
  color: var(--yellow);
}

.feedback-reader-empty,
.feedback-empty {
  display: grid;
  place-items: center;
  min-height: 120px;
  color: var(--muted);
  font: 800 12px/1 "Courier New", monospace;
}

.feedback-reader-meta {
  color: var(--yellow);
  font: 800 11px/1.35 "Courier New", monospace;
  overflow-wrap: anywhere;
}

.feedback-reader-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text);
  font: 13px/1.45 "Segoe UI", Arial, sans-serif;
}

.feedback-attachment img {
  display: block;
  max-width: min(100%, 520px);
  max-height: 320px;
  border: 1px solid rgba(97, 216, 210, 0.34);
  border-radius: 4px;
  object-fit: contain;
}

.feedback-reader-actions {
  margin-top: auto;
  display: flex;
  justify-content: flex-end;
}

.feedback-reader-actions button {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(255, 107, 97, 0.62);
  border-radius: 4px;
  background: rgba(22, 8, 9, 0.9);
  color: #ff9b94;
  box-shadow: none;
  font: 800 11px/1 "Courier New", monospace;
  cursor: pointer;
}

.feedback-reports {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
}

.feedback-report {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(97, 216, 210, 0.28);
  border-radius: 4px;
  background: rgba(5, 8, 10, 0.58);
}

.feedback-report strong {
  color: var(--yellow);
  font: 800 11px/1.25 "Courier New", monospace;
}

.feedback-report pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text);
  font: 13px/1.45 "Segoe UI", Arial, sans-serif;
}

@media (max-width: 820px) {
  .transport {
    grid-template-columns: 1fr;
    padding-right: 36px;
  }

  .project-name,
  .auth-block {
    grid-column: 1;
    justify-self: start;
  }

  .loop-settings,
  .image-row {
    align-items: stretch;
  }

  .loop-settings {
    flex-wrap: wrap;
  }

  .status-line {
    width: 100%;
    margin-left: 0;
  }

  .resolution-control {
    width: 100%;
  }

  .image-row {
    grid-template-columns: max-content minmax(0, 1fr);
  }

  .source-thumb-empty,
  .video-empty {
    width: 92px;
    height: 64px;
  }

  .source-thumb,
  .video-thumb,
  .source-thumb-button,
  .video-thumb-button {
    height: 64px;
  }

  .source-swap-anchor {
    height: 64px;
  }

  .video-swap-anchor {
    height: 64px;
  }

  img.source-thumb,
  img.video-thumb {
    width: auto;
    max-width: 128px;
  }

  .video-cell {
    grid-column: 2 / 3;
    justify-content: flex-start;
  }

  .loop-video-slot .video-thumb-button,
  .loop-video-slot.video-empty,
  .loop-video-slot .video-thumb {
    width: 92px;
  }

  .row-prompts {
    grid-template-columns: 1fr;
    height: auto;
  }

  .row-prompt {
    height: 64px;
    min-height: 64px;
  }

  .feedback-grid {
    grid-template-columns: 1fr;
  }

  .manager-actions {
    min-width: 220px;
  }
}
