@import "../local/fonts.css";
:root {
  --sidebar-width: 232px;
  color-scheme: dark;
  --bg: #11131c;
  --panel: #191c28;
  --card: #202432;
  --border: #303548;
  --muted: #9aa2b8;
  --text: #eef0f7;
  --accent: #a495ff;
  --accent-bg: #8b78f4;
  --green: #64d9bd;
  --danger: #ff8e9e;
  --radius: 12px;
  --space: 8px;
  font-family: Nunito, system-ui, sans-serif;
  font-size: 14px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.45;
}
button,
a,
input,
textarea,
select {
  outline-offset: 3px;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
}
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #a495ff66;
  border-color: var(--accent);
}
input[type="checkbox"]:focus,input[type="checkbox"]:focus-visible { outline:none; box-shadow:none; }
a {
  color: var(--accent);
}
button {
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 9px 13px;
  background: transparent;
  color: inherit;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 20px;
  transition:
    background 0.15s,
    border-color 0.15s;
}
button:hover {
  background: #ffffff09;
}
button.primary {
  background: var(--accent-bg);
  color: white;
  box-shadow: 0 3px 10px #0002;
}
button.primary:hover {
  background: #9c8bf9;
}
button.secondary {
  background: var(--card);
  border-color: var(--border);
}
button.danger {
  color: var(--danger);
}
button.icon-button {
  width: 34px;
  height: 34px;
  padding: 7px;
  flex-shrink: 0;
}
.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  vertical-align: middle;
}
input,
textarea,
select {
  background: #12151f;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 11px;
  color: var(--text);
  width: 100%;
  font-weight: 500;
  min-width: 0;
}
input::placeholder,
textarea::placeholder {
  color: #747e98;
}
textarea {
  resize: vertical;
  min-height: 96px;
  line-height: 1.6;
}
select {
  padding-right: 24px;
}
input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-bg);
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 21px;
  line-height: 1.3;
  letter-spacing: -0.4px;
}
h2 {
  font-size: 18px;
}
h3 {
  font-size: 14px;
}
p {
  line-height: 1.65;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
}
.label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 800;
  color: var(--muted);
}
.row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.between {
  justify-content: space-between;
}
.grow {
  flex: 1;
  min-width: 0;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.badge {
  font-size: 11px;
  border-radius: 5px;
  padding: 3px 7px;
  background: #ffffff09;
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}
.badge.active {
  background: #64d9bd16;
  color: var(--green);
}
.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 100%;
  margin-right: 5px;
}
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 12px;
  line-height: 1.6;
  font-size: 12px;
  font-weight: 800;
}
.field .hint {
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
  font-weight: 500;
}
.field + .field {
  margin-top: 20px;
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}
.pill {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 7px;
  font-size: 11px;
  color: var(--muted);
}
.app {
  height: 100vh;
  min-height: 500px;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}
