.home-touch-shell {
  min-height: 660px;
  color: var(--text);
}

.home-touch-shell.home-touch-embedded {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.home-touch-compact-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(225, 242, 226, 0.12);
  background: rgba(208, 255, 66, 0.08);
}

.home-touch-compact-heading h3,
.home-touch-compact-heading p,
.home-touch-popup-group h4 {
  margin: 0;
}

.home-touch-compact-heading h3 {
  color: var(--lime);
  font-size: 21px;
}

.home-touch-compact-heading p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.home-touch-compact-heading > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
}

.home-touch-pet-persona {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.8fr) minmax(0, 1.15fr);
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(225, 242, 226, 0.12);
  background: #030504;
}

.home-touch-pet-persona > div {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid rgba(225, 242, 226, 0.13);
  border-radius: 6px;
  background: rgba(225, 242, 226, 0.035);
}

.home-touch-pet-persona span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
}

.home-touch-pet-persona strong {
  color: var(--lime);
  font-size: 18px;
}

.home-touch-pet-persona p,
.home-touch-pet-persona small,
.home-touch-pet-persona ol {
  margin: 7px 0 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.65;
}

.home-touch-pet-persona small {
  display: block;
  color: var(--muted);
}

.home-touch-pet-persona ol {
  columns: 2;
  padding-left: 20px;
}

.home-touch-pet-persona li {
  padding-right: 14px;
  break-inside: avoid;
}

.home-touch-pet-persona-motion p {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.home-touch-pet-persona-motion i {
  padding: 3px 8px;
  border: 1px solid rgba(208, 255, 66, 0.3);
  border-radius: 999px;
  color: var(--lime);
  font-style: normal;
}

.pet-persona-render-style {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 4px 8px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(225, 242, 226, 0.12);
  font-size: 11px;
  line-height: 1.45;
}

.pet-persona-render-style b {
  color: var(--muted);
  font-weight: 600;
}

.pet-persona-render-style em {
  min-width: 0;
  color: var(--text);
  font-style: normal;
  overflow-wrap: anywhere;
}

.home-touch-queue-policy {
  display: grid;
  grid-template-columns: 150px 170px minmax(520px, 1fr);
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(225, 242, 226, 0.12);
  background: rgba(2, 6, 4, 0.9);
}

.home-touch-queue-policy > div {
  display: grid;
  gap: 4px;
  min-height: 54px;
  padding: 9px 11px;
  border: 1px solid rgba(225, 242, 226, 0.12);
  border-radius: 6px;
  background: rgba(225, 242, 226, 0.035);
}

.home-touch-queue-policy span {
  color: var(--muted);
  font-size: 11px;
}

.home-touch-queue-policy strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
}

.home-touch-queue-policy .queue-priority strong {
  color: var(--lime);
}

.home-touch-queue-policy p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.home-touch-queue-policy > .queue-rule-anchor {
  grid-column: 1 / -1;
  grid-template-columns: 132px minmax(230px, auto) 1fr auto;
  align-items: center;
  min-height: 44px;
  padding: 8px 10px;
  border-color: rgba(208, 255, 66, 0.34);
  background: rgba(208, 255, 66, 0.055);
}

.queue-rule-anchor strong {
  color: var(--lime);
  white-space: nowrap;
}

.queue-rule-anchor small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.queue-rule-anchor button {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid rgba(208, 255, 66, 0.52);
  border-radius: 6px;
  background: transparent;
  color: var(--lime);
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.queue-rule-anchor button:hover,
.queue-rule-anchor button:focus-visible {
  background: rgba(208, 255, 66, 0.12);
}

.home-touch-detail-fields .formal-rule-id-field strong {
  color: var(--lime);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.home-touch-boundary {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(208, 255, 66, 0.34);
  border-radius: 12px;
  background: rgba(208, 255, 66, 0.07);
}

.home-touch-boundary strong {
  flex: 0 0 auto;
  color: var(--lime);
}

.home-touch-boundary span,
.home-touch-heading p,
.home-touch-count,
.home-touch-detail-tip {
  color: var(--muted);
}

.home-touch-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.home-touch-heading h2,
.home-touch-heading p,
.home-touch-detail h2,
.home-touch-detail p,
.home-touch-editor h2,
.home-touch-editor p {
  margin: 0;
}

.home-touch-heading h2 {
  margin-top: 4px;
  font-size: 27px;
}

.home-touch-heading > div:first-child > p:last-child {
  margin-top: 6px;
}

.home-touch-path {
  color: var(--lime) !important;
  font-size: 12px;
  font-weight: 760;
}

.home-touch-actions,
.home-touch-detail-actions,
.home-touch-row-actions,
.home-touch-image-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.home-touch-actions {
  justify-content: flex-end;
}

.home-touch-actions button,
.home-touch-detail-actions button,
.home-touch-image-actions button,
.home-touch-image-actions .file-action {
  width: auto;
  min-height: 38px;
  margin: 0;
  padding: 0 14px;
  white-space: nowrap;
}

.home-touch-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.home-touch-filters label {
  display: grid;
  gap: 5px;
  min-width: 130px;
  flex: 1 1 140px;
  color: var(--muted);
  font-size: 12px;
}

.home-touch-filters select,
.home-touch-editor input,
.home-touch-editor select,
.home-touch-editor textarea,
.home-touch-dialog textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #080c0b;
  color: var(--text);
}

.home-touch-filters select {
  min-height: 38px;
  padding: 0 10px;
}

.home-touch-count {
  display: flex;
  gap: 14px;
  align-items: center;
  min-height: 42px;
  font-size: 13px;
}

.home-touch-count strong {
  color: var(--text);
}

.home-touch-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: scroll;
  overflow-y: visible;
  overscroll-behavior-x: contain;
  scrollbar-color: rgba(208, 255, 66, 0.62) rgba(255, 255, 255, 0.06);
  scrollbar-width: thin;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(7, 11, 10, 0.72);
}

.home-touch-table-wrap::-webkit-scrollbar {
  height: 10px;
}

.home-touch-table-wrap::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.06);
}

.home-touch-table-wrap::-webkit-scrollbar-thumb {
  border: 2px solid #080c0b;
  border-radius: 999px;
  background: rgba(208, 255, 66, 0.62);
}

.home-touch-table-wrap::-webkit-scrollbar-thumb:hover {
  background: rgba(208, 255, 66, 0.86);
}

.home-touch-embedded .home-touch-table-wrap {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.home-touch-table {
  width: 100%;
  min-width: 1050px;
  border-collapse: separate;
  border-spacing: 0;
}

.home-touch-table th,
.home-touch-table td {
  padding: 13px 12px;
  border-bottom: 1px solid rgba(225, 242, 226, 0.1);
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}

.home-touch-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #18211e;
  color: var(--muted);
  white-space: nowrap;
}

.home-touch-table tbody tr {
  cursor: pointer;
  transition: background 160ms ease, outline-color 160ms ease;
}

.home-touch-table .condition-cell {
  width: 250px;
  min-width: 250px;
  max-width: 250px;
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.55;
}

.home-touch-table .condition-text {
  display: block;
  width: 250px;
  max-width: 100%;
  overflow: visible;
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: normal;
  text-overflow: clip;
  -webkit-line-clamp: unset;
}

.home-touch-popup-group + .home-touch-popup-group {
  border-top: 1px solid rgba(225, 242, 226, 0.14);
}

.home-touch-popup-group h4 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  color: var(--lime);
  background: rgba(208, 255, 66, 0.045);
}

.home-touch-popup-group h4 span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.home-touch-table.pet-table {
  min-width: 1120px;
}

.home-touch-table.popup-table {
  width: max-content;
  min-width: 1610px;
  table-layout: auto;
}

.popup-table th:nth-child(1),
.popup-table td:nth-child(1) {
  width: 120px;
}

.popup-table th:nth-child(2),
.popup-table td:nth-child(2) {
  width: 150px;
}

.popup-table th:nth-child(3),
.popup-table td:nth-child(3) {
  width: 150px;
}