.sidebar {
  background: #171a25;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 24px 16px 16px;
}
.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 0 8px 27px;
}
.brand > svg {
  width: 36px;
  height: 36px;
}
.brand strong {
  font-size: 18px;
  letter-spacing: -0.5px;
}
.brand span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
}
.sidebar-head {
  padding: 8px;
  margin-bottom: 12px;
}
.sidebar .new-flow {
  width: 100%;
  margin-bottom: 18px;
}
.flow-search {
  position: relative;
  margin-bottom: 12px;
}
.flow-search svg {
  position: absolute;
  left: 10px;
  top: 11px;
  width: 15px;
}
.flow-search input {
  padding-left: 32px;
  font-size: 12px;
  background: transparent;
}
.flow-list {
  overflow: auto;
  flex: 1;
  margin: 0 -6px;
  padding: 0 6px;
}
.flow-item {
  display: flex;
  width: 100%;
  text-align: left;
  padding: 12px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  gap: 10px;
  margin-bottom: 5px;
  justify-content: flex-start;
  align-items: center;
  font-weight: 600;
}
.flow-item.selected {
  background: #8b78f414;
  border-color: #8b78f435;
}
.flow-item.selected > .icon {
  color: var(--accent);
}
.flow-item strong {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  max-width: 145px;
}
.flow-item small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
}
.sidebar-bottom {
  border-top: 1px solid var(--border);
  padding-top: 13px;
  margin-top: 13px;
}
.sidebar-bottom button {
  width: 100%;
  justify-content: flex-start;
  color: var(--muted);
  font-size: 12px;
}
.connection {
  padding: 13px 9px 0;
  font-size: 10px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 7px;
}
.connection .dot {
  color: #727a91;
  margin: 0;
}
.connection.connected .dot {
  color: var(--green);
}
.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.topbar {
  height: 84px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  background: #151822;
}
.breadcrumb {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 7px;
  display: flex;
  gap: 7px;
  align-items: center;
}
.breadcrumb svg {
  width: 11px;
  height: 11px;
}
.header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-title h1 {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 38vw;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.save-status {
  font-size: 11px;
  color: var(--muted);
  margin-right: 8px;
  white-space: nowrap;
}
.editor {
  display: grid;
  grid-template-columns: minmax(350px, 1fr) 326px;
  flex: 1;
  min-height: 0;
}
.canvas-wrap {
  position: relative;
  min-width: 0;
  background-color: #12151f;
  background-image: radial-gradient(#343a504d 1px, transparent 1px);
  background-size: 20px 20px;
  overflow: auto;
  padding: 36px 36px 110px;
}
.canvas-label {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: center;
  z-index: 1;
  margin-bottom: 24px;
}
.canvas-label span {
  background: #12151fe8;
  border: 1px solid #30354888;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--muted);
}
.canvas {
  width: min(100%, 356px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform-origin: top center;
}
.flow-node {
  position: relative;
  text-align: left;
  width: 100%;
  background: #1c202d;
  border: 1px solid #363d53;
  border-radius: 12px;
  box-shadow: 0 5px 16px #0002;
  cursor: pointer;
  outline-offset: 4px;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.flow-node:hover {
  border-color: #72718b;
}
.flow-node.selected {
  border-color: var(--accent);
  box-shadow:
    0 0 0 3px #a495ff12,
    0 8px 20px #0003;
}
.node-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 17px 11px;
}
.node-head strong {
  font-size: 13px;
  line-height: 1.4;
}
.node-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
  background: #a495ff18;
  color: var(--accent);
}
.node-icon.blue {
  color: #82baff;
  background: #82baff15;
}
.node-icon.pink {
  color: #efa2cf;
  background: #efa2cf15;
}
.node-icon.teal {
  color: #64d9bd;
  background: #64d9bd15;
}
.node-icon.amber {
  color: #e6c08a;
  background: #e6c08a15;
}
.node-icon.slate {
  color: #b1bace;
  background: #b1bace15;
}
.node-type {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-bottom: 2px;
  font-weight: 600;
}
.node-preview {
  padding: 0 17px 20px 59px;
  font-size: 12px;
  color: #aab3c9;
  line-height: 1.6;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.node-preview-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
  line-clamp: 6;
  overflow: hidden;
}
.node-order {
  margin-left: auto;
  font-size: 10px;
  color: #65708a;
}
.node-footer {
  display: flex;
  gap: 8px;
  padding: 9px 16px;
  border-top: 1px solid #30354899;
  color: var(--muted);
  font-size: 10px;
  align-items: center;
}
.node-port {
  width: 8px;
  height: 8px;
  border: 2px solid #686e8a;
  border-radius: 50%;
  background: var(--card);
  position: absolute;
  bottom: -5px;
  left: calc(50% - 4px);
}
.connector {
  height: 33px;
  width: 1px;
  background: #4b526b;
  position: relative;
  flex-shrink: 0;
}
.connector::after {
  position: absolute;
  content: "";
  width: 5px;
  height: 5px;
  bottom: 1px;
  left: -2px;
  border-right: 1px solid #747d98;
  border-bottom: 1px solid #747d98;
  transform: rotate(45deg);
}
.add-card {
  margin-top: 24px;
  border: 1px dashed #525975;
  color: var(--muted);
  background: #181b27;
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 12px;
}
.add-card:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.empty-flow {
  border: 1px dashed #3b425a;
  border-radius: 12px;
  padding: 30px 24px;
  text-align: center;
  width: 100%;
  color: var(--muted);
  font-size: 12px;
}
.empty-flow strong {
  color: #c6cce0;
  display: block;
  font-size: 14px;
  margin-bottom: 8px;
}
.canvas-toolbar {
  position: sticky;
  bottom: 8px;
  float: left;
  margin-top: 30px;
  border: 1px solid var(--border);
  background: #1b1e2be8;
  border-radius: 8px;
  padding: 3px;
  display: flex;
  gap: 1px;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
}
.inspector {
  border-left: 1px solid var(--border);
  background: #191c28;
  overflow: auto;
  min-width: 0;
}
.inspector-title {
  padding: 21px 22px;
  border-bottom: 1px solid var(--border);
}
.inspector-title h2 {
  font-size: 14px;
  margin-bottom: 5px;
}
.inspector-body {
  padding: 22px;
}
.inspector-body p {
  font-size: 12px;
  color: var(--muted);
}
.inspector-tools {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.section-title {
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--muted);
  margin: 24px 0 13px;
}
.upload-zone {
  border: 1px dashed #535d7c;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  text-align: center;
  background: #ffffff02;
  border-radius: 9px;
  cursor: pointer;
  color: var(--muted);
  font-size: 11px;
}
.upload-zone + .field,
.asset-preview + .field,
.check + .field {
  margin-top: 24px;
}
.inspector-body .field + .check,
.inspector-body .field + .technical {
  margin-top: 24px;
}
.upload-zone svg {
  color: var(--accent);
  width: 24px;
  height: 24px;
}
.upload-zone strong {
  color: var(--text);
  font-size: 12px;
}
.upload-zone:hover {
  border-color: var(--accent);
}
.upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.asset-preview {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #11131c;
  margin-top: 10px;
}
.asset-preview img,
.asset-preview video {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  display: block;
}
.asset-preview audio {
  width: 100%;
  height: 40px;
  display: block;
}
.asset-preview.audio-preview {
  border: 0;
  border-radius: 0;
  background: none;
  overflow: visible;
  margin-top: 20px;
}
.preview-error {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.file-chip {
  padding: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  overflow-wrap: anywhere;
}
.field-definition {
  padding: 12px;
  background: #131722;
  border: 1px solid var(--border);
  border-radius: 9px;
  margin-top: 10px;
}
.field-definition input,
.field-definition select {
  padding: 8px;
  font-size: 11px;
}
.field-definition .row {
  margin-bottom: 8px;
}
.media-badges {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin: 13px 0;
}
.media-badges .pill {
  font-size: 10px;
  padding: 4px 6px;
}
.media-badges .icon {
  width: 12px;
  height: 12px;
}
.notice {
  background: #a495ff0b;
  border: 1px solid #a495ff20;
  border-radius: 8px;
  padding: 12px;
  color: #b8afdf;
  font-size: 11px;
  line-height: 1.7;
}
.welcome {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 45px;
  position: relative;
  background: radial-gradient(ellipse at center, #8b78f40c, transparent 60%);
}
.welcome-content {
  max-width: 560px;
  text-align: center;
}
.welcome-art {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 36px;
}
.welcome-art > .node-icon {
  width: 56px;
  height: 56px;
  border: 1px solid #a495ff25;
  border-radius: 15px;
}
.welcome-art > .node-icon svg {
  width: 24px;
  height: 24px;
}
.welcome-art > span {
  width: 32px;
  height: 1px;
  background: #48506b;
}
.welcome h1 {
  font-size: 32px;
  letter-spacing: -1px;
  margin-bottom: 16px;
}
.welcome p {
  color: var(--muted);
  max-width: 440px;
  margin: 0 auto 27px;
  line-height: 1.8;
}
.welcome .welcome-note {
  font-size: 11px;
  margin-top: 20px;
}
.welcome .eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.overlay {
  position: fixed;
  inset: 0;
  background: #070912b8;
  backdrop-filter: blur(5px);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.dialog {
  width: min(100%, 560px);
  max-height: 90vh;
  background: #1b1f2c;
  border: 1px solid #3c435b;
  box-shadow: 0 30px 100px #0006;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.dialog.wide {
  width: min(100%, 780px);
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}
.dialog-head p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}
.dialog-body {
  padding: 24px;
  overflow: auto;
}
.dialog-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.card-option {
  text-align: left;
  justify-content: flex-start;
  align-items: flex-start;
  padding: 14px;
  gap: 12px;
  background: #232837;
  border: 1px solid #343c52;
  border-radius: 11px;
}
.card-option:hover {
  border-color: var(--accent);
  background: #2a2d43;
}
.card-option .grow {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.card-option strong {
  font-size: 12px;
}
.card-option small {
  font-size: 10px;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.6;
}
.dialog .field textarea {
  min-height: 120px;
}
#toast-layer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px 16px 24px;
  pointer-events: none;
}
body:has(#app > .app) #toast-layer {
  left: var(--sidebar-width);
}
#toast-layer > .toast {
  position: static;
  flex: 0 1 auto;
  width: max-content;
  min-width: 0;
  margin: 0;
  transform: none;
  max-width: min(100%, 560px);
  overflow-wrap: anywhere;
  text-align: center;
  z-index: 40;
  padding: 13px 18px;
  border-radius: 10px;
  border: 1px solid #4e5877;
  background: #262c40;
  box-shadow: 0 12px 40px #0005;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-line;
}
.toast.error {
  border-color: #ff8e9e66;
  color: #ffb9c4;
}
.hidden {
  display: none !important;
}
.test-layout {
  display: grid;
  grid-template-columns: 1fr 230px;
  min-height: 330px;
}
.chat {
  padding: 16px;
  min-height: 260px;
  max-height: 390px;
  overflow: auto;
  background: #12151f;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bubble {
  padding: 10px 13px;
  border-radius: 12px;
  max-width: 88%;
  font-size: 12px;
  line-height: 1.7;
  background: #293044;
  align-self: flex-start;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.bubble.user {
  background: #514778;
  align-self: flex-end;
}
.bubble small {
  display: block;
  font-size: 10px;
  color: #b5bdd2;
  margin-bottom: 3px;
}
.test-fields {
  border-left: 1px solid var(--border);
  padding: 17px;
  font-size: 11px;
  overflow: auto;
  max-height: 390px;
}
.test-fields h3 {
  font-size: 11px;
  margin-bottom: 13px;
}
.test-fields dt {
  color: var(--muted);
  margin-top: 12px;
}
.test-fields dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
}
.test-composer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px;
  border-top: 1px solid var(--border);
}
.test-composer input {
  font-size: 12px;
}
.status-line {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
}
.run {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
}
.run p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
}
.run pre {
  font-size: 11px;
  background: #12151f;
  padding: 12px;
  border-radius: 8px;
  overflow: auto;
  white-space: pre-wrap;
  line-height: 1.8;
}
.popup-body {
  width: 300px;
  min-height: 240px;
  padding: 24px;
}
.popup-body .brand {
  padding: 0 0 22px;
}
.popup-body p {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 22px;
}
.popup-body button {
  width: 100%;
}
@media (min-width: 1600px) {
  .editor {
    grid-template-columns: minmax(350px, 1fr) 360px;
  }
  .inspector-body {
    padding: 26px;
  }
  .canvas-wrap {
    padding-top: 44px;
  }
}
@media (max-width: 1120px) {
  :root {
    --sidebar-width: 194px;
  }
  .sidebar {
    padding: 20px 12px 12px;
  }
  .editor {
    grid-template-columns: minmax(290px, 1fr) 290px;
  }
  .topbar {
    padding: 14px 20px;
  }
  .save-status {
    display: none;
  }
  .top-actions button {
    font-size: 12px;
    padding: 8px 10px;
  }
  .inspector-body {
    padding: 18px;
  }
  .canvas-wrap {
    padding: 28px 24px 80px;
  }
  .flow-item strong {
    max-width: 118px;
  }
  .header-title h1 {
    max-width: 24vw;
  }
}
@media (max-width: 860px) {
  :root {
    --sidebar-width: 160px;
  }
  .editor {
    grid-template-columns: minmax(0, 1fr);
  }
  .inspector {
    border-left: 0;
    border-top: 1px solid var(--border);
    max-height: 46vh;
    grid-row: 2;
  }
  .canvas-wrap {
    min-height: 260px;
  }
  .header-title h1 {
    font-size: 16px;
    max-width: 26vw;
  }
  .topbar {
    height: 76px;
    gap: 8px;
    padding: 12px 16px;
  }
  .top-actions {
    gap: 4px;
  }
  .top-actions .compact-label {
    display: none;
  }
  .flow-item strong {
    max-width: 90px;
  }
  .brand {
    padding-left: 0;
    gap: 7px;
  }
  .brand strong {
    font-size: 15px;
  }
  .brand svg {
    width: 30px;
    height: 30px;
  }
  .welcome {
    padding: 24px;
  }
  .welcome h1 {
    font-size: 26px;
  }
  .card-grid {
    grid-template-columns: 1fr 1fr;
  }
  .test-layout {
    grid-template-columns: 1fr;
  }
  .test-fields {
    border-top: 1px solid var(--border);
    border-left: 0;
    max-height: 140px;
  }
}
.sidebar-bottom button span {
  text-align: left;
}
.canvas-label {
  position: relative;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.canvas-label .canvas-toolbar {
  position: static;
  float: none;
  margin: 0;
  width: max-content;
}
.canvas-toolbar span {
  padding: 0 4px;
  border: 0;
  background: none;
  letter-spacing: 0;
  font-size: 11px;
  border-radius: 0;
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
.section-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.section-nav button {
  width: 100%;
  justify-content: flex-start;
  font-size: 12px;
  color: var(--muted);
  padding: 10px;
}
.section-nav button.selected {
  background: #8b78f418;
  color: var(--accent);
}
.management-scroll {
  overflow: auto;
  flex: 1;
  padding: 28px;
  min-height: 0;
}
.management-intro {
  margin: 0 auto 24px;
  max-width: 1260px;
  gap: 20px;
}
.management-intro p {
  font-size: 13px;
  color: var(--muted);
}
.agent-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.agent-tabs button {
  border: 1px solid var(--border);
  font-size: 12px;
  background: #191d2a;
}
.agent-tabs button.selected {
  border-color: var(--accent);
  background: #8b78f415;
  color: var(--accent);
}
.agent-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 1fr);
  gap: 24px;
  max-width: 1260px;
  margin: auto;
  align-items: start;
}
.form-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  background: #1a1e2b;
}
.form-panel h2 {
  font-size: 15px;
  margin-bottom: 14px;
}
.form-panel > .field:first-of-type {
  margin-top: 18px;
}
.form-panel > p {
  margin-bottom: 18px;
}
.form-panel .notice {
  margin-top: 16px;
}
.panel-heading {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}
.panel-heading h2 {
  margin-bottom: 4px;
}
.panel-heading p {
  font-size: 11px;
  color: var(--muted);
}
.two-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 16px;
}
.two-fields > .field + .field {
  margin-top: 0;
}
.contact-defaults {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0;
  font-size: 12px;
}
.contact-defaults span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #bbc6da;
}
.contact-defaults .icon {
  width: 15px;
  height: 15px;
  color: var(--green);
}
.technical summary {
  cursor: pointer;
  font-size: 12px;
  line-height: 1.6;
  font-weight: 700;
  color: var(--muted);
}
.technical[open] summary {
  margin-bottom: 18px;
}
.form-fields {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 20px;
}
.form-fields > .field + .field,
.form-fields > .two-fields {
  margin-top: 0;
}
.form-panel > .row h2 {
  margin-bottom: 0;
}
.form-panel .hint,
.publish-agent-note {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
  font-weight: 500;
}
.receipt-disclosure {
  margin-top: 20px;
}
.technical[open] summary {
  margin-bottom: 0;
}
.receipts-content { width:100%; margin:0; }
.topbar.receipts-topbar { height:auto; min-height:84px; flex-wrap:wrap; gap:16px; }
.receipt-header-actions { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:8px; margin-left:auto; }
.receipt-toolbar { display:flex; justify-content:flex-end; margin-bottom:20px; }
.receipt-toolbar .receipt-periods { justify-content:flex-end; }
.receipt-periods {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.receipt-periods button {
  border: 1px solid var(--border);
  font-size: 12px;
  min-height: 40px;
}
.receipt-periods button.selected {
  color: var(--accent);
  background: #8b78f418;
  border-color: var(--accent);
}
.topbar.management-topbar {
  height: auto;
  min-height: 84px;
  flex-wrap: wrap;
  gap: 16px;
}
.management-topbar > .row {
  flex-wrap: wrap;
}
.receipt-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}
.receipt-thumb {
  display: block;
  aspect-ratio: 4 / 5;
  position: relative;
  border: 0;
  border-radius: 6px;
  background-color: #232735;
  background-size: cover;
  background-position: top center;
  overflow: hidden;
  cursor: zoom-in;
  transition:
    filter 160ms ease,
    transform 160ms ease;
}
.receipt-thumb:hover {
  filter: brightness(1.06);
  transform: translateY(-2px);
}
.receipt-thumb:not(.loaded)::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent, #ffffff08, transparent);
}
.receipt-thumb.thumbnail-unavailable {
  background-image: linear-gradient(145deg, #33394c, #202430);
}
.receipt-format {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 4px 7px;
  border-radius: 4px;
  background: #161922d9;
  color: #fff;
  font: 700 10px/1.4 system-ui;
  letter-spacing: 0.05em;
}
.gallery-sentinel {
  height: 2px;
  margin-top: 24px;
}
.gallery-sentinel[hidden] {
  display: none;
}
.receipt-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  cursor: zoom-out;
}
.receipt-lightbox img {
  display: block;
  max-width: 100%;
  max-height: calc(100dvh - 64px);
  object-fit: contain;
  cursor: default;
  box-shadow: 0 12px 80px #0008;
}
.receipt-lightbox:focus {
  outline: none;
}
.empty-receipts {
  grid-column: 1/-1;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  min-height: 350px;
  gap: 18px;
  color: var(--muted);
}
.empty-receipts > .node-icon {
  width: 54px;
  height: 54px;
}
.empty-receipts h2 {
  color: var(--text);
  font-size: 19px;
}
.empty-receipts p {
  max-width: 350px;
  font-size: 13px;
}
@media (max-width: 1120px) {
  .management-scroll {
    padding: 20px;
  }
  .agent-columns {
    grid-template-columns: minmax(0, 1fr);
  }
  .form-panel {
    padding: 22px;
  }
  .management-intro.between {
    align-items: flex-start;
    flex-direction: column;
  }
}
@media (max-width: 860px) {
  .management-scroll {
    padding: 16px;
  }
  .form-panel {
    padding: 18px;
  }
  .section-nav button {
    padding: 9px 6px;
    font-size: 11px;
  }
  .agent-tabs button {
    font-size: 11px;
  }
  .receipt-gallery {
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: 10px;
  }
}

.random-complement {
  margin: 18px 0 24px;
}