.popup-table th:nth-child(4),
.popup-table td:nth-child(4) {
  width: 210px;
}

.popup-table th:nth-child(5),
.popup-table td:nth-child(5) {
  width: 110px;
}

.popup-table th:nth-child(6),
.popup-table td:nth-child(6) {
  width: 300px;
}

.popup-table th:nth-child(7),
.popup-table td:nth-child(7) {
  width: 130px;
}

.popup-table th:nth-child(8),
.popup-table td:nth-child(8) {
  width: 220px;
}

.popup-table th:nth-child(9),
.popup-table td:nth-child(9) {
  width: 90px;
}

.popup-table th:nth-child(10),
.popup-table td:nth-child(10) {
  width: 130px;
}

.popup-table .condition-cell {
  width: 300px;
  min-width: 300px;
  max-width: 300px;
}

.popup-table .condition-text {
  width: 276px;
}

.popup-table .trigger-page-cell {
  color: var(--lime);
  font-weight: 700;
  white-space: nowrap;
}

.home-touch-table tbody tr:hover,
.home-touch-table tbody tr.selected {
  background: rgba(208, 255, 66, 0.07);
  outline: 1px solid rgba(208, 255, 66, 0.38);
  outline-offset: -1px;
}

.home-touch-table .copy-cell {
  max-width: 260px;
  line-height: 1.55;
}

.home-touch-row-actions {
  flex-wrap: nowrap;
}

.home-touch-row-actions button {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  white-space: nowrap;
}

.home-touch-row-actions button:hover,
.home-touch-row-actions button:focus-visible {
  border-color: rgba(208, 255, 66, 0.6);
  color: var(--lime);
}

.home-touch-row-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.home-touch-status,
.priority-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.home-touch-status.status-active,
.priority-1,
.priority-2 {
  border-color: rgba(208, 255, 66, 0.5);
  background: rgba(208, 255, 66, 0.1);
  color: var(--lime);
}

.home-touch-status.status-pending,
.priority-3 {
  border-color: rgba(255, 215, 97, 0.45);
  color: var(--warning);
}

.home-touch-status.status-disabled,
.priority-4,
.priority-5 {
  color: var(--muted);
}

.home-touch-status.status-draft {
  border-style: dashed;
  color: #c9d2cc;
}

.home-touch-thumb {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #050807;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.home-touch-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.home-touch-thumb.missing {
  border-style: dashed;
  color: var(--warning);
}

.home-touch-detail-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: flex-start;
  gap: 10px;
}

.home-touch-detail-header > div:first-child {
  min-width: 0;
}

.home-touch-detail-header h2 {
  font-size: 23px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-touch-detail-actions {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.home-touch-detail-actions button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.home-touch-detail-header p {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.home-touch-detail-image {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.home-touch-detail-fields {
  display: grid;
  gap: 0;
}

.home-touch-detail-fields > div {
  display: grid;
  gap: 5px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(225, 242, 226, 0.1);
}

.home-touch-detail-fields span,
.home-touch-revisions span,
.home-touch-editor label > span,
.home-touch-image-editor > span,
.home-touch-dialog label > span {
  color: var(--muted);
  font-size: 12px;
}

.home-touch-detail-fields strong {
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.home-touch-revisions {
  margin-top: 18px;
}

.home-touch-revisions h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.home-touch-revisions article {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  border-top: 1px solid rgba(225, 242, 226, 0.1);
}

.home-touch-danger-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.home-touch-danger-actions button {
  width: auto;
  min-height: 38px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
}

.home-touch-editor {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.home-touch-editor .detail-panel-body {
  display: grid;
  gap: 14px;
}

.home-touch-editor label,
.home-touch-image-editor {
  display: grid;
  gap: 7px;
}

.home-touch-editor input,
.home-touch-editor select {
  min-height: 40px;
  padding: 0 10px;
}

.home-touch-editor textarea,
.home-touch-dialog textarea {
  resize: vertical;
  min-height: 82px;
  padding: 10px;
  line-height: 1.5;
}

.home-touch-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.home-touch-delay-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.home-touch-delay-presets button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 12px;
}

.home-touch-delay-presets button:hover,
.home-touch-delay-presets button:focus-visible {
  border-color: rgba(208, 255, 66, 0.6);
  color: var(--lime);
}

.home-touch-image-preview {
  display: flex;
  align-items: center;
  gap: 10px;
}

.file-action {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.home-touch-form-error {
  min-height: 18px;
  margin: 0;
  color: var(--danger) !important;
  font-size: 12px;
}

.home-touch-editor-footer {
  display: flex;
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: #0c1110;
}

.home-touch-editor-footer button {
  width: auto;
  min-width: 92px;
  min-height: 40px;
  margin: 0;
  padding: 0 18px;
}

.home-touch-dialog,
.home-touch-viewer {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0c1110;
  color: var(--text);
}

.home-touch-dialog::backdrop,
.home-touch-viewer::backdrop {
  background: rgba(0, 0, 0, 0.78);
}

.reason-dialog {
  width: min(480px, calc(100vw - 32px));
}

.reason-dialog form {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.reason-dialog h2,
.reason-dialog p {
  margin: 0;
}

.reason-dialog > form > div:last-child {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.reason-dialog button {
  width: auto;
  min-width: 96px;
  min-height: 40px;
  margin: 0;
  padding: 0 16px;
}

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

.dialog-heading,
.home-touch-viewer header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.dialog-heading h2,
.dialog-heading p {
  margin: 0;
}

.dialog-heading p {
  margin-top: 4px;
  color: var(--muted);
}

.home-touch-asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
  max-height: 600px;
  overflow: auto;
  padding: 18px;
}

.home-touch-asset-grid button {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  text-align: left;
}

.home-touch-asset-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #050807;
}

.home-touch-asset-grid span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-touch-viewer {
  width: min(760px, calc(100vw - 40px));
  height: min(760px, calc(100vh - 40px));
  max-width: none;
  max-height: none;
  overflow: hidden;
}

.home-touch-viewer[open] {
  display: flex;
  flex-direction: column;
}

.home-touch-viewer header div {
  display: flex;
  gap: 7px;
}

.home-touch-viewer button,
.dialog-heading button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.home-touch-viewer-canvas {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  place-items: center;
  overflow: auto;
  padding: 18px;
  background: #020403;
}

.home-touch-viewer-hint {
  flex: 0 0 auto;
  margin: 0;
  padding: 7px 18px 9px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(245, 248, 244, 0.52);
  font-size: 11px;
  line-height: 1.4;
  text-align: right;
}

.home-touch-viewer img {
  display: block;
  transform-origin: center;
}

.home-touch-viewer img.fit {
  width: auto;
  height: auto;
  max-width: min(100%, calc(100vw - 80px));
  max-height: calc(100vh - 150px);
  object-fit: contain;
}

.home-touch-viewer img.original {
  max-width: none;
  max-height: none;
}

@media (max-width: 1180px) {
  .home-touch-heading {
    display: grid;
  }

  .home-touch-actions {
    justify-content: flex-start;
  }

  .home-touch-queue-policy > .queue-rule-anchor {
    grid-template-columns: 132px minmax(230px, 1fr) auto;
  }

  .queue-rule-anchor small {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .home-touch-boundary,
  .home-touch-detail-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .home-touch-actions > *,
  .home-touch-detail-actions > * {
    flex: 1 1 auto;
  }

  .home-touch-form-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-touch-table tbody tr {
    transition: none;
  }
}

.home-touch-subgroup-row td {
  padding: 10px 16px;
  background: rgba(190, 255, 0, 0.07);
  color: var(--accent);
}

.home-touch-subgroup-row td strong {
  margin-right: 10px;
}

.home-touch-subgroup-row td span,
.linked-medal-image p {
  color: var(--muted);
  font-size: 12px;
}

.home-touch-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.toast-table th:nth-child(4),
.toast-table td:nth-child(4) {
  min-width: 220px;
}
