:root {
  color-scheme: light;
  --bg: #f4f6f2;
  --surface: #ffffff;
  --surface-2: #eef3ee;
  --ink: #17211d;
  --muted: #62706a;
  --line: #dbe2db;
  --accent: #0d7b68;
  --accent-2: #e64b3c;
  --gold: #d59b24;
  --blue: #245fc9;
  --shadow: 0 18px 50px rgba(31, 46, 40, 0.1);
  --shadow-soft: 0 10px 28px rgba(31, 46, 40, 0.08);
  --shadow-hover: 0 22px 60px rgba(31, 46, 40, 0.14);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --sidebar-width: 284px;
  font-family: Inter, "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(13, 123, 104, 0.045) 0%, transparent 26%),
    linear-gradient(315deg, rgba(213, 155, 36, 0.045) 0%, transparent 30%),
    linear-gradient(180deg, #f8faf6 0%, var(--bg) 46%, #f5f7f3 100%);
  color: var(--ink);
}

body.auth-loading .app-shell,
body.auth-required .app-shell,
body.auth-loading .floating-assistant,
body.auth-required .floating-assistant,
body.auth-loading .toast,
body.auth-required .toast {
  display: none;
}

body:not(.auth-loading):not(.auth-required) .auth-screen {
  display: none;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(13, 123, 104, 0.12), transparent 34%),
    linear-gradient(315deg, rgba(230, 75, 60, 0.08), transparent 30%),
    linear-gradient(180deg, #fbfcfa 0%, #f0f4ef 100%);
}

.auth-panel {
  width: min(100%, 480px);
  display: grid;
  gap: 18px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.auth-brand {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.auth-logo {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 16px 34px rgba(13, 123, 104, 0.24);
}

.auth-logo svg {
  width: 26px;
  height: 26px;
}

.auth-brand h1 {
  margin: 4px 0 8px;
  font-size: 28px;
  letter-spacing: 0;
}

.auth-brand p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.auth-tab {
  min-height: 40px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
}

.auth-tab.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-soft);
}

.auth-form {
  display: none;
  gap: 14px;
}

.auth-form.active {
  display: grid;
}

.auth-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.auth-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
}

.auth-form input:focus {
  border-color: rgba(13, 123, 104, 0.45);
  box-shadow: 0 0 0 4px rgba(13, 123, 104, 0.1);
}

.auth-status {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.auth-status[data-state="success"] {
  color: var(--accent);
}

.auth-status[data-state="error"] {
  color: var(--accent-2);
}

.auth-screen::before,
.auth-screen::after {
  content: "";
  position: fixed;
  width: 42vmax;
  height: 42vmax;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.18;
  pointer-events: none;
  animation: authGlow 12s ease-in-out infinite alternate;
}

.auth-screen::before {
  left: -12vmax;
  top: -10vmax;
  background: var(--accent);
}

.auth-screen::after {
  right: -14vmax;
  bottom: -16vmax;
  background: var(--accent-2);
  animation-delay: -4s;
}

.auth-panel {
  position: relative;
  z-index: 1;
  animation: authPanelIn 0.58s cubic-bezier(0.22, 1, 0.36, 1) both;
  backdrop-filter: blur(18px);
}

.auth-form {
  transform-origin: 50% 20%;
}

.auth-form.active {
  animation: authFormSlide 0.28s var(--ease-out) both;
}

.floating-field {
  position: relative;
  display: block;
}

.floating-field input,
.floating-field select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px 42px 8px 13px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.floating-field > span {
  position: absolute;
  left: 13px;
  top: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  pointer-events: none;
  transform-origin: left top;
  transition: transform 0.18s ease, color 0.18s ease;
}

.floating-field input:focus,
.floating-field input:not(:placeholder-shown) {
  border-color: rgba(13, 123, 104, 0.45);
  box-shadow: 0 0 0 4px rgba(13, 123, 104, 0.1);
}

.floating-field input:focus + span,
.floating-field input:not(:placeholder-shown) + span {
  color: var(--accent);
  transform: translateY(-10px) scale(0.82);
}

.floating-field[data-state="success"] input {
  border-color: rgba(13, 123, 104, 0.48);
}

.floating-field[data-state="error"] input {
  border-color: rgba(230, 75, 60, 0.58);
}

.auth-input-icon {
  position: absolute;
  right: 13px;
  top: 15px;
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.floating-field[data-state="success"] .auth-input-icon {
  color: var(--accent);
}

.floating-field[data-state="error"] .auth-input-icon {
  color: var(--accent-2);
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}

.password-toggle:hover {
  background: var(--surface-2);
  color: var(--accent);
}

.auth-field-hint {
  margin-top: -8px;
  color: var(--muted);
  font-size: 12px;
}

.auth-field-hint[data-state="success"] {
  color: var(--accent);
}

.auth-field-hint[data-state="error"] {
  color: var(--accent-2);
}

.remember-field {
  width: fit-content;
  min-height: 40px;
  display: inline-flex !important;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 8px 12px;
  line-height: 1;
  white-space: nowrap;
}

.remember-field input {
  width: 16px;
  height: 16px;
  margin: 0;
  flex: 0 0 auto;
}

.password-strength {
  display: grid;
  gap: 7px;
  margin-top: -6px;
}

.password-strength span {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.password-strength i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  transition: width 0.22s ease, background 0.22s ease;
}

.password-strength strong {
  color: var(--muted);
  font-size: 12px;
}

.password-strength[data-strength="weak"] i {
  width: 34%;
  background: var(--accent-2);
}

.password-strength[data-strength="medium"] i {
  width: 68%;
  background: var(--gold);
}

.password-strength[data-strength="strong"] i {
  width: 100%;
  background: var(--accent);
}

@keyframes authGlow {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(8%, 6%, 0) scale(1.08); }
}

@keyframes authPanelIn {
  from { opacity: 0; transform: translateY(16px) scale(0.985); filter: blur(8px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

@keyframes authFormSlide {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  transition: grid-template-columns 0.28s var(--ease-out);
}

.app-shell.sidebar-collapsed {
  --sidebar-width: 82px;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 100vh;
  padding: 18px 14px;
  background:
    radial-gradient(circle at 28px 26px, rgba(25, 165, 139, 0.16), transparent 26%),
    linear-gradient(180deg, #0d1a16 0%, #0b1714 48%, #0a1412 100%);
  color: #f8fbf8;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: visible;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.3);
  isolation: isolate;
}

.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, rgba(255, 255, 255, 0.08), transparent 32%, transparent 68%, rgba(13, 123, 104, 0.08));
  opacity: 0.48;
  z-index: -1;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 8px 8px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #19a58b, #e05a47);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.26), 0 0 0 1px rgba(255, 255, 255, 0.08);
  transition: transform 0.28s var(--ease-out), box-shadow 0.28s var(--ease-out);
  transform-origin: 50% 58%;
}

.sidebar-toggle {
  border: 0;
  flex: 0 0 44px;
}

.sidebar-toggle:hover .brand-mark,
.brand-mark:hover {
  transform: translateY(-2px) rotate(-5deg) scale(1.08);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.brand-row strong,
.brand-row span {
  display: block;
}

.brand-row span {
  margin-top: 3px;
  color: #94a59e;
  font-size: 12px;
}

.sidebar-resizer {
  position: absolute;
  top: 0;
  right: -4px;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  z-index: 5;
}

.sidebar-edge-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 32px;
  height: 62px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
  color: #f8fbf8;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  z-index: 12;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
  transition: transform 0.24s var(--ease-out), background 0.2s ease, box-shadow 0.24s var(--ease-out);
}

.sidebar-edge-toggle:hover {
  background: rgba(13, 123, 104, 0.92);
  color: #fff;
  transform: translateY(-50%) translateX(-2px);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.3);
}

.sidebar-edge-toggle svg {
  width: 18px;
  height: 18px;
}

.sidebar-resizer::after {
  content: "";
  position: absolute;
  top: 16px;
  bottom: 16px;
  left: 3px;
  width: 2px;
  border-radius: 999px;
  background: transparent;
}

.sidebar-resizer:hover::after,
body.sidebar-resizing .sidebar-resizer::after {
  background: rgba(25, 165, 139, 0.75);
}

body.sidebar-resizing {
  cursor: col-resize;
  user-select: none;
}

.app-shell.sidebar-collapsed .sidebar {
  padding-left: 12px;
  padding-right: 12px;
  align-items: center;
}

.app-shell.sidebar-collapsed .brand-row > div,
.app-shell.sidebar-collapsed .nav-item span,
.app-shell.sidebar-collapsed .nav-group-toggle,
.app-shell.sidebar-collapsed .sidebar-footer {
  display: none;
}

.app-shell.sidebar-collapsed .nav-list {
  width: 48px;
  overflow: visible;
}

.app-shell.sidebar-collapsed .nav-group {
  display: contents;
}

.app-shell.sidebar-collapsed .nav-group-content {
  display: contents;
}

.app-shell.sidebar-collapsed .nav-group-items {
  display: contents;
}

.app-shell.sidebar-collapsed .nav-item {
  width: 48px;
  height: 48px;
  padding: 0;
  justify-content: center;
  overflow: visible;
}

.app-shell.sidebar-collapsed .nav-item::after {
  content: attr(aria-label);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  z-index: 80;
  min-width: max-content;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(9, 20, 17, 0.94);
  color: #f7fbfa;
  font-size: 13px;
  font-weight: 850;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
  opacity: 0;
  transform: translate(-8px, -50%);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s var(--ease-out);
}

.app-shell.sidebar-collapsed .nav-item:hover,
.app-shell.sidebar-collapsed .nav-item:focus-visible {
  z-index: 40;
}

.app-shell.sidebar-collapsed .nav-item:hover::after,
.app-shell.sidebar-collapsed .nav-item:focus-visible::after {
  opacity: 1;
  transform: translate(0, -50%);
}

.app-shell.sidebar-collapsed .nav-item.active {
  box-shadow: inset 0 0 0 1px rgba(32, 219, 185, 0.24), 0 14px 30px rgba(0, 0, 0, 0.2);
}

.app-shell.sidebar-collapsed .brand-row {
  padding: 8px 0 14px;
}

.app-shell.sidebar-collapsed .brand-mark {
  width: 46px;
  height: 46px;
}

.app-shell.sidebar-collapsed .sidebar-edge-toggle {
  right: -15px;
  width: 30px;
}

.nav-list {
  display: grid;
  gap: 9px;
  padding: 5px 0;
  flex: 1 1 auto;
  min-height: 0;
  align-content: start;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

.nav-list::-webkit-scrollbar {
  width: 4px;
}

.nav-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

/* ── Group accent colors ────────────────────────────── */
.nav-group[data-nav-group="workspace"]  { --group-accent: #21d9bb; }
.nav-group[data-nav-group="sourcing"]   { --group-accent: #f2b556; }
.nav-group[data-nav-group="commerce"]   { --group-accent: #6eb5ff; }
.nav-group[data-nav-group="media"]      { --group-accent: #e87be8; }
.nav-group[data-nav-group="tools"]      { --group-accent: #ff8a65; }
.nav-group[data-nav-group="system"]     { --group-accent: #90a4ae; }

.nav-group {
  display: grid;
  gap: 5px;
  align-content: start;
}

/* ── Gradient separator between groups ─────────────── */
.nav-group + .nav-group {
  padding-top: 10px;
  position: relative;
}

.nav-group + .nav-group::before {
  content: "";
  position: absolute;
  top: 0;
  left: 16px;
  right: 16px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.07), transparent);
  pointer-events: none;
}

/* ── Group toggle — glass-morphism ─────────────────── */
.nav-group-toggle {
  width: 100%;
  align-self: start;
  height: 40px;
  min-height: 40px;
  padding: 0 12px 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)),
    rgba(11, 29, 24, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #b8c8c2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
  font-weight: 820;
  letter-spacing: 0;
  position: relative;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 1px 3px rgba(0, 0, 0, 0.2),
    0 0 12px rgba(33, 217, 187, 0.03);
  transition: background 0.24s ease, color 0.2s ease, border-color 0.24s ease, box-shadow 0.28s ease, transform 0.22s var(--ease-out);
}

.nav-group-toggle::before {
  content: "";
  width: 14px;
  height: 2.5px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--group-accent, #21d9bb), rgba(255, 255, 255, 0.15));
  opacity: 0.8;
  flex: 0 0 auto;
  transition: width 0.24s var(--ease-out), opacity 0.2s ease;
}

.nav-group-toggle:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03)),
    rgba(12, 38, 31, 0.55);
  color: #eef8f4;
  border-color: color-mix(in srgb, var(--group-accent, #21d9bb) 22%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 6px 16px rgba(0, 0, 0, 0.18),
    0 0 18px color-mix(in srgb, var(--group-accent, #21d9bb) 8%, transparent);
  transform: translateY(-1px);
}

.nav-group-toggle:hover::before {
  width: 18px;
  opacity: 1;
}

/* ── Chevron — elastic rotation ────────────────────── */
.nav-group-toggle svg {
  width: 15px;
  height: 15px;
  color: #91a69e;
  transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s ease;
}

.nav-group-toggle:hover svg {
  color: var(--group-accent, #b8c8c2);
}

/* ── Smooth collapse animation via grid-template-rows ── */
.nav-group-content {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.32s var(--ease-out);
}

.nav-group-items {
  overflow: hidden;
  display: grid;
  gap: 4px;
}

.nav-group.is-collapsed .nav-group-content {
  grid-template-rows: 0fr;
}

.nav-group.is-collapsed .nav-group-toggle svg {
  transform: rotate(-90deg);
}

.app-shell.sidebar-collapsed .nav-group.is-collapsed .nav-group-content {
  display: contents;
}

/* ── Staggered entrance animation for nav items ──── */
@keyframes navItemSlideIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

.nav-group:not(.is-collapsed) .nav-group-items .nav-item {
  animation: navItemSlideIn 0.28s var(--ease-out) both;
}
.nav-group:not(.is-collapsed) .nav-group-items .nav-item:nth-child(1) { animation-delay: 0.01s; }
.nav-group:not(.is-collapsed) .nav-group-items .nav-item:nth-child(2) { animation-delay: 0.04s; }
.nav-group:not(.is-collapsed) .nav-group-items .nav-item:nth-child(3) { animation-delay: 0.06s; }
.nav-group:not(.is-collapsed) .nav-group-items .nav-item:nth-child(4) { animation-delay: 0.08s; }
.nav-group:not(.is-collapsed) .nav-group-items .nav-item:nth-child(5) { animation-delay: 0.10s; }

.nav-item,
.ghost-btn,
.primary-btn,
.icon-btn,
.user-chip {
  border: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s var(--ease-out), background 0.2s ease, color 0.2s ease, border 0.2s ease, box-shadow 0.2s var(--ease-out);
}

.nav-item {
  width: 100%;
  justify-content: flex-start;
  min-height: 46px;
  padding: 10px 10px;
  background: transparent;
  color: #c8d5d0;
  font-weight: 750;
  font-size: 15px;
  position: relative;
}

.nav-item::before {
  content: "";
  position: absolute;
  inset: 8px auto 8px 0;
  width: 3px;
  border-radius: 999px;
  background: var(--group-accent, #21d9bb);
  opacity: 0;
  transform: scaleY(0.4);
  box-shadow: 0 0 8px var(--group-accent, #21d9bb);
  transition: opacity 0.22s ease, transform 0.22s var(--ease-out);
}

.nav-item:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(33, 217, 187, 0.03));
  color: #fff;
  transform: translateX(3px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(18, 52, 44, 0.98), rgba(26, 60, 50, 0.92));
  color: #fff;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 0 0 1px color-mix(in srgb, var(--group-accent, #21d9bb) 10%, transparent);
}

.nav-item.active::before {
  opacity: 1;
  transform: scaleY(1);
}

.nav-item svg {
  padding: 2px;
  color: #c2d2cd;
  border-radius: 7px;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-item:hover svg {
  color: var(--group-accent, #dbfffa);
  background: rgba(255, 255, 255, 0.07);
}

.nav-item.active svg {
  color: var(--group-accent, #dbfffa);
  background: rgba(255, 255, 255, 0.08);
}

.nav-item svg,
.primary-btn svg,
.ghost-btn svg,
.icon-btn svg,
.user-chip svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035)),
    rgba(255, 255, 255, 0.04);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 16px 36px rgba(0, 0, 0, 0.18);
}

.sidebar-footer-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sidebar-footer span {
  color: #aab8b2;
  font-size: 13px;
}

.sidebar-footer time {
  color: #d9e8e3;
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
}

.sidebar-footer strong {
  font-size: 30px;
  flex: 0 0 auto;
}

.main {
  min-width: 0;
  padding: 24px;
  animation: mainSettle 0.45s var(--ease-out) both;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 22px;
}

.topbar h1 {
  margin: 4px 0 0;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.08;
  letter-spacing: 0;
  max-width: 900px;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.top-actions {
  display: flex;
  gap: 10px;
}

.primary-btn {
  padding: 0 16px;
  background: linear-gradient(135deg, #0d7b68, #0f947d);
  color: #fff;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 12px 26px rgba(13, 123, 104, 0.18);
}

.primary-btn::after,
.assistant-fab::after {
  content: "";
  position: absolute;
  inset: -40% auto -40% -60%;
  width: 42%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: skewX(-18deg);
  animation: buttonSheen 3.4s ease-in-out infinite;
  transition: left 0.52s var(--ease-out);
}

.primary-btn:hover,
.ghost-btn:hover,
.icon-btn:hover,
.user-chip:hover {
  transform: translateY(-2px);
}

.primary-btn:hover {
  box-shadow: 0 18px 38px rgba(13, 123, 104, 0.24);
}

.primary-btn:hover::after,
.assistant-fab:hover::after {
  left: 118%;
}

@keyframes buttonSheen {
  0%,
  62% {
    left: -60%;
  }

  100% {
    left: 128%;
  }
}

.primary-btn:disabled,
.ghost-btn:disabled,
.icon-btn:disabled,
.user-chip:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.ghost-btn {
  min-height: 38px;
  padding: 0 12px;
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 700;
  border: 1px solid transparent;
}

.icon-btn {
  width: 42px;
  height: 42px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
}

.user-chip {
  min-height: 42px;
  max-width: 210px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  font-weight: 800;
  white-space: nowrap;
}

.user-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.language-toggle {
  width: auto;
  min-width: 78px;
  padding: 0 12px;
  gap: 7px;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0;
}

.language-toggle svg {
  width: 17px;
  height: 17px;
}

.language-toggle span {
  min-width: 24px;
  text-align: center;
}

.ghost-btn:hover,
.icon-btn:hover {
  border-color: rgba(13, 123, 104, 0.22);
  box-shadow: var(--shadow-soft);
}

.panel {
  display: none;
}

.panel.active {
  display: block;
  animation: panelReveal 0.34s var(--ease-out) both;
}

.site-record-footer {
  padding: 24px 12px 4px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.site-record-footer a {
  color: inherit;
  text-decoration: none;
}

.site-record-footer a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.dashboard-panel {
  display: none;
}

.dashboard-panel.active {
  display: grid;
  gap: 18px;
}

.dashboard-hero-panel {
  min-height: 238px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 24px;
  align-items: stretch;
  padding: 26px;
  overflow: hidden;
  position: relative;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  background: linear-gradient(145deg, #ffffff, #fdfdfd);
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.02),
    0 1px 3px rgba(0, 0, 0, 0.01);
}

.dashboard-hero-copy,
.dashboard-signal-board {
  position: relative;
  z-index: 1;
}

.dashboard-hero-copy {
  max-width: 760px;
  align-self: center;
}

.dashboard-hero-copy h2 {
  margin: 6px 0 10px;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  font-weight: 800;
  color: #0a1f1c;
}

.dashboard-hero-copy p:not(.eyebrow) {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.dashboard-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.dashboard-hero-actions .primary-btn,
.dashboard-hero-actions .ghost-btn {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 8px;
}

.dashboard-signal-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-self: end;
}

.dashboard-signal-board article {
  min-height: 148px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 18px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
  transition:
    transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    box-shadow 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.dashboard-signal-board article:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.dashboard-signal-board span,
.dashboard-signal-board small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dashboard-signal-board strong {
  color: var(--ink);
  font-size: 26px;
  line-height: 1;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-card,
.work-panel,
.tool-form,
.result-panel,
.copy-output,
.price-card,
.image-studio {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  transition: transform 0.24s var(--ease-out), box-shadow 0.24s var(--ease-out), border-color 0.24s ease;
}

.metric-card:hover,
.work-panel:hover,
.tool-form:hover,
.result-panel:hover,
.copy-output:hover,
.price-card:hover,
.image-studio:hover {
  transform: translateY(-2px);
  border-color: rgba(13, 123, 104, 0.18);
  box-shadow: var(--shadow-hover);
}

.metric-card {
  padding: 18px;
  position: relative;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
  transition:
    transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    box-shadow 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.metric-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.metric-card[data-target] {
  cursor: pointer;
}

.metric-card[data-target]:focus-visible {
  outline: 3px solid rgba(0, 0, 0, 0.1);
  outline-offset: 3px;
}

.metric-card > * {
  position: relative;
  z-index: 1;
}

.metric-card-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(13, 123, 104, 0.08);
  color: var(--accent);
  z-index: 1;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.3s ease, color 0.3s ease;
}

.metric-card:hover .metric-card-icon {
  transform: rotate(-10deg) scale(1.1);
  background-color: rgba(13, 123, 104, 0.15);
  color: #0f947d;
}

.metric-card span,
.metric-card small {
  display: block;
  color: var(--muted);
}

.metric-card strong {
  display: block;
  margin: 8px 0;
  font-size: 34px;
  letter-spacing: -0.01em;
  line-height: 1;
  font-weight: 800;
  color: #072a26;
}

.metric-bar {
  height: 6px;
  margin: 12px 0 2px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(13, 123, 104, 0.08);
}

.metric-bar i {
  display: block;
  width: var(--value, 0%);
  max-width: 100%;
  height: 100%;
  border-radius: inherit;
  background: #0d7b68;
  transition: width 0.4s cubic-bezier(0.1, 0.76, 0.55, 0.94);
}

.metric-card em {
  display: inline-flex;
  margin-top: 12px;
  min-height: 24px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(13, 123, 104, 0.06);
  color: var(--accent);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  border: 1px solid rgba(13, 123, 104, 0.05);
}

.metric-card[data-state="warning"] .metric-bar i {
  background: linear-gradient(90deg, #d59b24, #e64b3c);
}

.metric-card[data-state="danger"] .metric-bar i {
  background: linear-gradient(90deg, #e64b3c, #d59b24);
}

.dashboard-command {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(520px, 1.35fr);
  gap: 14px;
}

.focus-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-radius: 10px;
  border: 1px solid rgba(13, 123, 104, 0.08);
  padding: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 247, 0.92));
  box-shadow: 0 8px 24px rgba(31, 46, 40, 0.03);
}

.pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: var(--accent);
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
  box-shadow: 0 0 0 0 rgba(13, 123, 104, 0.4);
  animation: pulse-glow 1.8s infinite;
}

@keyframes pulse-glow {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(13, 123, 104, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(13, 123, 104, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(13, 123, 104, 0);
  }
}

.focus-panel .primary-btn {
  flex: 0 0 auto;
  min-width: 118px;
  min-height: 48px;
  padding: 0 22px;
  gap: 10px;
}

.focus-panel h2 {
  margin: 4px 0 8px;
  font-size: 24px;
}

.focus-panel p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.flow-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  position: relative;
}

.flow-step {
  min-height: 86px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 12px;
  background: #ffffff;
  color: var(--ink);
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 5px;
  padding: 14px;
  position: relative;
  overflow: hidden;
  text-align: left;
  z-index: 1;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);
  transition:
    transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    box-shadow 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.flow-step::before {
  content: "0" attr(data-step);
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 24px;
  font-weight: 800;
  color: rgba(0, 0, 0, 0.03);
  line-height: 1;
  pointer-events: none;
  transition: color 0.4s ease, transform 0.4s ease;
}

.flow-step::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.flow-step:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.06);
}

.flow-step:hover::before {
  color: rgba(0, 0, 0, 0.06);
  transform: scale(1.1);
}

.flow-step:hover::after {
  transform: scaleX(1);
}

.flow-step svg {
  width: 19px;
  height: 19px;
  color: var(--accent);
}

.flow-step span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.flow-step strong {
  font-size: 15px;
}

.bi-page {
  display: grid;
  gap: 16px;
}

.bi-page-head {
  align-items: flex-start;
}

.bi-page-head h2 {
  font-size: 28px;
}

.bi-page-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.bi-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.bi-filters select {
  width: auto;
  min-width: 118px;
  min-height: 38px;
  padding: 8px 34px 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  font-weight: 800;
}

.bi-import-panel {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(280px, 1fr);
  gap: 14px;
  align-items: start;
}

.bi-import-copy h2 {
  margin: 4px 0 8px;
  font-size: 20px;
}

.bi-import-copy p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.bi-import-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.bi-file-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.bi-file-button svg {
  width: 16px;
  height: 16px;
}

.bi-file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

#biImportText {
  grid-column: 1 / -1;
  min-height: 96px;
  resize: vertical;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
}

.bi-import-footer {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bi-import-footer span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

#biApplyImport {
  min-width: 128px;
  background: linear-gradient(135deg, #087664, #0a957d);
  color: #ffffff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.18);
}

#biApplyImport span,
#biApplyImport svg {
  color: #ffffff;
  stroke: currentColor;
}

#biApplyImport:disabled {
  background: linear-gradient(135deg, #0b6f60, #087664);
  color: #ffffff;
  opacity: 1;
  filter: saturate(0.86);
}

#biApplyImport:disabled span,
#biApplyImport:disabled svg {
  color: #ffffff;
}

.bi-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.bi-metric-card small {
  min-height: 36px;
}

.bi-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.85fr);
  gap: 16px;
  align-items: stretch;
}

.bi-grid-bottom {
  grid-template-columns: minmax(320px, 0.85fr) minmax(0, 1.55fr);
}

.bi-decision-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.15fr) minmax(280px, 0.95fr) minmax(280px, 1fr);
  gap: 16px;
  align-items: stretch;
}

.bi-trend-panel,
.bi-side-panel,
.bi-action-panel,
.bi-alert-panel,
.bi-summary-panel,
.bi-sku-panel {
  min-width: 0;
}

.bi-alert-list,
.bi-sku-list {
  display: grid;
  gap: 10px;
}

.bi-alert-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.bi-alert-icon {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(13, 123, 104, 0.1);
  color: var(--accent);
}

.bi-alert-icon svg {
  width: 18px;
  height: 18px;
}

.bi-alert-item.warning .bi-alert-icon {
  background: rgba(213, 155, 36, 0.16);
  color: #b47a12;
}

.bi-alert-item.danger .bi-alert-icon {
  background: rgba(230, 75, 60, 0.13);
  color: #d84536;
}

.bi-alert-item strong,
.bi-sku-item strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
}

.bi-alert-item > div > span,
.bi-sku-item small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.bi-alert-item em {
  min-width: 48px;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  text-align: center;
}

.bi-summary-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.bi-health-card {
  min-height: 86px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.bi-health-card span,
.bi-health-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.bi-health-card strong {
  color: var(--ink);
  font-size: 22px;
  line-height: 1.05;
}

.bi-health-card.good {
  border-color: rgba(13, 123, 104, 0.18);
}

.bi-health-card.warning {
  border-color: rgba(213, 155, 36, 0.28);
  background: rgba(213, 155, 36, 0.05);
}

.bi-health-card.danger {
  border-color: rgba(230, 75, 60, 0.26);
  background: rgba(230, 75, 60, 0.05);
}

.bi-sku-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.bi-rank {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(13, 123, 104, 0.1);
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.bi-sku-item em {
  min-width: 34px;
  color: var(--accent);
  font-size: 20px;
  font-style: normal;
  font-weight: 900;
  text-align: right;
}

.bi-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.bi-trend-wrap {
  min-height: 284px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(13, 123, 104, 0.08), rgba(13, 123, 104, 0.01)),
    #fbfcfb;
}

.bi-trend-wrap svg {
  display: block;
  width: 100%;
  height: 284px;
}

.bi-chart-grid {
  stroke: rgba(15, 45, 38, 0.1);
  stroke-width: 1;
}

.bi-chart-area {
  fill: rgba(13, 123, 104, 0.12);
}

.bi-chart-orders {
  fill: none;
  stroke: var(--accent);
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), stroke-width 0.2s ease;
  filter: drop-shadow(0 6px 10px rgba(13, 123, 104, 0.32));
}

.bi-chart-tickets {
  fill: none;
  stroke: var(--gold);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 8 6;
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), stroke-width 0.2s ease;
  filter: drop-shadow(0 6px 10px rgba(213, 155, 36, 0.22));
}

.bi-chart-orders.hidden,
.bi-chart-tickets.hidden,
.bi-chart-area.hidden,
.bi-chart-dot.hidden,
.bi-chart-dot-ticket.hidden {
  opacity: 0 !important;
  pointer-events: none;
}

.bi-chart-dot {
  fill: var(--surface);
  stroke: var(--accent);
  stroke-width: 3;
  transition: r 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), stroke-width 0.2s ease, stroke 0.2s ease, opacity 0.35s ease;
  cursor: pointer;
}

.bi-chart-dot:hover,
.bi-chart-dot.active {
  r: 7.5px;
  stroke-width: 4;
  stroke: #21d9bb;
  filter: drop-shadow(0 0 8px rgba(33, 217, 187, 0.9));
}

.bi-chart-dot-ticket {
  fill: var(--surface);
  stroke: var(--gold);
  stroke-width: 3;
  transition: r 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), stroke-width 0.2s ease, stroke 0.2s ease, opacity 0.35s ease;
  cursor: pointer;
}

.bi-chart-dot-ticket:hover,
.bi-chart-dot-ticket.active {
  r: 7.5px;
  stroke-width: 4;
  stroke: #f2b556;
  filter: drop-shadow(0 0 8px rgba(242, 181, 86, 0.9));
}

.bi-chart-label,
.bi-chart-value,
.bi-legend-btn {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.bi-chart-value,
.bi-legend-btn {
  fill: var(--ink);
}

.bi-legend-btn {
  cursor: pointer;
  user-select: none;
  transition: opacity 0.25s ease, fill 0.25s ease;
}

.bi-legend-btn:hover {
  opacity: 0.8;
  fill: var(--accent);
}

.bi-legend-btn.inactive {
  opacity: 0.3;
  text-decoration: line-through;
}

/* Glassmorphism Tooltip for BI Chart */
.bi-tooltip {
  position: absolute;
  z-index: 1000;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.65));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  border-radius: 10px;
  padding: 10px 14px;
  color: #101816;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  line-height: 1.5;
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translate(-50%, -100%) translateY(-12px);
  opacity: 0;
}

body.dark-theme .bi-tooltip {
  background: linear-gradient(135deg, rgba(16, 24, 22, 0.9), rgba(10, 15, 14, 0.75));
  border-color: rgba(33, 217, 187, 0.22);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: #e5ece9;
}

.bi-tooltip-title {
  font-weight: 800;
  color: #0d7b68;
  margin-bottom: 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

body.dark-theme .bi-tooltip-title {
  color: #21d9bb;
}

.bi-tooltip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
  white-space: nowrap;
}

.bi-tooltip-row svg {
  width: 14px;
  height: 14px;
}

.bi-tooltip-row.orders svg {
  color: var(--accent);
}

.bi-tooltip-row.tickets svg {
  color: var(--gold);
}

.bi-tooltip-row strong {
  margin-left: auto;
  color: #101816;
  font-weight: 800;
}

body.dark-theme .bi-tooltip-row strong {
  color: #fff;
}

/* Metric Trend badges for BI metrics */
.bi-metric-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
  vertical-align: middle;
}

.bi-metric-trend.up {
  background: rgba(33, 217, 187, 0.12);
  color: #0fa388;
}

body.dark-theme .bi-metric-trend.up {
  color: #21d9bb;
}

.bi-metric-trend.down {
  background: rgba(230, 75, 60, 0.12);
  color: #e64b3c;
}

.bi-metric-card-title-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.bi-bar-list {
  display: grid;
  gap: 14px;
}

.bi-bar-row {
  display: grid;
  gap: 7px;
}

.bi-bar-row header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.bi-bar-row strong {
  color: var(--ink);
  font-size: 14px;
}

.bi-bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}

.bi-bar-track i {
  display: block;
  width: var(--value);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #21d9bb);
}

.bi-bar-row.warning .bi-bar-track i {
  background: linear-gradient(90deg, var(--gold), #e64b3c);
}

.bi-action-list {
  display: grid;
  gap: 10px;
}

.bi-action-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.bi-action-item svg {
  width: 19px;
  height: 19px;
  color: var(--accent);
}

.bi-action-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  border-radius: 8px;
  background: rgba(13, 123, 104, 0.1);
}

.bi-action-icon i,
.bi-action-icon svg {
  display: block !important;
  width: 19px !important;
  height: 19px !important;
  margin: 0 !important;
  color: var(--accent) !important;
}

.bi-action-item > div {
  min-width: 0;
}

.bi-action-item > div strong,
.bi-action-item > div span {
  display: block;
}

.bi-action-item > div span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.bi-action-tag {
  min-width: 54px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(213, 155, 36, 0.12);
  color: #a06e11;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.workspace-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.span-7 {
  grid-column: span 7;
}

.span-5 {
  grid-column: span 5;
}

.work-panel,
.tool-form,
.result-panel,
.copy-output,
.price-card,
.image-studio {
  padding: 18px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.section-head h2 {
  margin: 4px 0 0;
  font-size: 22px;
  letter-spacing: 0;
}

.section-head.compact {
  margin-bottom: 14px;
}

.section-head.has-promptlib-toggle {
  justify-content: flex-start;
}

.section-head.has-promptlib-toggle > div:first-child {
  margin-right: auto;
}

.section-head .promptlib-sidebar-toggle {
  position: static;
  right: auto;
  bottom: auto;
  z-index: 1;
  flex: 0 0 auto;
  width: 48px;
  height: 44px;
  min-height: 44px;
  border-radius: 8px;
  background:
    linear-gradient(#f8fbf8, #f8fbf8) padding-box,
    linear-gradient(135deg, rgba(13, 123, 104, 0.3), rgba(213, 155, 36, 0.36)) border-box;
  box-shadow: 0 12px 26px rgba(13, 123, 104, 0.1);
}

.section-head .promptlib-sidebar-toggle:hover {
  transform: translateY(-1px);
}

.product-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.product-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fbfcfb;
  cursor: pointer;
  transition: transform 0.24s var(--ease-out), box-shadow 0.24s var(--ease-out), border-color 0.24s ease;
}

.product-card img {
  width: 100%;
  height: 132px;
  object-fit: cover;
  display: block;
  transition: transform 0.45s var(--ease-out), filter 0.3s ease;
}

.product-card:hover {
  transform: translateY(-2px);
  border-color: rgba(13, 123, 104, 0.2);
  box-shadow: var(--shadow-soft);
}

.product-card:hover img {
  transform: scale(1.035);
  filter: saturate(1.06) contrast(1.02);
}

.product-card div {
  padding: 12px;
}

.product-card strong,
.product-card span {
  display: block;
}

.product-score {
  width: fit-content;
  margin-bottom: 7px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(13, 123, 104, 0.1);
  color: var(--accent) !important;
  font-size: 12px !important;
  font-weight: 800;
}

.product-card span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.creative-board {
  min-height: 238px;
  display: grid;
  grid-template-rows: 1fr auto;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #101816;
  color: #fff;
  cursor: pointer;
  transition: transform 0.24s var(--ease-out), box-shadow 0.24s var(--ease-out);
}

.creative-board:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(16, 24, 22, 0.18);
}

.creative-board img {
  width: 100%;
  height: 178px;
  object-fit: cover;
  display: block;
  transition: transform 0.48s var(--ease-out), filter 0.3s ease;
}

.creative-board:hover img {
  transform: scale(1.035);
  filter: saturate(1.08) contrast(1.04);
}

.creative-board div {
  padding: 13px;
}

.creative-board span {
  display: block;
  margin-top: 4px;
  color: #c8d5cf;
  font-size: 13px;
}

.health-list {
  display: grid;
  gap: 15px;
}

.health-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.health-row:hover {
  background: var(--surface-2);
  border-color: var(--line);
}

.health-row span {
  color: var(--muted);
  font-weight: 700;
}

.health-row strong {
  color: var(--accent);
}

.health-row i {
  grid-column: 1 / -1;
  height: 8px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, var(--accent) var(--value), var(--surface-2) var(--value));
}

.health-row.warning strong {
  color: var(--gold);
}

.health-row.warning i {
  background:
    linear-gradient(90deg, var(--gold) var(--value), var(--surface-2) var(--value));
}

.task-list {
  display: grid;
  gap: 10px;
}

.task-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 12px;
}

.task-form input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fbfcfb;
  color: var(--ink);
  font-weight: 700;
}

.task-list article {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  transition: transform 0.2s var(--ease-out), border-color 0.2s ease, background 0.2s ease;
}

.task-list article:hover {
  transform: translateX(3px);
  border-color: rgba(13, 123, 104, 0.22);
  background: var(--surface-2);
}

.task-list article.done {
  background: rgba(13, 123, 104, 0.04);
}

.task-list article.done strong,
.task-list article.done span {
  text-decoration: line-through;
  opacity: 0.62;
}

.task-list svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
}

.task-check {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  display: grid;
  place-items: center;
  color: var(--accent);
}

.task-check:hover,
.task-actions .icon-btn:hover {
  background: var(--surface-2);
}

.task-actions {
  display: flex;
  gap: 6px;
}

.task-actions .icon-btn {
  width: 34px;
  height: 34px;
  min-height: 34px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
}

.task-list strong,
.task-list span {
  display: block;
}

.task-list span {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.5;
  font-size: 13px;
}

.task-empty {
  color: var(--muted);
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.tool-layout.wide-left {
  grid-template-columns: minmax(360px, 520px) minmax(0, 1fr);
}

.prompt-library-layout {
  align-items: start;
}

.prompt-library-workspace {
  display: grid;
  gap: 16px;
}

.prompt-library-output {
  min-height: 240px;
}

.oneclick-layout {
  align-items: start;
}

.oneclick-layout > .tool-form {
  align-content: start;
  gap: 10px;
  padding: 16px;
}

.oneclick-layout > .tool-form .section-head.compact {
  margin-bottom: 6px;
}

.oneclick-layout > .tool-form label {
  gap: 5px;
}

.oneclick-layout > .tool-form input,
.oneclick-layout > .tool-form select,
.oneclick-layout > .tool-form textarea {
  min-height: 40px;
  padding: 9px 12px;
}

.oneclick-layout > .tool-form textarea {
  min-height: 74px;
}

.oneclick-layout > .tool-form #oneclickFitment {
  min-height: 66px;
}

.oneclick-layout > .tool-form #oneclickFeatures {
  min-height: 76px;
}

.oneclick-workspace {
  display: grid;
  gap: 16px;
}

.oneclick-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  width: 100%;
}

.oneclick-actions .ghost-btn {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  padding: 0 8px;
  font-size: 13.5px;
  gap: 6px;
  justify-content: center;
  white-space: nowrap;
}

/* ---- Generate All Master Button ---- */
.oneclick-generate-all {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 54px;
  padding: 13px 20px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #0d7b68 0%, #0a6455 50%, #0e8c77 100%);
  background-size: 200% 200%;
  color: #fff;
  font-weight: 750;
  font-size: 15px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  gap: 3px;
  transition: transform 0.22s var(--ease-out), box-shadow 0.3s ease;
  animation: generateAllGradient 4s ease infinite;
}

@keyframes generateAllGradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.oneclick-generate-all:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(13, 123, 104, 0.32);
}

.oneclick-generate-all:active {
  transform: translateY(0);
}

.generate-all-main {
  display: flex;
  align-items: center;
  gap: 8px;
}

.generate-all-main svg {
  width: 18px;
  height: 18px;
}

.generate-all-sub {
  font-size: 12px;
  font-weight: 500;
  opacity: 0.72;
}

.oneclick-generate-all:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none;
  animation: none;
}

.oneclick-generate-all.is-generating {
  animation: none;
  background: linear-gradient(135deg, #0a6455, #0d7b68);
}

.oneclick-generate-all.is-generating::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
  animation: oneclickBarSweep 1.5s ease-in-out infinite;
}

@keyframes oneclickBarSweep {
  0% { width: 30%; left: -30%; }
  100% { width: 30%; left: 100%; }
}

/* ---- SVG Progress Ring ---- */
.oneclick-progress-ring {
  position: relative;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}

.oneclick-progress-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: var(--line);
  stroke-width: 4;
}

.ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 163.36;
  stroke-dashoffset: 163.36;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 750;
  color: var(--ink);
}

/* ---- Checklist Steps (clickable, numbered) ---- */
.oneclick-checklist {
  display: grid;
  gap: 12px;
}

.oneclick-step {
  position: relative;
  display: grid;
  gap: 5px;
  padding: 13px 14px 13px 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(13, 123, 104, 0.055), transparent 46%),
    #fbfcfb;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.oneclick-step:hover {
  border-color: rgba(13, 123, 104, 0.28);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.oneclick-step::before {
  display: none;
}

.step-number {
  position: absolute;
  left: 12px;
  top: 15px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  background: var(--surface-2);
  color: var(--muted);
  border: 1.5px solid var(--line);
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.oneclick-step.done .step-number {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(13, 123, 104, 0.25);
}

.oneclick-step.generating {
  border-color: var(--accent);
}

.oneclick-step.generating .step-number {
  animation: stepPulse 1.2s ease-in-out infinite;
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

@keyframes stepPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(13, 123, 104, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(13, 123, 104, 0); }
}

.oneclick-step strong,
.oneclick-step > span:not(.step-number) {
  display: block;
}

.oneclick-step > span:not(.step-number) {
  color: var(--muted);
  line-height: 1.55;
  font-size: 13px;
}

/* ---- Package Output ---- */
.oneclick-package {
  min-height: 180px;
}

.oneclick-package .section-head.compact {
  margin-bottom: 10px;
}

#oneclickPackage {
  display: grid;
  gap: 6px;
  white-space: normal;
}

.package-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 20px;
  gap: 10px;
  color: var(--muted);
}

.package-placeholder svg {
  width: 36px;
  height: 36px;
  opacity: 0.4;
}

.package-placeholder p {
  font-size: 13px;
  line-height: 1.6;
  max-width: 340px;
}

.package-section {
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 6px;
}

.package-section-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  background: var(--surface-2);
  font-size: 13px;
  border-bottom: 1px solid var(--line);
}

.package-section-head svg {
  width: 14px;
  height: 14px;
  color: var(--accent);
  flex-shrink: 0;
}

.package-section-head strong {
  flex: 1;
}

.package-copy-btn {
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
}

.package-copy-btn svg {
  width: 13px;
  height: 13px;
}

.package-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
}

.package-badge.done {
  background: rgba(13, 123, 104, 0.12);
  color: var(--accent);
}

.package-badge.pending {
  background: rgba(0, 0, 0, 0.06);
  color: var(--muted);
}

.package-section-body {
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}

.package-section-body.markdown-body {
  white-space: normal;
}

.package-section-body.markdown-body h3 {
  margin: 8px 0 4px;
  font-size: 13px;
}

.package-section-body.markdown-body ul {
  margin: 5px 0 8px;
  padding-left: 18px;
}

.package-section-body.markdown-body blockquote {
  margin: 6px 0;
  padding: 6px 8px;
}

.package-section:not(:first-child) .package-section-body {
  max-height: 170px;
  overflow: auto;
}

.package-image-body {
  display: grid;
  gap: 8px;
  white-space: normal;
  max-height: 240px;
}

.package-image-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.package-image-toolbar p {
  margin: 0;
  color: var(--ink);
  line-height: 1.45;
}

.package-image-download-all {
  min-width: 94px;
  justify-content: center;
  min-height: 32px;
  padding: 0 10px;
}

.package-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 144px));
  gap: 8px;
  justify-content: start;
}

.package-image-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  max-width: 144px;
}

.package-image-preview {
  aspect-ratio: 1 / 1;
  max-height: 144px;
  background: #f7faf8;
  border-bottom: 1px solid var(--line);
}

.package-image-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.package-image-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 7px;
}

.package-image-meta div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.package-image-meta strong {
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.package-image-meta span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.package-image-meta .icon-btn {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

.package-info-grid {
  padding: 7px 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 10px;
}

.package-info-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 6px;
  font-size: 12px;
  line-height: 1.45;
  min-width: 0;
}

.package-info-row:nth-child(n + 3) {
  grid-column: 1 / -1;
}

.package-info-row span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.package-label {
  color: var(--muted);
  min-width: 0;
  flex-shrink: 0;
}

.package-reminder {
  display: flex;
  gap: 6px;
  padding: 7px 10px;
  margin-top: 0;
  border-radius: 6px;
  background: rgba(234, 179, 8, 0.08);
  border: 1px solid rgba(234, 179, 8, 0.2);
  font-size: 12px;
  line-height: 1.45;
  color: #92791c;
  align-items: flex-start;
}

.package-reminder span {
  flex: 1;
  min-width: 0;
}

.package-reminder > svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  margin-top: 2px;
}

.oneclick-reset-btn {
  /* margin-left: auto removed to allow alignment on the same row with equal width */
}

#oneclickStatusPill.pill-done {
  background: rgba(13, 123, 104, 0.12);
  color: var(--accent);
}

.prompt-template-panel {
  display: grid;
  gap: 14px;
}

.prompt-library-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.prompt-template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.prompt-template-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 24px rgba(20, 30, 27, 0.05);
}

.prompt-template-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
}

.prompt-template-meta {
  display: grid;
  gap: 8px;
}

.prompt-template-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.prompt-template-meta strong {
  font-size: 15px;
}

.role-pill {
  background: rgba(214, 144, 63, 0.12);
  color: #9b5d11;
}

.platform-pill {
  background: rgba(67, 104, 214, 0.12);
  color: #3757a6;
}

.prompt-template-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.prompt-template-actions > .ghost-btn,
.prompt-template-actions > .promptlib-card-send {
  flex: 0 0 auto;
}

.prompt-template-actions > .ghost-btn,
.promptlib-card-send-toggle {
  height: 38px;
  min-height: 38px;
  line-height: 1;
}

.prompt-template-empty {
  padding: 22px 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
}

.prompt-template-empty strong,
.prompt-template-empty span {
  display: block;
}

.prompt-template-empty span {
  margin-top: 6px;
}

/* ── Prompt Library: Send Targets ── */
.promptlib-send-targets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.promptlib-send-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-right: 4px;
}

.promptlib-send-btn {
  min-height: 28px;
  padding: 0 10px;
  font-size: 11px;
}

.promptlib-send-btn svg {
  width: 13px;
  height: 13px;
}

/* ── Prompt Library: Card Send Menu ── */
.promptlib-card-send {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 38px;
  min-height: 38px;
  vertical-align: top;
}

.promptlib-card-send-menu {
  position: absolute;
  bottom: 100%;
  left: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  min-width: 200px;
}

.promptlib-card-send-menu[hidden] {
  display: none;
}

.promptlib-card-send-menu .ghost-btn {
  font-size: 11px;
  min-height: 26px;
  padding: 0 8px;
  gap: 4px;
}

.promptlib-card-send-menu .ghost-btn svg {
  width: 12px;
  height: 12px;
}

/* ── Prompt Library: Usage Badge ── */
.promptlib-usage-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(13, 123, 104, 0.08);
  padding: 2px 6px;
  border-radius: 999px;
}

/* ── Prompt Library: Custom Template Pill ── */
.custom-pill {
  background: rgba(234, 179, 8, 0.12);
  color: rgba(180, 130, 0, 1);
  border-color: rgba(234, 179, 8, 0.3);
}

.prompt-template-card.custom-template {
  border-left: 3px solid rgba(234, 179, 8, 0.6);
}

/* ── Prompt Library: Search Bar ── */
.promptlib-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  margin-bottom: 12px;
  transition: border-color 0.2s ease;
}

.promptlib-search-bar:focus-within {
  border-color: var(--accent);
}

.promptlib-search-bar svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
  flex-shrink: 0;
}

.promptlib-search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 13px;
  outline: none;
  min-width: 0;
}

/* ── Prompt Library: Template Toolbar ── */
.promptlib-template-toolbar {
  display: flex;
  gap: 8px;
}

/* ── Prompt Library: Global Sidebar ── */
.promptlib-sidebar {
  position: fixed;
  top: 0;
  right: -360px;
  width: 350px;
  height: 100vh;
  z-index: 1200;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.08);
  display: grid;
  grid-template-rows: auto auto 1fr;
  transition: right 0.3s ease;
  overflow: hidden;
}

.promptlib-sidebar.open {
  right: 0;
}

.promptlib-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.promptlib-sidebar-header strong {
  font-size: 15px;
  font-weight: 800;
}

.promptlib-sidebar-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}

.promptlib-sidebar-search-wrap svg {
  width: 15px;
  height: 15px;
  color: var(--muted);
}

.promptlib-sidebar-search-wrap input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 13px;
  outline: none;
}

.promptlib-sidebar-content {
  overflow-y: auto;
  padding: 12px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.promptlib-sidebar-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  cursor: default;
  transition: border-color 0.2s ease;
}

.promptlib-sidebar-item:hover {
  border-color: rgba(13, 123, 104, 0.25);
}

.promptlib-sidebar-item-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.promptlib-sidebar-item-head strong {
  font-size: 13px;
  font-weight: 700;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.promptlib-sidebar-item p {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.promptlib-sidebar-item-actions {
  display: flex;
  gap: 6px;
}

.promptlib-sidebar-item-actions .ghost-btn {
  min-height: 26px;
  padding: 0 8px;
  font-size: 11px;
}

.promptlib-sidebar-item-actions .ghost-btn svg {
  width: 12px;
  height: 12px;
}

.promptlib-sidebar-empty {
  text-align: center;
  padding: 30px 16px;
  color: var(--muted);
  font-size: 13px;
}

/* ── Prompt Library: Sidebar Toggle Button ── */
.promptlib-sidebar-toggle {
  position: fixed;
  right: 16px;
  bottom: 80px;
  z-index: 1100;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.promptlib-sidebar-toggle:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 6px 20px rgba(13, 123, 104, 0.15);
}

.promptlib-sidebar-toggle svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
}

/* ── Prompt Library: Custom Template Modal ── */
.promptlib-custom-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
}

.promptlib-custom-modal[hidden] {
  display: none;
}

.promptlib-custom-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.promptlib-custom-modal-body {
  position: relative;
  width: min(500px, 90vw);
  max-height: 85vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  display: grid;
  gap: 14px;
}

.promptlib-custom-modal-body h3 {
  font-size: 16px;
  font-weight: 800;
  margin: 0;
}

.promptlib-custom-modal-body label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.promptlib-custom-modal-body input,
.promptlib-custom-modal-body select,
.promptlib-custom-modal-body textarea {
  font-size: 13px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.promptlib-custom-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
}

.webtools-layout {
  display: grid;
  gap: 16px;
}

.webtools-head {
  display: grid;
  gap: 14px;
}

.webtools-controls {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 220px;
  gap: 12px;
  align-items: end;
}

.webtools-search {
  position: relative;
}

.webtools-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 16px;
  height: 16px;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.webtools-search input {
  padding-left: 38px;
}

.webtools-grid {
  display: grid;
  gap: 18px;
}

.webtool-group {
  display: grid;
  gap: 10px;
}

.webtool-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
}

.webtool-group-head strong {
  font-size: 16px;
}

.webtool-group-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.webtool-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.webtool-card,
.webtool-empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 26px rgba(31, 46, 40, 0.06);
}

.webtool-card {
  display: grid;
  gap: 12px;
  min-height: 168px;
  padding: 14px;
}

.webtool-card-head {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 10px;
}

.webtool-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #fff;
  color: var(--accent);
  border: 1px solid rgba(13, 123, 104, 0.12);
  overflow: hidden;
}

.webtool-icon img {
  width: 24px;
  height: 24px;
  display: block;
  object-fit: contain;
}

.webtool-icon svg {
  width: 18px;
  height: 18px;
}

.webtool-card-head strong,
.webtool-card-head em {
  display: block;
}

.webtool-card-head strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.webtool-card-head em {
  margin-top: 2px;
  color: var(--accent);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.webtool-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.webtool-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-self: end;
}

.webtool-tags span {
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.webtool-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 42px 18px;
  color: var(--muted);
  text-align: center;
}

.webtool-empty svg {
  width: 34px;
  height: 34px;
  color: var(--accent);
}

.tool-form {
  display: grid;
  gap: 13px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  padding: 11px 12px;
  outline: 0;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 123, 104, 0.12);
  transform: translateY(-1px);
}

.provider-select-shell {
  position: relative;
  width: 100%;
  z-index: 8;
}

.provider-select-shell.is-open,
.platform-select-shell.is-open {
  z-index: 40;
}

.provider-native-select,
.platform-native-select {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.provider-select-button,
.provider-select-option,
.platform-select-button,
.platform-select-option {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  font-weight: 800;
  text-align: left;
}

.provider-select-button,
.platform-select-button {
  padding: 9px 12px;
  justify-content: flex-start;
}

.provider-select-button:hover,
.provider-select-shell.is-open .provider-select-button,
.platform-select-button:hover,
.platform-select-shell.is-open .platform-select-button {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 123, 104, 0.12);
}

.provider-select-button > svg,
.platform-select-button > svg {
  width: 16px;
  height: 16px;
  margin-left: auto;
  color: var(--muted);
  transition: transform 0.18s ease;
}

.provider-select-shell.is-open .provider-select-button > svg,
.platform-select-shell.is-open .platform-select-button > svg {
  transform: rotate(180deg);
}

.provider-select-label,
.platform-select-label {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.provider-logo {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 7px;
  border: 1px solid rgba(13, 123, 104, 0.14);
  background: #fff;
  overflow: hidden;
  box-shadow: 0 5px 12px rgba(31, 46, 40, 0.06);
}

.provider-logo img,
.provider-logo svg {
  width: 22px;
  height: 22px;
  display: block;
  object-fit: contain;
}

.provider-logo b {
  color: var(--accent);
  font-size: 9px;
  line-height: 1;
  letter-spacing: 0;
}

.platform-select-shell {
  position: relative;
  width: 100%;
  z-index: 8;
}

.platform-logo {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  box-shadow: 0 8px 18px rgba(31, 46, 40, 0.13);
}

.platform-logo b {
  display: block;
  transform: translateY(-0.5px);
}

.platform-logo svg {
  width: 100%;
  height: 100%;
  display: block;
}

.platform-logo-amazon {
  background: linear-gradient(145deg, #232f3e 0%, #111827 62%, #ff9900 63%);
  color: #ff9900;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
}

.platform-logo-shopify {
  background: linear-gradient(145deg, #95bf47, #5e8e3e);
}

.platform-logo-tiktok {
  background:
    linear-gradient(135deg, rgba(37, 244, 238, 0.82), transparent 45%),
    linear-gradient(315deg, rgba(254, 44, 85, 0.88), transparent 45%),
    #080808;
  font-size: 17px;
}

.platform-logo-ebay {
  background: #fff;
  color: #e53238;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.platform-logo-walmart {
  background: #0071ce;
  color: #ffc220;
  font-size: 16px;
}

.platform-logo-aliexpress {
  background: linear-gradient(145deg, #ff4747, #ff8a00);
  font-size: 11px;
}

.platform-logo-temu {
  background: #ff6a00;
}

.platform-logo-shein {
  background: #111827;
  font-size: 11px;
}

.platform-logo-default {
  background: var(--accent);
}

.provider-select-menu,
.platform-select-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  display: none;
  max-height: 320px;
  overflow: auto;
  padding: 6px;
  border: 1px solid rgba(13, 123, 104, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 22px 48px rgba(31, 46, 40, 0.16);
}

.provider-select-shell.is-open .provider-select-menu,
.platform-select-shell.is-open .platform-select-menu {
  display: grid;
  gap: 3px;
}

.provider-select-option,
.platform-select-option {
  min-height: 38px;
  padding: 7px 9px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.provider-select-option:hover,
.provider-select-option.is-selected,
.platform-select-option:hover,
.platform-select-option.is-selected {
  background: rgba(13, 123, 104, 0.09);
  border-color: rgba(13, 123, 104, 0.12);
}

.provider-select-option.is-selected,
.platform-select-option.is-selected {
  color: var(--accent);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.selection-advanced-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.selection-preference-groups {
  display: grid;
  gap: 10px;
}

.selection-preference-group {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
}

.selection-preference-group > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.check-chip {
  width: auto;
  display: inline-flex;
  grid-template-columns: auto;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  transition: transform 0.18s var(--ease-out), background 0.18s ease, box-shadow 0.18s ease;
}

.check-chip input {
  width: auto;
}

.check-chip:hover {
  transform: translateY(-1px);
  background: rgba(13, 123, 104, 0.1);
  box-shadow: 0 8px 18px rgba(31, 46, 40, 0.07);
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.selection-table {
  min-width: 1040px;
}

th,
td {
  text-align: left;
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
}

.score {
  color: var(--accent);
  font-weight: 800;
}

.selection-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.selection-overview article {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(13, 123, 104, 0.08), rgba(255, 255, 255, 0.72));
  display: grid;
  gap: 4px;
}

.selection-overview span,
.selection-overview small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.selection-overview strong {
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.selection-main-row.is-open td {
  background: rgba(13, 123, 104, 0.04);
}

.selection-product-cell {
  display: grid;
  gap: 5px;
  min-width: 180px;
}

.selection-product-cell strong {
  color: var(--ink);
  font-size: 15px;
}

.selection-product-cell span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.selection-score,
.selection-risk,
.selection-level {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.selection-score {
  color: var(--accent);
  background: rgba(13, 123, 104, 0.1);
}

.selection-score.high {
  color: #087560;
  background: rgba(13, 123, 104, 0.14);
}

.selection-score.medium {
  color: #9a6a00;
  background: rgba(212, 160, 23, 0.14);
}

.selection-score.low {
  color: #a43f36;
  background: rgba(196, 67, 54, 0.1);
}

.selection-level {
  color: var(--ink);
  background: var(--surface-2);
}

.selection-risk.low {
  color: #087560;
  background: rgba(13, 123, 104, 0.1);
}

.selection-risk.medium {
  color: #9a6a00;
  background: rgba(212, 160, 23, 0.14);
}

.selection-risk.high {
  color: #a43f36;
  background: rgba(196, 67, 54, 0.12);
}

.selection-row-actions {
  display: flex;
  gap: 6px;
  min-width: 190px;
}

.selection-row-actions .icon-btn {
  width: 34px;
  height: 34px;
  min-height: 34px;
}

.selection-detail-row td {
  padding: 0 12px 14px;
  border-bottom: 1px solid var(--line);
}

.selection-detail-card {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(13, 123, 104, 0.16);
  border-radius: 8px;
  background: rgba(13, 123, 104, 0.045);
}

.selection-breakdown {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 10px;
}

.selection-breakdown div {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.selection-breakdown span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.selection-breakdown strong {
  color: var(--ink);
  font-size: 20px;
}

.selection-breakdown i {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) var(--value), rgba(13, 123, 104, 0.12) var(--value));
}

.selection-decision-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 10px;
}

.selection-decision-grid article {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.selection-decision-grid strong {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 13px;
}

.selection-decision-grid p,
.selection-decision-grid ul {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.selection-decision-grid ul {
  padding-left: 18px;
}

.selection-decision-grid li + li {
  margin-top: 4px;
}

.selection-market-summary {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.selection-market-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.selection-market-head div {
  display: grid;
  gap: 4px;
}

.selection-market-head strong {
  color: var(--ink);
  font-size: 15px;
}

.selection-market-head span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.selection-market-results {
  display: grid;
  gap: 8px;
}

.selection-market-card {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.selection-market-card > span {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(13, 123, 104, 0.1);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.selection-market-card a {
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.selection-market-card p {
  margin: 5px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.selection-market-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selection-market-empty {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(13, 123, 104, 0.05);
  font-size: 13px;
  line-height: 1.6;
}

.openclaw-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.openclaw-hero {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.openclaw-hero p:last-child {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.openclaw-chat-panel,
.openclaw-config {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.openclaw-chat-panel {
  min-height: 640px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
}

.openclaw-messages {
  min-height: 0;
  max-height: 640px;
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 18px;
  overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(13, 123, 104, 0.035), transparent 32%),
    var(--surface);
}

.openclaw-message {
  max-width: min(760px, 92%);
  display: grid;
  gap: 6px;
}

.openclaw-message.user {
  justify-self: end;
}

.openclaw-message-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.openclaw-message.user .openclaw-message-head {
  text-align: right;
}

.openclaw-message-body {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 123, 104, 0.055);
  color: var(--ink);
  line-height: 1.65;
}

.openclaw-message.user .openclaw-message-body {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.openclaw-message-body > *:first-child {
  margin-top: 0;
}

.openclaw-message-body > *:last-child {
  margin-bottom: 0;
}

.openclaw-starter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.openclaw-starter-actions button {
  min-height: 32px;
  border: 1px solid rgba(13, 123, 104, 0.18);
  border-radius: 8px;
  padding: 0 10px;
  background: rgba(13, 123, 104, 0.08);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.openclaw-composer {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
}

.openclaw-composer textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
}

.openclaw-composer textarea:focus {
  border-color: rgba(13, 123, 104, 0.45);
  box-shadow: 0 0 0 4px rgba(13, 123, 104, 0.1);
}

.openclaw-composer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.openclaw-config {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.openclaw-config label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.openclaw-config input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
}

.status-pill,
.score-badge {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(13, 123, 104, 0.1);
  color: var(--accent);
  font-weight: 800;
  font-size: 12px;
}

pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: Inter, "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.65;
}

.generated-pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: Inter, "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.65;
}

.generated-pre .markdown-body {
  white-space: normal;
}

.ai-loading-card {
  min-height: 160px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  padding: 28px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at center, rgba(13, 123, 104, 0.12), transparent 36%),
    var(--surface-2);
  color: var(--muted);
  text-align: center;
  white-space: normal;
  position: relative;
  overflow: hidden;
}

.ai-loading-card::after,
.attribute-loading::after,
.price-ai-card.pricing-loading::after,
.image-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.36) 48%, transparent 72%);
  transform: translateX(-100%);
  animation: surfaceSweep 1.8s ease-in-out infinite;
  pointer-events: none;
}

.ai-loading-card strong {
  color: var(--ink);
  font-size: 17px;
}

.ai-loading-card small {
  max-width: 320px;
  font-weight: 700;
  line-height: 1.5;
}

.ai-loader-dots {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 24px;
}

.ai-loader-dots span {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: var(--accent);
  animation: aiDotsPulse 0.9s ease-in-out infinite;
}

.ai-loader-dots span:nth-child(2) {
  background: var(--gold);
  animation-delay: 0.12s;
}

.ai-loader-dots span:nth-child(3) {
  background: var(--accent-2);
  animation-delay: 0.24s;
}

@keyframes aiDotsPulse {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }

  50% {
    transform: translateY(-7px);
    opacity: 1;
  }
}

.title-results {
  display: grid;
  gap: 12px;
}

.attribute-output {
  max-height: 68vh;
  overflow: auto;
}

.attribute-result-wrap {
  position: relative;
  min-height: 420px;
}

.attribute-loading {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  border-radius: 8px;
  background:
    radial-gradient(circle at center, rgba(13, 123, 104, 0.12), transparent 34%),
    rgba(248, 251, 248, 0.94);
  border: 1px solid var(--line);
  text-align: center;
}

.attribute-loading[hidden] {
  display: none;
}

.attribute-loading strong {
  color: var(--ink);
  font-size: 18px;
}

.attribute-loading small {
  max-width: 300px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.55;
}

.attribute-loader {
  display: flex;
  gap: 7px;
  align-items: center;
}

.attribute-loader span {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent);
  animation: attributePulse 0.9s ease-in-out infinite;
}

.attribute-loader span:nth-child(2) {
  animation-delay: 0.12s;
  background: var(--gold);
}

.attribute-loader span:nth-child(3) {
  animation-delay: 0.24s;
  background: var(--accent-2);
}

@keyframes attributePulse {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  50% {
    transform: translateY(-8px);
    opacity: 1;
  }
}

.attribute-table {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}

.attribute-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.45fr) minmax(0, 1fr);
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.attribute-row span {
  color: var(--muted);
  font-weight: 700;
}

.attribute-row strong {
  color: var(--ink);
  line-height: 1.45;
}

.title-card,
.optimization-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.title-card strong {
  display: block;
  line-height: 1.5;
}

.title-card span,
.optimization-card span {
  display: block;
  color: var(--muted);
  margin-top: 8px;
  font-size: 13px;
}

.ai-text {
  white-space: pre-wrap;
  line-height: 1.65;
}

.optimizer-output {
  display: grid;
  gap: 12px;
}

.input-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.model-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.model-fetch-btn {
  min-height: 42px;
  padding: 0 14px;
}

.model-picker-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

.model-picker-row input {
  min-width: 0;
}

.model-picker-row .model-fetch-btn {
  white-space: nowrap;
}

.model-select-list {
  margin-top: 8px;
}

.ai-model-picker-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.ai-model-picker-row input {
  min-width: 0;
}

.ai-model-picker-row .model-fetch-btn {
  min-height: 42px;
  padding: 0 12px;
  white-space: nowrap;
}

.ai-model-picker-row .model-fetch-btn svg {
  width: 16px;
  height: 16px;
}

.ai-model-select {
  margin-top: 8px;
}

.ai-model-select:disabled {
  color: var(--muted);
  background: rgba(244, 248, 245, 0.78);
}

.image-upload-panel {
  display: grid;
  gap: 10px;
}

.image-upload-panel[hidden] {
  display: none;
}

.image-upload-drop {
  min-height: 138px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 18px;
  border: 1px dashed rgba(13, 123, 104, 0.28);
  border-radius: 8px;
  background:
    radial-gradient(circle at center, rgba(13, 123, 104, 0.08), transparent 42%),
    var(--surface-2);
  text-align: center;
  cursor: pointer;
}

.image-upload-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.image-upload-drop span {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(13, 123, 104, 0.12);
  color: var(--accent);
}

.image-upload-drop strong,
.image-upload-drop small {
  display: block;
}

.image-upload-drop small {
  max-width: 360px;
  color: var(--muted);
  line-height: 1.5;
}

.uploaded-image-preview {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.uploaded-image-preview[hidden] {
  display: none;
}

.uploaded-image-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 8px;
}

.uploaded-image-item {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.uploaded-image-item img {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.uploaded-image-meta {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding-right: 24px;
}

.uploaded-image-meta strong {
  font-size: 12px;
  color: var(--ink);
}

.uploaded-image-meta small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: var(--muted);
}

.uploaded-image-remove {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 26px;
  height: 26px;
  border-radius: 7px;
}

.uploaded-image-preview .ghost-btn {
  justify-self: end;
  min-height: 34px;
  padding: 0 10px;
}

.imagebed-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(0, 1.15fr);
  gap: 18px;
  align-items: start;
}

.imagebed-uploader form {
  display: grid;
  gap: 14px;
}

.imagebed-drop {
  min-height: 200px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 22px;
  border: 2px dashed rgba(13, 123, 104, 0.28);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(13, 123, 104, 0.03), rgba(234, 179, 8, 0.02));
  text-align: center;
  cursor: pointer;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.imagebed-drop.dragging,
.imagebed-drop:hover {
  border-color: rgba(13, 123, 104, 0.72);
  background: linear-gradient(135deg, rgba(13, 123, 104, 0.08), rgba(234, 179, 8, 0.04));
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(13, 123, 104, 0.1);
}

.imagebed-drop.dragging {
  border-style: solid;
  animation: imagebed-pulse 1.2s ease-in-out infinite;
}

@keyframes imagebed-pulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(13, 123, 104, 0.1); }
  50% { box-shadow: 0 8px 32px rgba(13, 123, 104, 0.2); }
}

.imagebed-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.imagebed-drop span {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(13, 123, 104, 0.14), rgba(13, 123, 104, 0.06));
  color: var(--accent);
  transition: transform 0.3s ease;
}

.imagebed-drop:hover span {
  transform: scale(1.1);
}

.imagebed-drop strong,
.imagebed-drop small {
  display: block;
}

.imagebed-drop small {
  max-width: 360px;
  color: var(--muted);
  line-height: 1.5;
}

.imagebed-prefix-presets,
.imagebed-quick-settings,
.imagebed-filterbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.imagebed-prefix-presets button,
.imagebed-format-segments button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.imagebed-prefix-presets button:hover,
.imagebed-format-segments button:hover,
.imagebed-format-segments button.active {
  border-color: rgba(13, 123, 104, 0.38);
  background: rgba(13, 123, 104, 0.08);
  color: var(--accent);
}

.imagebed-quick-settings {
  justify-content: space-between;
}

.imagebed-format-segments {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.imagebed-format-segments button {
  border-color: transparent;
  background: transparent;
}

.imagebed-format-segments button.active {
  background: var(--surface);
  box-shadow: 0 1px 8px rgba(13, 123, 104, 0.12);
}

.imagebed-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.imagebed-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.imagebed-domain-preview {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(13, 123, 104, 0.18);
  border-radius: 8px;
  background: rgba(13, 123, 104, 0.055);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  word-break: break-all;
}

.imagebed-progress-bar {
  height: 6px;
  border-radius: 4px;
  background: var(--surface-2);
  overflow: hidden;
  border: 1px solid var(--line);
}

.imagebed-progress-bar[hidden] {
  display: none;
}

.imagebed-progress-fill {
  height: 100%;
  width: 0;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), rgba(13, 123, 104, 0.7));
  transition: width 0.4s ease;
}

.imagebed-file-list,
.imagebed-result-list {
  display: grid;
  gap: 10px;
}

.imagebed-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.imagebed-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.imagebed-file {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  transition: border-color 0.2s ease, transform 0.15s ease;
}

.imagebed-file:hover {
  border-color: rgba(13, 123, 104, 0.22);
  transform: translateX(2px);
}

.imagebed-file > span {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(13, 123, 104, 0.1);
  color: var(--accent);
}

.imagebed-file strong,
.imagebed-file small {
  display: block;
}

.imagebed-file strong,
.imagebed-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.imagebed-file small,
.imagebed-card small {
  color: var(--muted);
}

.imagebed-empty {
  min-height: 220px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  background: var(--surface-2);
}

.imagebed-empty svg {
  color: var(--accent);
}

.imagebed-card {
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.imagebed-thumb {
  width: 124px;
  aspect-ratio: 1;
  display: block;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.imagebed-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.imagebed-card-body {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.imagebed-card-body input {
  width: 100%;
  min-height: 38px;
  font-size: 12px;
}

.imagebed-folder {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.imagebed-folder-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.imagebed-folder-toggle {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.imagebed-folder-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(13, 123, 104, 0.1);
  color: var(--accent);
  flex: 0 0 auto;
}

.imagebed-folder-meta {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.imagebed-folder-meta strong,
.imagebed-folder-meta small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.imagebed-folder-meta small {
  color: var(--muted);
}

.imagebed-folder-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
  padding-left: 30px;
}

.imagebed-folder-actions .ghost-btn {
  flex: 0 1 auto;
  min-width: max-content;
  overflow: visible;
  white-space: nowrap;
}

.imagebed-folder-body {
  display: grid;
  gap: 10px;
}

.imagebed-folder-body[hidden] {
  display: none;
}

.imagebed-folder-list {
  display: grid;
  gap: 10px;
}

.imagebed-card {
  position: relative;
}

.imagebed-card-select {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--accent);
}

.imagebed-card.selected {
  border-color: rgba(13, 123, 104, 0.42);
  box-shadow: 0 0 0 1px rgba(13, 123, 104, 0.14);
}

.imagebed-card.selected .imagebed-thumb {
  border-color: rgba(13, 123, 104, 0.42);
}

.imagebed-results {
  display: grid;
  gap: 14px;
}

.imagebed-header-actions,
.imagebed-selection-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.imagebed-selection-info {
  align-items: flex-start;
  flex-direction: column;
  gap: 5px;
}

.imagebed-selection-info small {
  color: var(--muted);
  line-height: 1.4;
}

.imagebed-viewbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.imagebed-view-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.imagebed-view-tabs button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.imagebed-view-tabs button svg {
  width: 16px;
  height: 16px;
}

.imagebed-view-tabs button:hover,
.imagebed-view-tabs button.active {
  border-color: rgba(13, 123, 104, 0.28);
  background: var(--surface);
  color: var(--accent);
}

.imagebed-view-state {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 8px;
  background: rgba(13, 123, 104, 0.08);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.imagebed-filterbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 150px;
}

.imagebed-search {
  min-width: 0;
  min-height: 42px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}

.imagebed-search input {
  min-height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
}

.imagebed-filterbar select {
  min-height: 42px;
}

.imagebed-manager-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.imagebed-manager-stats div {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(13, 123, 104, 0.06), rgba(234, 179, 8, 0.03)),
    var(--surface-2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.imagebed-manager-stats div:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(13, 123, 104, 0.08);
}

.imagebed-manager-stats span,
.imagebed-manager-stats strong {
  display: block;
}

.imagebed-manager-stats span {
  color: var(--muted);
  font-size: 12px;
}

.imagebed-manager-stats strong {
  margin-top: 4px;
  color: var(--text);
  font-size: 20px;
  line-height: 1.1;
}

.imagebed-queue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 2px 0;
  color: var(--muted);
  font-size: 13px;
}

.imagebed-queue-head span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-weight: 800;
}

.imagebed-file {
  grid-template-columns: 40px minmax(0, 1fr) auto auto;
}

.imagebed-file em {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(13, 123, 104, 0.1);
  color: var(--accent);
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.imagebed-file em[data-state="uploading"] {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
}

.imagebed-file em[data-state="done"] {
  background: rgba(13, 123, 104, 0.12);
  color: var(--accent);
}

.imagebed-file em[data-state="error"] {
  background: rgba(230, 75, 60, 0.1);
  color: #d9493d;
}

.imagebed-file em[data-state="uploading"] {
  animation: imagebed-uploading-pulse 1s ease-in-out infinite;
}

@keyframes imagebed-uploading-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.imagebed-upload-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
  transition: width 0.3s ease;
}

.imagebed-row-thumb {
  position: relative;
}

.imagebed-row-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: rgba(13, 123, 104, 0);
  transition: background 0.2s ease;
  pointer-events: none;
}

.imagebed-row:hover .imagebed-row-thumb::after {
  background: rgba(13, 123, 104, 0.08);
}

.imagebed-row-thumb-preview {
  display: none;
  position: absolute;
  z-index: 100;
  top: 50%;
  left: calc(100% + 12px);
  transform: translateY(-50%);
  width: 240px;
  height: 240px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  pointer-events: none;
}

.imagebed-row-thumb-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.imagebed-row-thumb:hover .imagebed-row-thumb-preview {
  display: block;
}

.imagebed-copy-feedback {
  position: fixed;
  z-index: 9999;
  padding: 6px 14px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  animation: imagebed-copy-pop 0.8s ease forwards;
}

@keyframes imagebed-copy-pop {
  0% { opacity: 0; transform: translateY(4px); }
  15% { opacity: 1; transform: translateY(0); }
  70% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-8px); }
}

.imagebed-context-menu {
  position: fixed;
  z-index: 10000;
  min-width: 160px;
  padding: 6px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  opacity: 0;
  transform: scale(0.95);
  animation: imagebed-menu-in 0.15s ease forwards;
}

@keyframes imagebed-menu-in {
  to { opacity: 1; transform: scale(1); }
}

.imagebed-context-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.12s ease;
}

.imagebed-context-menu button:hover {
  background: rgba(13, 123, 104, 0.08);
}

.imagebed-context-menu button svg {
  width: 15px;
  height: 15px;
  color: var(--muted);
}

.imagebed-context-menu .divider {
  height: 1px;
  margin: 4px 10px;
  background: var(--line);
}

.imagebed-detail-overlay {
  position: fixed;
  z-index: 9998;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  animation: imagebed-overlay-in 0.2s ease forwards;
}

@keyframes imagebed-overlay-in {
  to { opacity: 1; }
}

.imagebed-detail-modal {
  width: min(640px, 92vw);
  max-height: 85vh;
  display: grid;
  grid-template-rows: auto 1fr;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  transform: scale(0.96) translateY(8px);
  animation: imagebed-modal-in 0.25s ease forwards;
}

@keyframes imagebed-modal-in {
  to { transform: scale(1) translateY(0); }
}

.imagebed-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.imagebed-detail-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.imagebed-detail-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 20px;
  overflow-y: auto;
}

.imagebed-detail-preview {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-2);
  display: grid;
  place-items: center;
  aspect-ratio: 1;
}

.imagebed-detail-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.imagebed-detail-info {
  display: grid;
  gap: 12px;
  align-content: start;
}

.imagebed-detail-info dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 12px;
  margin: 0;
  font-size: 13px;
}

.imagebed-detail-info dt {
  color: var(--muted);
  font-weight: 600;
}

.imagebed-detail-info dd {
  margin: 0;
  word-break: break-all;
}

.imagebed-detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 8px;
}

.imagebed-folder {
  padding: 0;
  overflow: hidden;
  border-color: rgba(13, 123, 104, 0.16);
  border-radius: 10px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.imagebed-folder:hover {
  border-color: rgba(13, 123, 104, 0.26);
  box-shadow: 0 2px 12px rgba(13, 123, 104, 0.05);
}

.imagebed-folder-head {
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(13, 123, 104, 0.08), rgba(255, 255, 255, 0)),
    var(--surface);
}

.imagebed-folder-check,
.imagebed-row-check {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.imagebed-folder-check input,
.imagebed-row-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.imagebed-file-head,
.imagebed-row {
  display: grid;
  grid-template-columns: 48px minmax(210px, 1.05fr) minmax(180px, 0.9fr) 96px 84px;
  align-items: center;
  gap: 12px;
}

.imagebed-file-head {
  grid-template-columns: minmax(270px, 1.05fr) minmax(180px, 0.9fr) 96px 84px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.imagebed-folder-list {
  gap: 0;
}

.imagebed-row {
  position: relative;
  min-height: 70px;
  padding: 10px 12px 10px 46px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.15s ease;
}

.imagebed-row:last-child {
  border-bottom: 0;
}

.imagebed-row:hover,
.imagebed-row.selected {
  background: rgba(13, 123, 104, 0.04);
}

.imagebed-row:hover {
  transform: translateX(1px);
}

.imagebed-row.selected {
  box-shadow: inset 3px 0 0 var(--accent);
  background: rgba(13, 123, 104, 0.06);
}

.imagebed-row-check {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
}

.imagebed-row-thumb {
  width: 48px;
  height: 48px;
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  flex: 0 0 auto;
}

.imagebed-row-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.imagebed-row-thumb span {
  position: absolute;
  right: 3px;
  bottom: 3px;
  max-width: calc(100% - 6px);
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(4, 19, 16, 0.78);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
}

.imagebed-row-name {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.imagebed-row-name + .imagebed-link-field {
  min-width: 0;
}

.imagebed-row-name strong,
.imagebed-row-name small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.imagebed-row-name strong {
  color: var(--text);
  font-size: 14px;
}

.imagebed-row-name small {
  color: var(--muted);
  font-size: 12px;
}

.imagebed-link-field {
  min-width: 0;
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.imagebed-link-field:hover {
  border-color: rgba(13, 123, 104, 0.34);
  color: var(--accent);
  background: rgba(13, 123, 104, 0.04);
  transform: scale(1.01);
}

.imagebed-link-field:active {
  transform: scale(0.98);
}

.imagebed-link-field.copied {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(13, 123, 104, 0.08);
}

.imagebed-link-field span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.imagebed-row-date {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.imagebed-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.imagebed-result-list.view-compact .imagebed-folder {
  gap: 0;
}

.imagebed-result-list.view-compact .imagebed-folder-head {
  padding: 9px 12px;
}

.imagebed-result-list.view-compact .imagebed-folder-icon {
  width: 32px;
  height: 32px;
}

.imagebed-result-list.view-compact .imagebed-file-head {
  display: none;
}

.imagebed-result-list.view-compact .imagebed-row {
  min-height: 48px;
  grid-template-columns: 36px minmax(150px, 1fr) minmax(160px, 0.9fr) 72px;
  padding: 7px 10px 7px 40px;
  gap: 8px;
}

.imagebed-result-list.view-compact .imagebed-row-check {
  left: 12px;
}

.imagebed-result-list.view-compact .imagebed-row-thumb {
  width: 34px;
  height: 34px;
}

.imagebed-result-list.view-compact .imagebed-row-thumb span,
.imagebed-result-list.view-compact .imagebed-row-name small,
.imagebed-result-list.view-compact .imagebed-row-date {
  display: none;
}

.imagebed-result-list.view-compact .imagebed-row-actions {
  gap: 6px;
}

.imagebed-result-list.view-grid .imagebed-file-head,
.imagebed-result-list.view-preview .imagebed-file-head {
  display: none;
}

.imagebed-result-list.view-grid .imagebed-folder-body,
.imagebed-result-list.view-preview .imagebed-folder-body {
  padding: 12px;
}

.imagebed-result-list.view-grid .imagebed-folder-list,
.imagebed-result-list.view-preview .imagebed-folder-list {
  display: grid;
  gap: 12px;
}

.imagebed-result-list.view-grid .imagebed-folder-list {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.imagebed-result-list.view-preview .imagebed-folder-list {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.imagebed-result-list.view-grid .imagebed-row,
.imagebed-result-list.view-preview .imagebed-row {
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "thumb thumb"
    "name actions"
    "link link"
    "date date";
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.imagebed-result-list.view-grid .imagebed-row.selected,
.imagebed-result-list.view-preview .imagebed-row.selected {
  border-color: rgba(13, 123, 104, 0.42);
  box-shadow: inset 0 0 0 1px rgba(13, 123, 104, 0.12);
}

.imagebed-result-list.view-grid .imagebed-row-check,
.imagebed-result-list.view-preview .imagebed-row-check {
  top: 16px;
  left: 16px;
  z-index: 2;
  transform: none;
}

.imagebed-result-list.view-grid .imagebed-row-thumb,
.imagebed-result-list.view-preview .imagebed-row-thumb {
  grid-area: thumb;
  width: 100%;
  height: auto;
  aspect-ratio: 1.18;
  border-radius: 8px;
}

.imagebed-result-list.view-preview .imagebed-row-thumb {
  aspect-ratio: 1.42;
}

.imagebed-result-list.view-grid .imagebed-row-name,
.imagebed-result-list.view-preview .imagebed-row-name {
  grid-area: name;
}

.imagebed-result-list.view-grid .imagebed-link-field,
.imagebed-result-list.view-preview .imagebed-link-field {
  grid-area: link;
  min-height: 34px;
}

.imagebed-result-list.view-grid .imagebed-row-date,
.imagebed-result-list.view-preview .imagebed-row-date {
  grid-area: date;
}

.imagebed-result-list.view-grid .imagebed-row-actions,
.imagebed-result-list.view-preview .imagebed-row-actions {
  grid-area: actions;
}

.imagebed-result-list.view-preview .imagebed-row-name strong {
  font-size: 15px;
}

.imagebed-result-list.view-preview .imagebed-link-field span {
  font-size: 11px;
}

.imagebed-result-list.view-grid .imagebed-row-thumb-preview,
.imagebed-result-list.view-preview .imagebed-row-thumb-preview,
.imagebed-result-list.view-compact .imagebed-row-thumb-preview {
  display: none !important;
}

.admin-panel.active {
  display: grid;
  gap: 18px;
}

.admin-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.admin-hero h2,
.admin-users-panel h2 {
  margin: 4px 0 0;
}

.admin-hero p:last-child {
  max-width: 720px;
  color: var(--muted);
  line-height: 1.7;
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.admin-users-panel {
  display: grid;
  gap: 14px;
}

.admin-users-table {
  min-width: 860px;
}

.admin-user-cell {
  display: grid;
  gap: 4px;
}

.admin-user-cell strong {
  color: var(--ink);
}

.admin-user-cell span {
  color: var(--muted);
  font-size: 12px;
}

.admin-role-select,
.admin-status-select {
  min-width: 116px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.admin-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-row-actions .ghost-btn {
  min-height: 34px;
}

.auth-form .floating-field {
  display: block;
}

.admin-stat-grid .metric-card {
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s ease;
}

.admin-stat-grid .metric-card:hover {
  transform: translateY(-4px) scale(1.015);
}

.admin-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.admin-filters,
.admin-actions,
.admin-pagination,
.admin-pagination > div,
.confirm-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-filters {
  min-width: 0;
}

.admin-filters .floating-field {
  min-width: 240px;
  flex: 1 1 260px;
}

.floating-field.compact input {
  min-height: 42px;
  padding-top: 14px;
}

.floating-field.compact > span {
  top: 12px;
}

.floating-field.compact input:focus + span,
.floating-field.compact input:not(:placeholder-shown) + span {
  transform: translateY(-9px) scale(0.8);
}

.admin-filters select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--ink);
}

.admin-users-table th:first-child,
.admin-users-table td:first-child {
  width: 46px;
  text-align: center;
}

.admin-users-table tr.selected td {
  background: rgba(13, 123, 104, 0.055);
}

.admin-pagination {
  justify-content: space-between;
  padding-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.admin-secondary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.admin-session-list,
.admin-log-list {
  display: grid;
  gap: 10px;
  max-height: 430px;
  overflow: auto;
}

.admin-session-item,
.admin-log-item,
.admin-empty {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.admin-session-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.admin-session-item strong,
.admin-log-item strong {
  display: block;
  color: var(--ink);
}

.admin-session-item span,
.admin-session-item small,
.admin-log-item span,
.admin-log-item small,
.admin-empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.admin-log-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-library-panel.active {
  display: grid;
  gap: 18px;
}

.product-library-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.product-library-hero h2 {
  margin: 4px 0 0;
}

.product-library-hero p:last-child {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.7;
}

.product-library-actions,
.product-form-footer,
.product-row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.product-library-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.product-library-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.82fr) minmax(0, 1.18fr);
  gap: 18px;
  align-items: start;
}

.product-form {
  display: grid;
  gap: 14px;
  max-height: min(760px, calc(100vh - 210px));
  overflow: auto;
  padding-right: 4px;
}

.product-form textarea {
  resize: vertical;
}

.product-form-footer {
  justify-content: space-between;
}

.product-library-list-panel {
  display: grid;
  gap: 14px;
  max-height: min(760px, calc(100vh - 210px));
  overflow: hidden;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.product-library-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(150px, auto) minmax(130px, auto);
  gap: 10px;
  align-items: center;
}

.product-library-toolbar select,
.product-pagination select,
.product-pagination input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--ink);
}

.product-view-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.product-view-switch .icon-btn {
  width: 36px;
  height: 34px;
  border-radius: 7px;
  background: transparent;
}

.product-view-switch .icon-btn.active {
  background: rgba(13, 123, 104, 0.12);
  color: var(--accent);
}

.product-library-list {
  display: grid;
  gap: 12px;
  min-height: 0;
  max-height: 100%;
  overflow: auto;
  padding-right: 4px;
}

.product-library-list[data-view="table"] {
  display: block;
}

.product-library-item,
.product-library-empty {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
}

.product-library-item {
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.product-library-item:hover {
  transform: translateY(-2px);
  border-color: rgba(13, 123, 104, 0.22);
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.08);
}

.product-library-item-head,
.product-library-item-foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.product-library-item-head > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.product-library-item strong {
  color: var(--ink);
  font-size: 17px;
}

.product-library-item small,
.product-library-item p,
.product-library-empty {
  color: var(--muted);
  line-height: 1.55;
}

.product-library-item p {
  margin: 0;
}

.product-sku {
  width: fit-content;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(13, 123, 104, 0.08);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.product-status {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  background: rgba(109, 116, 128, 0.12);
  color: var(--muted);
}

.product-status.active {
  background: rgba(13, 123, 104, 0.12);
  color: var(--accent);
}

.product-status.draft {
  background: rgba(214, 162, 67, 0.15);
  color: #95640d;
}

.product-status.archived {
  background: rgba(116, 116, 116, 0.14);
  color: #555;
}

.product-library-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}

.product-library-meta span {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
}

.product-library-meta svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  color: var(--accent);
}

.product-table-wrap {
  width: 100%;
  max-height: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.product-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.product-table th,
.product-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.product-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(245, 250, 247, 0.96);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.product-table td {
  color: var(--ink);
}

.product-table td strong,
.product-table td span,
.product-table td small {
  display: block;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-table td strong {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.product-table td small {
  margin-top: 3px;
  color: var(--muted);
}

.product-table .product-status {
  display: inline-flex;
  width: fit-content;
  margin-top: 6px;
  padding: 4px 8px;
}

.product-table-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.product-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.product-page-size,
.product-page-controls,
.product-page-controls label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.product-page-size select {
  width: 82px;
}

.product-page-controls input {
  width: 72px;
  text-align: center;
}

.product-page-controls .ghost-btn {
  min-height: 38px;
  padding: 0 11px;
}

.product-source-control {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(180px, 1.3fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(13, 123, 104, 0.16);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(13, 123, 104, 0.08), rgba(13, 123, 104, 0.02));
}

.product-source-control > div {
  display: grid;
  gap: 3px;
}

.product-source-control span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.product-source-control strong {
  color: var(--ink);
  font-size: 14px;
}

.product-source-control > select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--ink);
}

.product-source-picker {
  position: relative;
  min-width: 0;
}

.product-source-native-select {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.product-source-picker-button {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  gap: 10px;
  align-items: center;
  padding: 8px 10px 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.product-source-picker-button:hover,
.product-source-picker.is-open .product-source-picker-button {
  border-color: rgba(13, 123, 104, 0.38);
  box-shadow: 0 0 0 3px rgba(13, 123, 104, 0.08);
}

.product-source-picker-button > span,
.product-source-picker-option > span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.product-source-picker-button strong,
.product-source-picker-option strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-source-picker-button small,
.product-source-picker-option small,
.product-source-picker-count,
.product-source-picker-empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.product-source-picker-button svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
  transition: transform 0.18s var(--ease-out);
}

.product-source-picker.is-open .product-source-picker-button svg {
  transform: rotate(180deg);
}

.product-source-picker-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 65;
  display: none;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 36px rgba(5, 23, 18, 0.16);
}

.product-source-picker.is-open .product-source-picker-menu {
  display: grid;
  gap: 8px;
}

.product-source-picker-search-wrap {
  min-height: 38px;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 123, 104, 0.04);
}

.product-source-picker-search-wrap svg {
  width: 15px;
  height: 15px;
  color: var(--muted);
}

.product-source-picker-search-wrap input {
  width: 100%;
  min-height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  outline: none;
}

.product-source-picker-search-wrap input:focus {
  border: 0;
  box-shadow: none;
  transform: none;
}

.product-source-picker-list {
  max-height: 240px;
  display: grid;
  gap: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.product-source-picker-option {
  width: 100%;
  display: block;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.product-source-picker-option:hover,
.product-source-picker-option:focus-visible,
.product-source-picker-option.is-selected {
  border-color: rgba(13, 123, 104, 0.18);
  background: rgba(13, 123, 104, 0.08);
  outline: none;
}

.product-source-picker-option.is-selected strong {
  color: var(--accent);
}

.product-source-picker-empty {
  padding: 12px 10px;
  text-align: center;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(10, 20, 18, 0.48);
  backdrop-filter: blur(8px);
}

.confirm-card {
  width: min(100%, 440px);
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: authPanelIn 0.24s var(--ease-out) both;
}

.confirm-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(230, 75, 60, 0.1);
  color: var(--accent-2);
}

.confirm-card h3 {
  margin: 0 0 8px;
}

.confirm-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.confirm-actions {
  grid-column: 1 / -1;
  justify-content: flex-end;
}

.primary-btn.danger {
  background: linear-gradient(135deg, #c9362b, #e64b3c);
}

.imagebed-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.model-status {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.model-status[data-state="success"] {
  color: var(--accent);
}

.model-status[data-state="error"] {
  color: var(--accent-2);
}

.ai-config {
  display: grid;
  gap: 12px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.normal-translation-config {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.normal-translation-config > strong {
  color: var(--accent);
}

.ai-enable {
  justify-content: flex-start;
}

.price-card {
  position: relative;
  min-height: 640px;
  display: grid;
  align-content: start;
  justify-items: center;
  text-align: center;
  gap: 16px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 18%, rgba(13, 123, 104, 0.18), transparent 31%),
    radial-gradient(circle at 86% 10%, rgba(232, 75, 60, 0.08), transparent 28%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(247, 251, 248, 0.96));
  animation: fadeInUp 0.58s var(--ease-out) both;
}

.price-card::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(13, 123, 104, 0.1);
  border-radius: 10px;
  pointer-events: none;
  z-index: -1;
}

.price-card::after {
  content: "";
  position: absolute;
  top: 78px;
  width: min(480px, 58%);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(13, 123, 104, 0.16), transparent 66%);
  filter: blur(4px);
  animation: priceAura 2.8s ease-in-out infinite;
  z-index: -1;
}

.price-copy-btn {
  position: absolute;
  top: 20px;
  right: 20px;
}

.price-hero {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding-top: 16px;
}

#suggestedPrice {
  display: block;
  margin: 0;
  font-size: clamp(58px, 8.4vw, 104px);
  color: var(--accent);
  letter-spacing: 0;
  line-height: 0.95;
  text-shadow: 0 18px 38px rgba(13, 123, 104, 0.16);
}

#suggestedPrice.price-number-pop {
  animation: priceNumberPop 0.48s var(--ease-out) both;
}

.shelf-price-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: #fff2bf;
  color: #7b5b10;
  font-size: 13px;
  font-weight: 950;
  border: 1px solid rgba(213, 155, 36, 0.24);
  box-shadow: 0 10px 24px rgba(213, 155, 36, 0.16);
}

.pricing-visual-grid {
  width: min(620px, 100%);
  display: grid;
  grid-template-columns: minmax(170px, 0.72fr) minmax(0, 1.28fr);
  gap: 12px;
}

.profit-gauge-card,
.waterfall-card {
  border: 1px solid rgba(13, 123, 104, 0.11);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 14px 34px rgba(31, 46, 40, 0.07);
  backdrop-filter: blur(16px);
  animation: fadeInUp 0.58s var(--ease-out) both;
}

.profit-gauge-card {
  padding: 14px;
  animation-delay: 0.08s;
}

.waterfall-card {
  padding: 14px;
  text-align: left;
  animation-delay: 0.14s;
}

.profit-gauge {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 174px;
}

.profit-gauge svg {
  width: 132px;
  height: 132px;
  transform: rotate(-90deg);
  overflow: visible;
}

.gauge-track,
.gauge-progress {
  fill: none;
  stroke-width: 12;
}

.gauge-track {
  stroke: rgba(13, 123, 104, 0.1);
}

.gauge-progress {
  stroke: #18a27e;
  stroke-linecap: round;
  filter: drop-shadow(0 0 8px rgba(24, 162, 126, 0.34));
  transition: stroke-dashoffset 0.7s var(--ease-out), stroke 0.25s ease;
}

.profit-gauge[data-state="warning"] .gauge-progress {
  stroke: #d59b24;
  filter: drop-shadow(0 0 8px rgba(213, 155, 36, 0.32));
}

.profit-gauge[data-state="danger"] .gauge-progress {
  stroke: #e64b3c;
  filter: drop-shadow(0 0 8px rgba(230, 75, 60, 0.32));
}

.profit-gauge > div {
  position: absolute;
  display: grid;
  justify-items: center;
  gap: 4px;
}

.profit-gauge strong {
  margin: 0;
  color: var(--ink);
  font-size: 25px;
  line-height: 1;
}

.profit-gauge span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.mini-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.mini-section-head span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
}

.mini-section-head small,
.waterfall-item small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.waterfall-chart {
  display: grid;
  gap: 9px;
}

.waterfall-item {
  display: grid;
  gap: 5px;
}

.waterfall-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.waterfall-meta strong {
  color: var(--ink);
  font-size: 13px;
  margin: 0;
}

.waterfall-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(14, 28, 24, 0.06);
  overflow: hidden;
}

.waterfall-track span {
  display: block;
  width: var(--share);
  height: 100%;
  border-radius: inherit;
  transform-origin: left center;
  animation: waterfallElastic 0.72s cubic-bezier(0.2, 1.4, 0.34, 1) both;
}

.waterfall-item.cost .waterfall-track span {
  background: linear-gradient(90deg, #2864d8, #8a5cf6);
}

.waterfall-item.ads .waterfall-track span {
  background: linear-gradient(90deg, #d88917, #ffc857);
}

.waterfall-item.discount .waterfall-track span {
  background: linear-gradient(90deg, #ec4c8b, #ff93bf);
}

.waterfall-item.profit .waterfall-track span {
  background: linear-gradient(90deg, #0d9f75, #42d6a4);
}

@keyframes priceAura {
  0%,
  100% {
    opacity: 0.7;
    transform: scale(0.94);
  }

  50% {
    opacity: 1;
    transform: scale(1.04);
  }
}

@keyframes priceNumberPop {
  0% {
    opacity: 0.72;
    transform: translateY(8px) scale(0.985);
    filter: brightness(1);
  }

  48% {
    color: #12a98e;
    filter: brightness(1.18);
    text-shadow: 0 0 24px rgba(13, 123, 104, 0.24);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: brightness(1);
  }
}

@keyframes waterfallElastic {
  from {
    transform: scaleX(0);
    opacity: 0.4;
  }

  to {
    transform: scaleX(1);
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.converter-layout {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.converter-hero {
  grid-column: 1 / -1;
  min-height: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background:
    radial-gradient(circle at 90% 12%, rgba(13, 123, 104, 0.1), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 247, 0.96));
}

.converter-hero h2 {
  margin: 3px 0 6px;
  font-size: 24px;
}

.converter-hero p:not(.eyebrow) {
  margin: 0;
  max-width: 720px;
  color: var(--muted);
  line-height: 1.55;
}

.converter-hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.converter-card {
  grid-column: span 4;
  display: grid;
  gap: 12px;
  align-content: start;
  min-width: 0;
}

.converter-currency {
  grid-column: span 5;
  overflow: hidden;
}

.converter-unit-lab {
  grid-column: span 7;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.converter-wide {
  grid-column: 1 / -1;
}

.converter-unit-block {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.converter-inline-inputs,
.converter-currency-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, 0.78fr);
  gap: 10px;
  align-items: end;
}

.converter-currency-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px minmax(0, 1fr) minmax(0, 1fr);
  align-items: end;
}

.converter-currency-grid > label:nth-child(1),
.converter-currency-grid > label:nth-child(3) {
  grid-column: 1 / span 2;
}

.converter-currency-grid > label:nth-child(2),
.converter-currency-grid > label:nth-child(5) {
  grid-column: 4 / span 2;
}

.converter-swap {
  grid-column: 3;
  justify-self: center;
  align-self: end;
  width: 44px;
  height: 44px;
}

.converter-quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.converter-quick-row button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.converter-quick-row button:hover,
.converter-quick-row button.active {
  border-color: rgba(13, 123, 104, 0.35);
  background: rgba(13, 123, 104, 0.1);
  color: var(--accent);
  transform: translateY(-1px);
}

.converter-result {
  min-height: 88px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--surface-2);
}

.converter-rate-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 9px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  min-width: 0;
}

.converter-rate-actions span {
  flex: 1 1 220px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.converter-result span,
.converter-mini span,
.converter-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.converter-result strong {
  font-size: clamp(30px, 4vw, 48px);
  color: var(--accent);
  min-width: 0;
  overflow-wrap: anywhere;
}

.converter-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.converter-mini {
  min-height: 68px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.converter-mini strong {
  font-size: 18px;
  line-height: 1.15;
}

.converter-dimension-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.converter-charge-strip {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(13, 123, 104, 0.18);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(13, 123, 104, 0.1), rgba(13, 123, 104, 0.04));
}

.converter-charge-strip span,
.converter-charge-strip small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.converter-charge-strip strong {
  color: var(--accent);
  font-size: 26px;
  line-height: 1;
}

.converter-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.converter-summary article {
  min-height: 72px;
  display: grid;
  align-content: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.converter-summary strong {
  display: block;
  margin-top: 5px;
  font-size: 19px;
  line-height: 1.15;
}

.pricing-dept-note {
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  line-height: 1.6;
}

.pricing-dept-note strong,
.pricing-dept-note span {
  display: block;
}

.pricing-dept-note strong {
  color: var(--accent);
  margin-bottom: 4px;
}

.pricing-formula-panel {
  padding: 0;
  overflow: hidden;
  animation: fadeInUp 0.46s var(--ease-out) both;
}

.pricing-formula-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  color: var(--accent);
  font-weight: 950;
  cursor: pointer;
  list-style: none;
}

.pricing-formula-panel summary::-webkit-details-marker {
  display: none;
}

.pricing-formula-panel summary span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pricing-formula-panel summary svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.pricing-formula-panel[open] summary > svg {
  transform: rotate(180deg);
}

.pricing-formula-panel p {
  margin: 0;
  padding: 0 12px 13px;
}

.pricing-control-grid {
  gap: 13px;
}

.pricing-control-grid .range-field {
  min-height: 94px;
  padding: 10px;
  border: 1px solid rgba(13, 123, 104, 0.09);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(244, 249, 246, 0.9));
  animation: fadeInUp 0.5s var(--ease-out) both;
}

.pricing-control-grid .range-field:nth-child(2) { animation-delay: 0.04s; }
.pricing-control-grid .range-field:nth-child(3) { animation-delay: 0.08s; }
.pricing-control-grid .range-field:nth-child(4) { animation-delay: 0.12s; }
.pricing-control-grid .range-field:nth-child(5) { animation-delay: 0.16s; }
.pricing-control-grid .range-field:nth-child(6) { animation-delay: 0.2s; }
.pricing-control-grid .range-field:nth-child(7) { animation-delay: 0.24s; }

.range-field input[type="number"] {
  min-height: 38px;
  padding: 8px 10px;
}

.range-field input[type="range"] {
  --range-fill: 0%;
  width: 100%;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  accent-color: var(--accent);
  cursor: pointer;
  appearance: none;
}

.range-field input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) var(--range-fill), rgba(13, 123, 104, 0.13) var(--range-fill));
}

.range-field input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -6px;
  border: 4px solid #fff;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 2px 8px rgba(13, 123, 104, 0.22);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.range-field input[type="range"]:hover::-webkit-slider-thumb {
  transform: scale(1.08);
  box-shadow: 0 3px 12px rgba(13, 123, 104, 0.28);
}

.range-field input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(13, 123, 104, 0.13);
}

.range-field input[type="range"]::-moz-range-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
}

.range-field input[type="range"]::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 4px solid #fff;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 2px 8px rgba(13, 123, 104, 0.22);
}

.price-breakdown {
  width: min(520px, 100%);
  display: grid;
  gap: 9px;
  animation: fadeInUp 0.58s var(--ease-out) both;
  animation-delay: 0.2s;
}

.price-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 9px 0;
  color: var(--muted);
}

.price-row strong {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
}

.price-ai-card {
  margin-top: 10px;
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  text-align: left;
  line-height: 1.6;
  white-space: pre-wrap;
  position: relative;
  overflow: hidden;
}

.price-ai-card .markdown-body {
  white-space: normal;
}

.price-ai-card strong {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 15px;
}

.price-ai-card.pricing-loading {
  display: grid;
  justify-items: center;
  gap: 9px;
  min-height: 132px;
  align-content: center;
  text-align: center;
  color: var(--muted);
  white-space: normal;
}

.price-ai-card.pricing-loading strong {
  margin: 0;
  color: var(--ink);
}

.price-ai-card.pricing-loading small {
  max-width: 320px;
  line-height: 1.5;
  font-weight: 700;
}

.pricing-loader {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 24px;
}

.pricing-loader span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
  animation: pricingPulse 0.9s ease-in-out infinite;
}

.pricing-loader span:nth-child(2) {
  background: var(--gold);
  animation-delay: 0.12s;
}

.pricing-loader span:nth-child(3) {
  background: var(--accent-2);
  animation-delay: 0.24s;
}

@keyframes pricingPulse {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }

  50% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

.preview-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.image-carousel-counter {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.image-carousel-counter[hidden] {
  display: none;
}

.preview-frame {
  position: relative;
  aspect-ratio: 1 / 1;
  max-height: 72vh;
  min-height: 320px;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    linear-gradient(45deg, rgba(219, 226, 219, 0.25) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(219, 226, 219, 0.25) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(219, 226, 219, 0.25) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(219, 226, 219, 0.25) 75%),
    #f8faf7;
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.preview-frame:hover {
  border-color: rgba(13, 123, 104, 0.2);
  box-shadow: 0 4px 20px rgba(13, 123, 104, 0.06);
}

.preview-frame canvas,
.preview-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  opacity: 0;
  animation: imagegen-fade-in 0.5s ease forwards;
}

.preview-frame canvas[hidden],
.preview-frame img[hidden] {
  opacity: 0;
  animation: none;
}

@keyframes imagegen-fade-in {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.image-empty-state {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(13, 123, 104, 0.03), rgba(234, 179, 8, 0.02)),
    #fbfcfb;
}

.image-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  background:
    radial-gradient(circle at center, rgba(13, 123, 104, 0.1), transparent 40%),
    linear-gradient(135deg, rgba(248, 251, 248, 0.97), rgba(238, 243, 238, 0.97));
  color: var(--ink);
  z-index: 3;
  overflow: hidden;
  animation: imagegen-loading-in 0.3s ease;
}

@keyframes imagegen-loading-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.image-loading::before {
  content: "";
  position: absolute;
  inset: -50%;
  background: conic-gradient(from 0deg, transparent, rgba(13, 123, 104, 0.05), transparent);
  animation: imagegen-loading-sweep 3s linear infinite;
}

@keyframes imagegen-loading-sweep {
  to { transform: rotate(360deg); }
}

.image-loading[hidden] {
  display: none;
}

.image-loading strong {
  font-size: 18px;
}

.image-loading small {
  color: var(--muted);
  font-weight: 700;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 28px;
}

.image-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 27, 24, 0.72);
  backdrop-filter: blur(6px);
}

.image-lightbox-panel {
  position: relative;
  width: min(1180px, 94vw);
  height: min(820px, 88vh);
  border-radius: 8px;
  background: #f8faf7;
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.32);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.image-lightbox-stage {
  width: 100%;
  height: 100%;
  padding: 22px;
  display: grid;
  place-items: center;
}

.image-lightbox-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.image-lightbox-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
}

body.lightbox-open {
  overflow: hidden;
}

.image-loader-orbit {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 2px solid rgba(13, 123, 104, 0.16);
  animation: imageSpin 1.35s linear infinite;
}

.image-loader-orbit span {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(13, 123, 104, 0.45);
}

.image-loader-orbit span:nth-child(1) {
  top: -7px;
  left: 31px;
}

.image-loader-orbit span:nth-child(2) {
  right: 3px;
  bottom: 8px;
  background: var(--accent-2);
}

.image-loader-orbit span:nth-child(3) {
  left: 3px;
  bottom: 8px;
  background: var(--gold);
}

@keyframes imageSpin {
  to {
    transform: rotate(360deg);
  }
}

.prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.prompt-chips span {
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.prompt-chips span:hover {
  background: rgba(13, 123, 104, 0.06);
  color: var(--accent);
  border-color: rgba(13, 123, 104, 0.2);
  transform: translateY(-1px);
}

.imagegen-history {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.imagegen-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}

.imagegen-history-head strong {
  font-size: 13px;
  font-weight: 700;
}

.imagegen-history-list {
  max-height: 260px;
  overflow-y: auto;
}

.imagegen-history-item {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.15s ease;
}

.imagegen-history-item:last-child {
  border-bottom: 0;
}

.imagegen-history-item:hover {
  background: rgba(13, 123, 104, 0.04);
}

.imagegen-history-item img {
  width: 52px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.imagegen-history-item .meta {
  min-width: 0;
}

.imagegen-history-item .meta strong {
  display: block;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.imagegen-history-item .meta small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.imagegen-history-empty {
  padding: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.imagegen-prompt-templates {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.imagegen-prompt-templates button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.imagegen-prompt-templates button:hover {
  border-color: rgba(13, 123, 104, 0.3);
  background: rgba(13, 123, 104, 0.06);
  color: var(--accent);
}

/* ── Imagegen: Collapsible Config Panel ── */
.imagegen-config-panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-2);
  transition: border-color 0.2s ease;
}

.imagegen-config-panel[open] {
  border-color: rgba(13, 123, 104, 0.2);
}

.imagegen-config-panel summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  list-style: none;
  user-select: none;
}

.imagegen-config-panel summary::-webkit-details-marker {
  display: none;
}

.imagegen-config-panel summary span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.imagegen-config-panel summary span svg {
  width: 15px;
  height: 15px;
  color: var(--accent);
}

.imagegen-config-panel summary > i {
  margin-left: auto;
  width: 16px;
  height: 16px;
  color: var(--muted);
  transition: transform 0.25s ease;
}

.imagegen-config-panel[open] summary > i {
  transform: rotate(180deg);
}

.imagegen-config-hint {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.imagegen-config-hint[data-configured="true"] {
  color: var(--accent);
  background: rgba(13, 123, 104, 0.06);
  border-color: rgba(13, 123, 104, 0.2);
}

.imagegen-config-body {
  display: grid;
  gap: 12px;
  padding: 0 14px 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

/* ── Imagegen: Prompt Section ── */
.imagegen-prompt-section {
  display: grid;
  gap: 6px;
}

.imagegen-prompt-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.imagegen-prompt-toolbar .imagegen-prompt-templates {
  margin-top: 0;
  flex: 1;
  min-width: 220px;
}

.imagegen-polish-btn {
  min-height: 30px;
  padding: 0 10px;
  white-space: nowrap;
}

.imagegen-polish-btn svg {
  color: var(--accent);
}

.imagegen-polish-status {
  margin: 2px 0 0;
  font-size: 12px;
}

.imagegen-polish-status[hidden] {
  display: none;
}

.imagegen-history-btn {
  min-height: 30px;
  min-width: 30px;
  padding: 0 6px;
}

.imagegen-prompt-history {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  max-height: 140px;
  overflow-y: auto;
}

.imagegen-prompt-history[hidden] {
  display: none;
}

.imagegen-prompt-history-list {
  padding: 6px;
  display: grid;
  gap: 2px;
}

.imagegen-prompt-history-item {
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s ease;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.imagegen-prompt-history-item:hover {
  background: rgba(13, 123, 104, 0.06);
  color: var(--accent);
}

.imagegen-prompt-history-empty {
  padding: 14px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

/* ── Imagegen: Style Cards ── */
.imagegen-param-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.imagegen-style-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.imagegen-style-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  text-align: center;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.imagegen-style-card input,
.imagegen-size-card input {
  pointer-events: none;
}

.imagegen-style-card span,
.imagegen-style-card svg,
.imagegen-size-card span,
.imagegen-size-icon {
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}

.imagegen-style-card span {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  transition: color 0.2s ease;
}

.imagegen-style-card svg {
  width: 22px;
  height: 22px;
  color: var(--muted);
  transition: color 0.2s ease;
}

.imagegen-style-card:hover {
  border-color: rgba(13, 123, 104, 0.25);
  background: rgba(13, 123, 104, 0.03);
  transform: translateY(-1px);
}

.imagegen-style-card.active {
  border-color: var(--accent);
  background: rgba(13, 123, 104, 0.06);
  box-shadow: 0 2px 8px rgba(13, 123, 104, 0.1);
}

.imagegen-style-card.active span {
  color: var(--accent);
}

.imagegen-style-card.active svg {
  color: var(--accent);
}

/* ── Imagegen: Size Cards ── */
.imagegen-size-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.imagegen-size-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 6px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
  text-align: center;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.imagegen-size-card span:last-child {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  transition: color 0.2s ease;
}

.imagegen-size-card:hover {
  border-color: rgba(13, 123, 104, 0.25);
  transform: translateY(-1px);
}

.imagegen-size-card.active {
  border-color: var(--accent);
  background: rgba(13, 123, 104, 0.06);
}

.imagegen-size-card.active span:last-child {
  color: var(--accent);
}

.imagegen-size-icon {
  display: block;
  border: 2px solid var(--muted);
  border-radius: 3px;
  transition: border-color 0.2s ease;
}

.imagegen-size-card.active .imagegen-size-icon {
  border-color: var(--accent);
}

.imagegen-size-auto {
  width: 20px;
  height: 20px;
  border-style: dashed;
}

.imagegen-size-1x1 {
  width: 20px;
  height: 20px;
}

.imagegen-size-3x2 {
  width: 24px;
  height: 16px;
}

.imagegen-size-16x9 {
  width: 26px;
  height: 15px;
}

.imagegen-size-2x3 {
  width: 16px;
  height: 24px;
}

.imagegen-size-9x16 {
  width: 14px;
  height: 25px;
}

.imagegen-size-exact {
  margin-top: 8px;
  font-size: 12px;
}

/* ── Imagegen: Params Row ── */
.imagegen-params-row {
  grid-template-columns: repeat(3, 1fr);
}

/* ── Imagegen: Presets ── */
.imagegen-presets-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.imagegen-preset-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.imagegen-preset-btn svg {
  width: 18px;
  height: 18px;
}

.imagegen-preset-btn:hover {
  border-color: rgba(13, 123, 104, 0.3);
  background: rgba(13, 123, 104, 0.06);
  color: var(--accent);
  transform: translateY(-1px);
}

/* ── Imagegen: Enhanced Empty State ── */
.image-empty-content {
  display: grid;
  place-items: center;
  gap: 10px;
  text-align: center;
  padding: 40px 20px;
}

.image-empty-content svg {
  width: 48px;
  height: 48px;
  color: var(--muted);
  opacity: 0.4;
}

.image-empty-content strong {
  font-size: 14px;
  color: var(--ink);
  font-weight: 700;
}

.image-empty-content small {
  font-size: 12px;
  color: var(--muted);
}

/* ── Imagegen: Loading Progress ── */
.image-loading-progress {
  width: 180px;
  height: 4px;
  border-radius: 4px;
  background: rgba(13, 123, 104, 0.1);
  overflow: hidden;
  margin-top: 6px;
}

.image-loading-bar {
  height: 100%;
  width: 30%;
  border-radius: 4px;
  background: var(--accent);
  animation: imagegen-progress 2.5s ease-in-out infinite;
}

@keyframes imagegen-progress {
  0% { width: 5%; transform: translateX(0); }
  50% { width: 60%; transform: translateX(50%); }
  100% { width: 5%; transform: translateX(600px); }
}

.image-carousel {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  gap: 10px;
  align-items: center;
}

.image-carousel[hidden] {
  display: none;
}

.image-thumbnails {
  min-width: 0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 1px 6px;
}

.image-thumb {
  position: relative;
  flex: 0 0 76px;
  width: 76px;
  height: 58px;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 10px;
  background: var(--surface-2);
  box-shadow: 0 4px 12px rgba(18, 31, 27, 0.06);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.image-thumb:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 8px 20px rgba(13, 123, 104, 0.12);
}

.image-thumb.active {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(13, 123, 104, 0.18);
}

.image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-thumb span {
  position: absolute;
  left: 5px;
  bottom: 5px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(17, 27, 24, 0.78);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
}

.prompt-chips span {
  padding: 7px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.floating-assistant {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 34;
  display: grid;
  justify-items: end;
  gap: 12px;
  pointer-events: none;
}

.assistant-fab,
.assistant-panel {
  pointer-events: auto;
}

.assistant-fab {
  position: relative;
  min-height: 52px;
  padding: 0 20px 0 16px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent 32%),
    linear-gradient(135deg, #0b6f5f, #0f8c78);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow:
    0 16px 38px rgba(13, 123, 104, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
  transition: width 0.28s ease, padding 0.28s ease, border-radius 0.28s ease, transform 0.2s ease, box-shadow 0.2s ease, background 0.28s ease;
}

.assistant-fab::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: inherit;
  background: rgba(13, 123, 104, 0.2);
  animation: fabPulse 2.6s ease-out infinite;
  pointer-events: none;
  z-index: -1;
}

.assistant-fab::after {
  content: "";
  position: absolute;
  top: -60%;
  left: -40%;
  width: 56%;
  height: 220%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: rotate(22deg) translateX(-120%);
  transition: transform 0.55s ease;
}

.assistant-fab svg {
  width: 19px;
  height: 19px;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.28));
  animation: aiIconBreath 2.8s ease-in-out infinite;
  transition: transform 0.28s ease;
  z-index: 1;
}

.assistant-fab span {
  z-index: 1;
  transition: opacity 0.2s ease, transform 0.24s ease;
}

.assistant-fab:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow:
    0 22px 52px rgba(13, 123, 104, 0.34),
    0 0 0 7px rgba(13, 123, 104, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.assistant-fab:hover::after {
  transform: rotate(22deg) translateX(260%);
}

@keyframes aiIconBreath {
  0%,
  100% {
    opacity: 0.86;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.18));
    transform: scale(1);
  }

  50% {
    opacity: 1;
    filter: drop-shadow(0 0 14px rgba(255, 255, 255, 0.52));
    transform: scale(1.08);
  }
}

.floating-assistant.open .assistant-fab {
  width: 52px;
  padding: 0;
  justify-content: center;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.24), transparent 30%),
    linear-gradient(135deg, #17211d, #0d7b68);
}

.floating-assistant.open .assistant-fab svg {
  transform: rotate(135deg) scale(1.04);
}

.floating-assistant.open .assistant-fab span {
  width: 0;
  opacity: 0;
  transform: translateX(8px);
  overflow: hidden;
}

.floating-assistant.open .assistant-fab::before {
  animation: none;
  opacity: 0;
}

.assistant-fab-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #e64b3c;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(230, 75, 60, 0.36);
  z-index: 2;
}

.assistant-fab-badge[hidden] {
  display: none;
}

@keyframes fabPulse {
  0% {
    opacity: 0.62;
    transform: scale(0.86);
  }
  70%,
  100% {
    opacity: 0;
    transform: scale(1.35);
  }
}

.assistant-panel {
  width: min(410px, calc(100vw - 28px));
  max-height: min(720px, calc(100vh - 112px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 70px rgba(18, 31, 27, 0.22);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(160px, 1fr) auto auto auto;
  transform-origin: right bottom;
  animation: assistantPanelIn 0.24s ease both;
  transition: width 0.24s ease, max-height 0.24s ease, box-shadow 0.24s ease;
}

.assistant-panel.expanded {
  width: min(520px, calc(100vw - 28px));
  max-height: min(820px, calc(100vh - 92px));
}

@keyframes assistantPanelIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.assistant-head {
  padding: 14px 14px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(13, 123, 104, 0.13);
  background:
    radial-gradient(circle at 18% 0%, rgba(13, 123, 104, 0.14), transparent 34%),
    linear-gradient(135deg, rgba(248, 251, 248, 0.98), rgba(239, 247, 244, 0.96));
  cursor: grab;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.assistant-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.assistant-title strong,
.assistant-title small {
  display: block;
}

.assistant-title small {
  margin-top: 3px;
  color: var(--muted);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.assistant-avatar {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(#0d7b68, #0d7b68) padding-box,
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), #d59b24 45%, #e64b3c) border-box;
  border: 2px solid transparent;
  color: #fff;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(13, 123, 104, 0.2);
  animation: assistantAvatarGlow 3s ease-in-out infinite;
}

.assistant-avatar svg {
  width: 21px;
  height: 21px;
}

.assistant-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #19b97f;
  box-shadow: 0 0 0 0 rgba(25, 185, 127, 0.42);
  animation: statusPulse 1.7s ease-out infinite;
}

.assistant-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.assistant-head-actions .icon-btn {
  width: 34px;
  height: 34px;
}

@keyframes assistantAvatarGlow {
  0%,
  100% {
    box-shadow: 0 10px 24px rgba(13, 123, 104, 0.18);
  }
  50% {
    box-shadow: 0 12px 30px rgba(13, 123, 104, 0.3), 0 0 0 5px rgba(13, 123, 104, 0.08);
  }
}

@keyframes statusPulse {
  70%,
  100% {
    box-shadow: 0 0 0 8px rgba(25, 185, 127, 0);
  }
}

.assistant-messages {
  padding: 14px;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 10px;
  background:
    linear-gradient(180deg, rgba(238, 243, 238, 0.82), rgba(255, 255, 255, 0.96));
}

.assistant-message {
  max-width: 88%;
  display: grid;
  gap: 5px;
  animation: msgSlideIn 0.24s ease both;
  transition: transform 0.18s ease;
}

.assistant-message:hover {
  transform: translateY(-1px);
}

@keyframes msgSlideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.assistant-message-head {
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.assistant-message-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.assistant-message-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.assistant-copy-btn,
.assistant-follow-btn,
.assistant-retry-btn {
  min-width: 56px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 800;
  opacity: 0.86;
  transition: opacity 0.16s ease, color 0.16s ease, border 0.16s ease;
}

.assistant-copy-btn:hover,
.assistant-follow-btn:hover,
.assistant-retry-btn:hover {
  opacity: 1;
  color: var(--accent);
  border-color: rgba(13, 123, 104, 0.35);
}

.assistant-copy-btn svg,
.assistant-follow-btn svg,
.assistant-retry-btn svg {
  width: 14px;
  height: 14px;
}

.assistant-message-body {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  line-height: 1.55;
  word-break: break-word;
  box-shadow: 0 8px 20px rgba(18, 31, 27, 0.06);
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.assistant-message:hover .assistant-message-body {
  box-shadow: 0 12px 26px rgba(18, 31, 27, 0.1);
}

.assistant-message.bot .assistant-message-body {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
}

.assistant-message.user {
  justify-self: end;
  max-width: 78%;
  width: fit-content;
  animation-name: msgSlideInUser;
}

@keyframes msgSlideInUser {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.assistant-message.user .assistant-message-head {
  justify-content: flex-end;
}

.assistant-message.user .assistant-message-head span {
  text-align: right;
}

.assistant-message.user .assistant-message-body {
  background: #0d7b68;
  color: #fff;
  white-space: pre-wrap;
  padding: 6px 10px;
  line-height: 1.38;
  min-height: 0;
}

.assistant-message.loading .assistant-message-body {
  color: var(--muted);
}

.assistant-typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
}

.assistant-typing-indicator span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  opacity: 0.38;
  animation: typingBounce 1s ease-in-out infinite;
}

.assistant-typing-indicator span:nth-child(2) {
  animation-delay: 0.14s;
}

.assistant-typing-indicator span:nth-child(3) {
  animation-delay: 0.28s;
}

.assistant-typing-indicator em {
  margin-left: 5px;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

@keyframes typingBounce {
  0%,
  80%,
  100% {
    opacity: 0.32;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-4px);
  }
}

.assistant-message-time {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  opacity: 0.72;
  text-align: right;
}

.assistant-message-body > *:first-child {
  margin-top: 0;
}

.assistant-message-body > *:last-child {
  margin-bottom: 0;
}

.assistant-message-body p {
  margin: 0 0 9px;
}

.assistant-message-body h1,
.assistant-message-body h2,
.assistant-message-body h3,
.assistant-message-body h4 {
  margin: 12px 0 7px;
  line-height: 1.28;
  letter-spacing: 0;
}

.assistant-message-body h1 {
  font-size: 20px;
}

.assistant-message-body h2 {
  font-size: 18px;
}

.assistant-message-body h3 {
  font-size: 16px;
}

.assistant-message-body h4 {
  font-size: 15px;
}

.assistant-message-body ul,
.assistant-message-body ol {
  margin: 7px 0 10px;
  padding-left: 22px;
}

.assistant-message-body li {
  margin: 5px 0;
}

.assistant-message-body blockquote {
  margin: 10px 0;
  padding: 8px 10px;
  border-left: 3px solid var(--accent);
  background: var(--surface-2);
  color: var(--muted);
}

.assistant-message-body pre {
  margin: 10px 0;
  padding: 10px;
  overflow-x: auto;
  border-radius: 8px;
  background: #111b18;
  color: #f8fbf8;
  font-family: Consolas, "Courier New", monospace;
  line-height: 1.45;
}

.assistant-message-body code {
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--accent);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.92em;
}

.assistant-message-body pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.assistant-message-body a {
  color: var(--accent);
  font-weight: 800;
}

.markdown-body {
  line-height: 1.65;
  color: inherit;
}

.markdown-body > *:first-child {
  margin-top: 0;
}

.markdown-body > *:last-child {
  margin-bottom: 0;
}

.markdown-body p {
  margin: 0 0 9px;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  margin: 12px 0 7px;
  line-height: 1.28;
  letter-spacing: 0;
}

.markdown-body h1 {
  font-size: 22px;
}

.markdown-body h2 {
  font-size: 19px;
}

.markdown-body h3 {
  font-size: 16px;
}

.markdown-body h4 {
  font-size: 15px;
}

.markdown-body ul,
.markdown-body ol {
  margin: 7px 0 10px;
  padding-left: 22px;
}

.markdown-body li {
  margin: 5px 0;
}

.markdown-body blockquote {
  margin: 10px 0;
  padding: 8px 10px;
  border-left: 3px solid var(--accent);
  background: rgba(13, 123, 104, 0.07);
  color: var(--muted);
}

.markdown-body pre {
  margin: 10px 0;
  padding: 10px;
  overflow-x: auto;
  border-radius: 8px;
  background: #111b18;
  color: #f8fbf8;
  font-family: Consolas, "Courier New", monospace;
  line-height: 1.45;
}

.markdown-body code {
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--accent);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.92em;
}

.markdown-body pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.markdown-body a {
  color: var(--accent);
  font-weight: 800;
}

.assistant-quick-actions {
  position: relative;
  padding: 10px 12px 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  overflow: visible;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
}

.assistant-quick-actions::before,
.assistant-quick-actions::after {
  display: none;
}

.assistant-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px 10px;
  background: rgba(255, 255, 255, 0.78);
}

.assistant-tool-btn {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  background:
    linear-gradient(#f5f8f5, #f5f8f5) padding-box,
    linear-gradient(135deg, rgba(13, 123, 104, 0.12), rgba(13, 123, 104, 0.08)) border-box;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(18, 31, 27, 0.04);
  transition: transform 0.18s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.assistant-tool-btn:hover {
  transform: translateY(-1px);
  color: var(--accent);
  box-shadow: 0 10px 22px rgba(13, 123, 104, 0.1);
}

.assistant-tool-btn svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.assistant-tool-btn.active,
.assistant-tool-btn[aria-pressed="true"] {
  background: rgba(13, 123, 104, 0.1);
  color: var(--accent);
  border-color: rgba(13, 123, 104, 0.32);
  box-shadow: 0 10px 24px rgba(13, 123, 104, 0.12);
}

#assistantSearchToggle.active,
#assistantSearchToggle[aria-pressed="true"] {
  animation: searchGlow 1.8s ease-in-out infinite;
}

@keyframes searchGlow {
  0%,
  100% {
    box-shadow: 0 10px 24px rgba(13, 123, 104, 0.1);
  }
  50% {
    box-shadow: 0 12px 28px rgba(13, 123, 104, 0.18), 0 0 0 4px rgba(13, 123, 104, 0.08);
  }
}

.assistant-clear-btn {
  padding-inline: 10px;
}

.assistant-search-switch {
  position: relative;
  min-width: 124px;
  min-height: 36px;
  border-radius: 8px;
  padding: 0 10px 0 9px;
  justify-content: flex-start;
}

.search-toggle-track {
  position: relative;
  width: 24px;
  height: 14px;
  margin-left: auto;
  border-radius: 999px;
  background: rgba(111, 125, 119, 0.26);
  box-shadow: inset 0 0 0 1px rgba(111, 125, 119, 0.22);
  transition: background 0.18s ease, box-shadow 0.18s ease;
  flex-shrink: 0;
}

.search-toggle-thumb {
  position: absolute;
  top: 50%;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(18, 31, 27, 0.2);
  transform: translateY(-50%);
  transition: transform 0.18s ease;
}

.assistant-search-switch.active .search-toggle-track,
.assistant-search-switch[aria-pressed="true"] .search-toggle-track {
  background: rgba(13, 123, 104, 0.42);
  box-shadow: inset 0 0 0 1px rgba(13, 123, 104, 0.28);
}

.assistant-search-switch.active .search-toggle-thumb,
.assistant-search-switch[aria-pressed="true"] .search-toggle-thumb {
  transform: translateY(-50%) translateX(10px);
}

.assistant-switch-copy {
  display: grid;
  gap: 2px;
  line-height: 1;
}

.assistant-switch-copy strong {
  font-size: 12px;
}



.assistant-run-status {
  margin-left: auto;
  min-width: 64px;
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.assistant-run-status svg {
  width: 12px;
  height: 12px;
}

.assistant-run-status[data-state="running"] {
  background: rgba(213, 155, 36, 0.1);
  border-color: rgba(213, 155, 36, 0.24);
  color: #b7791f;
}

.assistant-run-status[data-state="running"] svg {
  animation: assistantSpin 0.9s linear infinite;
}

.assistant-run-status[data-state="success"] {
  background: rgba(13, 123, 104, 0.1);
  border-color: rgba(13, 123, 104, 0.22);
  color: var(--accent);
}

.assistant-run-status[data-state="error"] {
  background: rgba(230, 75, 60, 0.1);
  border-color: rgba(230, 75, 60, 0.22);
  color: #c0392b;
}

@keyframes assistantSpin {
  to {
    transform: rotate(360deg);
  }
}

.assistant-search-summary {
  display: grid;
  gap: 3px;
  margin-bottom: 10px;
}

.assistant-search-summary strong {
  font-size: 14px;
}

.assistant-search-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.assistant-search-results {
  display: grid;
  gap: 8px;
}

.assistant-search-card {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  padding: 9px;
  border: 1px solid rgba(13, 123, 104, 0.14);
  border-radius: 8px;
  background: rgba(13, 123, 104, 0.035);
}

.assistant-search-card > span {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(13, 123, 104, 0.11);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.assistant-search-card a {
  display: block;
  color: var(--accent);
  font-weight: 900;
  line-height: 1.35;
}

.assistant-search-card p {
  margin: 5px 0 4px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.assistant-search-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.assistant-search-empty {
  display: grid;
  gap: 4px;
  color: var(--muted);
}

.assistant-quick-actions button {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 9px;
  background:
    linear-gradient(#f5f8f5, #f5f8f5) padding-box,
    linear-gradient(135deg, rgba(13, 123, 104, 0.16), rgba(213, 155, 36, 0.18)) border-box;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 12px;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(18, 31, 27, 0.05);
  transition: transform 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.assistant-quick-actions button.primary-task {
  background:
    linear-gradient(135deg, rgba(13, 123, 104, 0.12), rgba(255, 255, 255, 0.88)) padding-box,
    linear-gradient(135deg, rgba(13, 123, 104, 0.42), rgba(213, 155, 36, 0.28)) border-box;
  color: var(--accent);
  box-shadow: 0 10px 22px rgba(13, 123, 104, 0.1);
}

.assistant-quick-actions button:hover {
  transform: translateY(-1px);
  color: var(--accent);
  box-shadow: 0 10px 22px rgba(13, 123, 104, 0.11);
}

.assistant-quick-actions button:active {
  transform: scale(0.97);
}

.assistant-quick-actions button svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.assistant-quick-actions button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant-starter-actions {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.assistant-starter-actions button {
  min-height: 28px;
  border: 1px solid rgba(13, 123, 104, 0.16);
  border-radius: 8px;
  padding: 0 8px;
  background: rgba(13, 123, 104, 0.06);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.assistant-starter-actions button:hover {
  transform: translateY(-1px);
  background: rgba(13, 123, 104, 0.1);
  border-color: rgba(13, 123, 104, 0.26);
}

.assistant-config {
  display: grid;
  gap: 12px;
  padding-top: 2px;
}

.assistant-config .check-chip.ai-enable {
  width: 100%;
  background: linear-gradient(90deg, rgba(13, 123, 104, 0.1), rgba(13, 123, 104, 0.045));
}

.assistant-config input,
.assistant-config select,
.assistant-composer textarea {
  padding: 9px 10px;
}

.assistant-composer {
  padding: 12px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  gap: 9px;
  align-items: end;
  background: #fff;
}

.assistant-input-shell {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.assistant-composer textarea {
  min-height: 46px;
  max-height: 120px;
  border-radius: 8px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.assistant-composer textarea:focus {
  border-color: rgba(13, 123, 104, 0.36);
  box-shadow: 0 0 0 3px rgba(13, 123, 104, 0.12);
}

.assistant-composer-hints {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

.assistant-composer .primary-btn {
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent 34%),
    linear-gradient(135deg, #0d7b68, #0f947d);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.assistant-composer .primary-btn:hover {
  transform: translateY(-1px) scale(1.04);
}

.assistant-composer .primary-btn svg {
  transition: transform 0.22s ease;
}

.assistant-composer.is-busy .primary-btn {
  opacity: 0.72;
  cursor: progress;
}

.assistant-send-pulse {
  animation: sendPop 0.42s ease;
}

@keyframes sendPop {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(0.88);
  }
  100% {
    transform: scale(1);
  }
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.64fr) minmax(560px, 1.36fr);
  grid-template-areas:
    "modules modules"
    "summary tips";
  gap: 18px;
  align-items: start;
}

.settings-summary-grid {
  grid-area: summary;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
}

.settings-card {
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.settings-summary-grid > .settings-card:first-child {
  min-height: 0;
  background:
    radial-gradient(circle at 85% 22%, rgba(13, 123, 104, 0.11), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 247, 0.96));
}

.settings-summary-grid > .settings-card:first-child::after {
  content: "";
  position: absolute;
  right: -34px;
  bottom: -44px;
  width: 108px;
  height: 108px;
  border-radius: 36px;
  border: 1px solid rgba(13, 123, 104, 0.14);
  background: linear-gradient(135deg, rgba(13, 123, 104, 0.08), rgba(213, 155, 36, 0.08));
  transform: rotate(12deg);
  pointer-events: none;
}

.settings-layout > .settings-tips-card {
  grid-area: tips;
  background:
    radial-gradient(circle at 96% 10%, rgba(13, 123, 104, 0.09), transparent 26%),
    var(--surface);
}

.settings-summary-grid > .settings-alert {
  min-height: 0;
  background:
    radial-gradient(circle at 84% 16%, rgba(230, 75, 60, 0.11), transparent 28%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(250, 248, 247, 0.96));
}

.settings-summary-grid > .settings-alert::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -28px;
  width: 92px;
  height: 92px;
  border-radius: 28px;
  border: 1px solid rgba(230, 75, 60, 0.14);
  background: linear-gradient(135deg, rgba(230, 75, 60, 0.08), rgba(13, 123, 104, 0.06));
  transform: rotate(10deg);
  pointer-events: none;
}

.settings-wide {
  grid-area: modules;
  overflow: visible;
}

.settings-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.62;
  max-width: 900px;
}

.settings-mini-grid,
.settings-check-list {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.settings-mini-grid span,
.settings-check-list span {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid rgba(13, 123, 104, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.56);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.settings-check-list span {
  border-color: rgba(230, 75, 60, 0.12);
}

.settings-mini-grid svg,
.settings-check-list svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  color: var(--accent);
}

.settings-check-list svg {
  color: #c95648;
}

.settings-card-icon {
  width: 36px;
  height: 36px;
  color: var(--accent);
  padding: 7px;
  border-radius: 10px;
  background: rgba(13, 123, 104, 0.08);
}

.settings-config {
  padding: 0;
}

.settings-save-btn {
  justify-self: start;
  min-height: 42px;
  padding: 0 16px;
  background: rgba(13, 123, 104, 0.1);
  color: var(--accent);
}

.settings-model-compact {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}

.settings-model-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.settings-model-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.settings-model-actions .ghost-btn,
.settings-model-actions .primary-btn {
  min-height: 42px;
  padding: 0 14px;
}

.settings-apply-note {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.settings-model-hidden {
  display: none;
}

.settings-model-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(250, 252, 250, 0.94)),
    #fbfcfb;
  display: grid;
  gap: 14px;
  box-shadow: 0 10px 24px rgba(31, 46, 40, 0.045);
  transition: transform 0.22s var(--ease-out), border-color 0.22s ease, box-shadow 0.22s var(--ease-out);
}

.settings-model-active-card {
  max-width: 860px;
}

.settings-model-active-slot {
  display: grid;
  gap: 12px;
}

.settings-model-card:hover {
  transform: translateY(-2px);
  border-color: rgba(13, 123, 104, 0.2);
  box-shadow: 0 18px 38px rgba(31, 46, 40, 0.09);
}

.settings-model-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 0 0 12px;
  border-bottom: 1px solid rgba(219, 226, 219, 0.82);
}

.settings-model-card header strong,
.settings-model-card header span {
  display: block;
}

.settings-model-card header strong {
  font-size: 16px;
}

.settings-model-card header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.settings-model-card .ai-config,
.settings-model-card .assistant-config,
.settings-model-card .image-model-config,
.settings-model-card .normal-translation-config {
  display: grid;
  gap: 12px;
  padding-top: 0;
  border-top: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.settings-model-card .check-chip.ai-enable {
  width: 100%;
  justify-content: flex-start;
  background: linear-gradient(90deg, rgba(13, 123, 104, 0.1), rgba(13, 123, 104, 0.045));
  min-height: 38px;
}

.settings-model-card label {
  gap: 6px;
}

.settings-model-card input,
.settings-model-card select,
.settings-model-card textarea {
  min-height: 42px;
}

.settings-tips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.settings-tips article {
  min-height: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(13, 123, 104, 0.055), transparent 42%),
    #fbfcfb;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), border-color 0.2s ease;
}

.settings-tips article:hover {
  transform: translateY(-1px);
  border-color: rgba(13, 123, 104, 0.2);
  box-shadow: var(--shadow-soft);
}

.settings-tips strong,
.settings-tips span {
  display: block;
}

.settings-tips strong {
  font-size: 14px;
  line-height: 1.35;
}

.settings-tips span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.48;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(135deg, rgba(35, 210, 177, 0.22), transparent 48%),
    #111b18;
  color: #fff;
  font-weight: 850;
  box-shadow: 0 18px 46px rgba(17, 27, 24, 0.24), 0 0 0 7px rgba(13, 123, 104, 0.08);
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 42;
}

.toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@keyframes mainSettle {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes panelReveal {
  from {
    opacity: 0;
    transform: translateY(10px);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes surfaceSweep {
  0% {
    transform: translateX(-100%);
    opacity: 0;
  }
  18%,
  68% {
    opacity: 1;
  }
  100% {
    transform: translateX(100%);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  }

  .app-shell:not(.sidebar-collapsed) {
    --sidebar-width: 88px;
  }

  .brand-row > div,
  .nav-group-toggle,
  .nav-item span,
  .sidebar-footer-info,
  .sidebar-footer span {
    display: none;
  }

  .nav-group,
  .nav-group-content,
  .nav-group-items {
    display: contents;
  }

  .nav-item {
    justify-content: center;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-stat-grid,
  .product-library-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-toolbar,
  .admin-secondary-grid,
  .product-library-grid,
  .product-library-toolbar {
    grid-template-columns: 1fr;
  }

  .product-library-list-panel,
  .product-form {
    max-height: none;
  }

  .product-library-list {
    max-height: min(620px, 72vh);
  }

  .product-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .product-page-controls {
    justify-content: space-between;
  }

  .dashboard-hero-panel {
    grid-template-columns: 1fr;
  }

  .dashboard-signal-board {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .bi-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bi-import-panel,
  .bi-decision-grid {
    grid-template-columns: 1fr;
  }

  .bi-import-controls {
    justify-content: flex-start;
  }

  .bi-grid,
  .bi-grid-bottom {
    grid-template-columns: 1fr;
  }

  .dashboard-command {
    grid-template-columns: 1fr;
  }

  .tool-layout,
  .tool-layout.wide-left,
  .imagebed-layout,
  .settings-layout {
    grid-template-columns: 1fr;
  }

  .selection-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .selection-breakdown,
  .selection-decision-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pricing-visual-grid {
    grid-template-columns: minmax(180px, 0.72fr) minmax(0, 1.28fr);
  }

  .prompt-library-filters,
  .prompt-template-grid,
  .webtools-controls {
    grid-template-columns: 1fr;
  }

  .settings-layout {
    grid-template-areas:
      "modules"
      "summary"
      "tips";
  }

  .settings-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-tips {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-layout > .settings-card:last-child,
  .settings-wide {
    grid-column: auto;
  }

  .span-7,
  .span-5,
  .converter-currency,
  .converter-unit-lab,
  .converter-card,
  .converter-wide {
    grid-column: span 12;
  }

  .converter-unit-lab {
    grid-template-columns: 1fr 1fr;
  }

  .converter-currency-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px minmax(0, 1fr) minmax(0, 1fr);
  }

  .converter-swap {
    grid-column: 3;
    justify-self: center;
  }

  .converter-dimension-grid,
  .converter-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .imagegen-style-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .imagegen-size-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .imagegen-presets-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .imagegen-params-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    padding: 14px;
    align-items: stretch;
  }

  .app-shell,
  .app-shell.sidebar-collapsed {
    --sidebar-width: 100%;
  }

  .brand-row > div,
  .app-shell.sidebar-collapsed .brand-row > div {
    display: block;
  }

  .app-shell.sidebar-collapsed .sidebar-footer {
    display: flex;
  }

  .sidebar-resizer {
    display: none;
  }

  .sidebar-edge-toggle {
    display: none;
  }

  .nav-list {
    grid-template-columns: repeat(4, minmax(48px, 1fr));
    width: 100%;
    overflow: visible;
  }

  .main {
    padding: 16px;
  }

  .topbar,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .focus-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .focus-panel .primary-btn {
    width: auto;
    min-width: 128px;
  }

  .dashboard-hero-panel {
    min-height: auto;
    padding: 20px;
  }

  .dashboard-hero-copy h2 {
    font-size: 32px;
  }

  .top-actions {
    width: 100%;
  }

  .top-actions .primary-btn {
    flex: 1;
  }

  .metric-grid,
  .admin-stat-grid,
  .bi-metric-grid,
  .dashboard-signal-board,
  .bi-grid,
  .bi-grid-bottom,
  .product-strip,
  .flow-panel,
  .attribute-table,
  .model-actions,
  .input-grid,
  .task-form,
  .converter-result-grid,
  .converter-dimension-grid,
  .converter-summary,
  .converter-unit-lab,
  .converter-inline-inputs,
  .settings-model-toolbar,
  .settings-tips,
  .model-picker-row {
    grid-template-columns: 1fr;
  }

  .selection-advanced-grid,
  .selection-overview,
  .selection-breakdown,
  .selection-decision-grid,
  .openclaw-layout {
    grid-template-columns: 1fr;
  }

  .selection-overview strong {
    font-size: 22px;
  }

  .selection-row-actions {
    min-width: 172px;
  }

  .auth-panel {
    padding: 22px;
  }

  .auth-brand {
    grid-template-columns: 1fr;
  }

  .admin-hero,
  .product-library-hero,
  .product-library-item-head,
  .product-library-item-foot {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-actions .ghost-btn,
  .admin-pagination .ghost-btn,
  .admin-session-item .ghost-btn,
  .product-library-actions .ghost-btn,
  .product-library-actions .primary-btn,
  .product-row-actions .ghost-btn {
    flex: 1 1 120px;
  }

  .admin-session-item,
  .confirm-card {
    grid-template-columns: 1fr;
  }

  .product-library-meta {
    grid-template-columns: 1fr;
  }

  .product-view-switch {
    justify-content: center;
  }

  .product-page-controls,
  .product-page-controls label,
  .product-page-size {
    width: 100%;
  }

  .product-page-controls .ghost-btn {
    flex: 1 1 128px;
  }

  .product-source-control {
    grid-template-columns: 1fr;
  }

  .product-source-picker-menu {
    max-width: calc(100vw - 32px);
  }

  .openclaw-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .openclaw-chat-panel {
    min-height: 560px;
  }

  .price-card {
    min-height: auto;
  }

  .pricing-visual-grid {
    grid-template-columns: 1fr;
  }

  #suggestedPrice {
    font-size: clamp(48px, 18vw, 74px);
  }

  .converter-currency-grid {
    grid-template-columns: 1fr;
  }

  .converter-currency-grid > label:nth-child(1),
  .converter-currency-grid > label:nth-child(2),
  .converter-currency-grid > label:nth-child(3),
  .converter-currency-grid > label:nth-child(5),
  .converter-swap {
    grid-column: auto;
  }

  .converter-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .converter-hero-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .converter-swap {
    width: 100%;
  }

  .converter-charge-strip {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .bi-filters {
    justify-content: stretch;
  }

  .bi-filters select,
  .bi-filters .status-pill {
    width: 100%;
  }

  .bi-import-controls,
  .bi-import-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .bi-file-button,
  .bi-import-controls .ghost-btn,
  .bi-import-footer .primary-btn {
    width: 100%;
  }

  .bi-alert-item {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .bi-alert-item em {
    grid-column: 2;
    width: fit-content;
  }

  .bi-summary-board {
    grid-template-columns: 1fr;
  }

  .bi-trend-wrap,
  .bi-trend-wrap svg {
    min-height: 240px;
    height: 240px;
  }

  .bi-action-item {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .bi-action-tag {
    grid-column: 2;
    width: fit-content;
  }

  .settings-model-actions {
    justify-content: stretch;
  }

  .settings-model-actions .ghost-btn,
  .settings-model-actions .primary-btn {
    flex: 1;
  }

  .settings-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "modules"
      "summary"
      "tips";
  }

  .settings-summary-grid {
    grid-template-columns: 1fr;
  }

  .imagebed-card {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .imagebed-thumb {
    width: 88px;
  }

  .imagebed-card-actions .ghost-btn {
    flex: 1 1 110px;
  }

  .imagebed-manager-stats {
    grid-template-columns: 1fr;
  }

  .imagebed-quick-settings,
  .imagebed-filterbar {
    grid-template-columns: 1fr;
  }

  .imagebed-format-segments,
  .imagebed-toolbar-actions,
  .imagebed-header-actions {
    width: 100%;
  }

  .imagebed-format-segments {
    justify-content: stretch;
  }

  .imagebed-format-segments button {
    flex: 1 1 0;
    min-width: 0;
    padding-inline: 8px;
  }

  .imagebed-toolbar-actions .ghost-btn {
    flex: 1 1 138px;
  }

  .imagebed-file-head {
    display: none;
  }

  .imagebed-row {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    grid-template-areas:
      "thumb name actions"
      "thumb link link"
      "thumb date date";
    align-items: start;
    padding-right: 10px;
  }

  .imagebed-row-thumb {
    grid-area: thumb;
  }

  .imagebed-row-name {
    grid-area: name;
  }

  .imagebed-link-field {
    grid-area: link;
  }

  .imagebed-row-date {
    grid-area: date;
  }

  .imagebed-row-actions {
    grid-area: actions;
  }

  .imagebed-viewbar {
    align-items: stretch;
    flex-direction: column;
  }

  .imagebed-view-tabs {
    width: 100%;
    justify-content: stretch;
  }

  .imagebed-view-tabs button {
    flex: 1 1 0;
    min-width: 0;
    padding-inline: 6px;
  }

  .imagebed-view-state {
    justify-content: center;
    width: 100%;
  }

  .imagebed-result-list.view-grid .imagebed-folder-list,
  .imagebed-result-list.view-preview .imagebed-folder-list {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .imagebed-result-list.view-grid .imagebed-row,
  .imagebed-result-list.view-preview .imagebed-row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "thumb thumb"
      "name actions"
      "link link"
      "date date";
    padding: 10px;
  }

  .imagebed-result-list.view-grid .imagebed-row-thumb,
  .imagebed-result-list.view-preview .imagebed-row-thumb {
    width: 100%;
  }

  .converter-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-item {
    min-height: 46px;
    width: 100%;
  }

  .floating-assistant {
    right: 14px;
    bottom: 14px;
  }

  .assistant-fab span {
    display: none;
  }

  .assistant-fab .assistant-fab-badge {
    display: grid;
  }

  .assistant-fab {
    width: 54px;
    padding: 0;
    justify-content: center;
  }

  .assistant-panel {
    width: calc(100vw - 28px);
    max-height: calc(100vh - 92px);
  }

  .assistant-panel.expanded {
    width: calc(100vw - 28px);
    max-height: calc(100vh - 92px);
  }

  .package-image-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .package-image-download-all {
    width: 100%;
  }
}

/* ==========================================
   PREMIUM THEME ENHANCEMENTS & DOUBLE-MODE
   ========================================== */

/* Smooth global transitions for theme change */
body {
  transition: background-color 0.4s var(--ease-out), color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s var(--ease-out);
}
.sidebar, .main, .topbar, .work-panel, .metric-card, .tool-form, .result-panel, .copy-output, .price-card, .image-studio, .task-list article, .product-card, .creative-board, input, select, textarea {
  transition: background-color 0.4s var(--ease-out), color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s var(--ease-out), transform 0.24s var(--ease-out);
}

/* Beautiful Premium Dark Theme Variables */
body.dark-theme {
  color-scheme: dark;
  --bg: #090f0c; /* Deep night forest black */
  --surface: #0f1713; /* Sleek slate green dark */
  --surface-2: #16221d; /* Elevated active slate dark */
  --ink: #e5ece9; /* High-contrast premium text */
  --muted: #849b91; /* Cozy teal-gray muted text */
  --line: #1d2c25; /* Subtle dark border line */
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 22px 60px rgba(0, 0, 0, 0.65);
  
  background:
    radial-gradient(circle at 10% 20%, rgba(33, 217, 187, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(213, 155, 36, 0.05) 0%, transparent 45%),
    linear-gradient(180deg, #070c0a 0%, #0c120f 100%);
}

/* Dark theme specific adjustments */
body.dark-theme .sidebar {
  background:
    radial-gradient(circle at 28px 26px, rgba(33, 217, 187, 0.18), transparent 30%),
    linear-gradient(180deg, #060b09 0%, #080f0c 48%, #040807 100%);
}

body.dark-theme .check-chip {
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line);
}

body.dark-theme .check-chip:hover {
  background: rgba(33, 217, 187, 0.15);
  border-color: rgba(33, 217, 187, 0.3);
}

body.dark-theme .product-card,
body.dark-theme .task-list article,
body.dark-theme .flow-step {
  background: rgba(17, 26, 22, 0.75);
  border-color: var(--line);
}

body.dark-theme .flow-step::before {
  color: rgba(33, 217, 187, 0.05);
}

body.dark-theme .flow-step:hover::before {
  color: rgba(33, 217, 187, 0.15);
}

body.dark-theme .flow-step:hover {
  background: var(--surface-2);
  box-shadow: 0 12px 28px rgba(33, 217, 187, 0.06);
}

body.dark-theme input,
body.dark-theme select,
body.dark-theme textarea {
  background: #111a16;
  border-color: var(--line);
}

body.dark-theme .flow-panel::before {
  background: repeating-linear-gradient(90deg, rgba(33, 217, 187, 0.15) 0px, rgba(33, 217, 187, 0.15) 6px, transparent 6px, transparent 12px);
}

body.dark-theme .focus-panel,
body.dark-theme .flow-panel {
  background: #111614;
  border-color: rgba(255, 255, 255, 0.05);
}

body.dark-theme .pulse-dot {
  background-color: var(--accent);
  box-shadow: 0 0 0 0 rgba(33, 217, 187, 0.4);
}

body.dark-theme .dashboard-hero-panel {
  background: #111614;
  border-color: rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

body.dark-theme .dashboard-hero-panel::before {
  border-color: rgba(33, 217, 187, 0.18);
}

body.dark-theme .dashboard-hero-copy h2 {
  color: #f4fbf8;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.42);
}

body.dark-theme .dashboard-hero-copy p:not(.eyebrow),
body.dark-theme .bi-page-subtitle,
body.dark-theme .metric-card span,
body.dark-theme .metric-card small,
body.dark-theme .dashboard-signal-board span,
body.dark-theme .dashboard-signal-board small {
  color: #9fb2ab;
}

body.dark-theme .dashboard-signal-board article {
  background: #151d1a;
  border-color: rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

body.dark-theme .dashboard-signal-board article:hover {
  background: #1a2420;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

body.dark-theme .dashboard-signal-board strong {
  color: #e5ece9;
}

body.dark-theme .metric-card strong {
  color: #20c9ae;
  text-shadow: 0 0 18px rgba(33, 217, 187, 0.16);
}

body.dark-theme .metric-card em {
  background: rgba(33, 217, 187, 0.12);
  border-color: rgba(33, 217, 187, 0.16);
  color: #36efd0;
}

body.dark-theme .metric-bar {
  background: rgba(33, 217, 187, 0.09);
}

body.dark-theme .bi-filters select,
body.dark-theme .bi-trend-wrap,
body.dark-theme .bi-file-button,
body.dark-theme .bi-alert-item,
body.dark-theme .bi-health-card,
body.dark-theme .bi-sku-item,
body.dark-theme .bi-action-item {
  background: #111a16;
  border-color: var(--line);
}

body.dark-theme .bi-import-copy p:not(.eyebrow),
body.dark-theme .bi-import-footer span,
body.dark-theme .bi-alert-item > div > span,
body.dark-theme .bi-sku-item small,
body.dark-theme .bi-health-card span,
body.dark-theme .bi-health-card small,
body.dark-theme .bi-empty {
  color: #9fb2ab;
}

body.dark-theme .bi-alert-item strong,
body.dark-theme .bi-sku-item strong,
body.dark-theme .bi-health-card strong,
body.dark-theme .bi-alert-item em {
  color: #e5ece9;
}

body.dark-theme .bi-health-card.warning {
  background: rgba(213, 155, 36, 0.08);
}

body.dark-theme .bi-health-card.danger {
  background: rgba(230, 75, 60, 0.08);
}

body.dark-theme .bi-chart-dot {
  fill: #111a16;
}

body.dark-theme .bi-chart-grid {
  stroke: rgba(229, 236, 233, 0.08);
}

body.dark-theme .bi-action-tag {
  background: rgba(213, 155, 36, 0.18);
  color: #f0c96e;
}

/* Glassmorphism card effects in Dark Theme */
body.dark-theme .metric-card,
body.dark-theme .work-panel,
body.dark-theme .tool-form,
body.dark-theme .result-panel,
body.dark-theme .copy-output,
body.dark-theme .price-card,
body.dark-theme .image-studio {
  background: #151d1a;
  border-color: rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

body.dark-theme .metric-card:hover,
body.dark-theme .work-panel:hover,
body.dark-theme .tool-form:hover,
body.dark-theme .result-panel:hover,
body.dark-theme .copy-output:hover,
body.dark-theme .price-card:hover,
body.dark-theme .image-studio:hover {
  background: #1a2420;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

body.dark-theme .flow-step {
  border-color: rgba(255, 255, 255, 0.05);
  background: #151d1a;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

body.dark-theme .flow-step:hover {
  background: #1a2420;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

body.dark-theme .sidebar-footer {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.06);
}

body.dark-theme .price-card {
  background:
    radial-gradient(circle at 50% 18%, rgba(33, 217, 187, 0.14), transparent 31%),
    radial-gradient(circle at 86% 10%, rgba(230, 75, 60, 0.08), transparent 28%),
    linear-gradient(145deg, #141e1a, #101815);
}

body.dark-theme .profit-gauge-card,
body.dark-theme .waterfall-card,
body.dark-theme .pricing-control-grid .range-field {
  background: rgba(19, 29, 25, 0.82);
  border-color: rgba(255, 255, 255, 0.06);
}

body.dark-theme .waterfall-track {
  background: rgba(255, 255, 255, 0.07);
}

body.dark-theme .pricing-formula-panel {
  background: rgba(22, 34, 29, 0.85);
}

/* Micro-animations and hover enhancements */
.nav-item {
  transition: transform 0.28s var(--ease-out), background-color 0.2s ease, color 0.2s ease;
}
.nav-item:active {
  transform: scale(0.98);
}

/* Glow effects under dark mode */
body.dark-theme .nav-item.active {
  background: linear-gradient(90deg, rgba(14, 43, 36, 0.98), rgba(22, 45, 40, 0.86));
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3), 0 0 14px rgba(33, 217, 187, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

body.dark-theme .primary-btn {
  box-shadow: 0 12px 26px rgba(33, 217, 187, 0.15);
}
body.dark-theme .primary-btn:hover {
  box-shadow: 0 18px 38px rgba(33, 217, 187, 0.25), 0 0 16px rgba(33, 217, 187, 0.15);
}

body.dark-theme .brand-mark.logo-mark {
  background: #000;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.06);
}
/* ==========================================
   DARK THEME VISUAL COMPATIBILITY PATCH
   ========================================== */

/* Dark theme re-definitions for interactive variables & accent contrast */
body.dark-theme {
  --accent: #21d9bb; /* Vibrantly glowing neon space-emerald green */
  --gold: #f59e0b; /* Bright amber gold */
  --blue: #3b82f6; /* Vivid neon blue */
  --accent-2: #ff6b6b; /* Soft alert red */
}

/* Settings summary grid cards & notification banners override */
body.dark-theme .settings-summary-grid > .settings-card:first-child {
  background:
    radial-gradient(circle at 85% 22%, rgba(33, 217, 187, 0.16), transparent 34%),
    linear-gradient(135deg, rgba(15, 23, 19, 0.82), rgba(22, 34, 29, 0.86));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-color: rgba(33, 217, 187, 0.12);
}

body.dark-theme .settings-summary-grid > .settings-alert {
  background:
    radial-gradient(circle at 84% 16%, rgba(230, 75, 60, 0.18), transparent 28%),
    linear-gradient(135deg, rgba(15, 23, 19, 0.82), rgba(22, 34, 29, 0.86));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-color: rgba(230, 75, 60, 0.15);
}

body.dark-theme .settings-mini-grid span,
body.dark-theme .settings-check-list span {
  background: rgba(15, 23, 19, 0.48);
  border-color: rgba(33, 217, 187, 0.14);
}

body.dark-theme .settings-check-list span {
  border-color: rgba(255, 107, 107, 0.16);
}

/* Tips & deepseek integration articles override */
body.dark-theme .settings-tips article {
  background:
    linear-gradient(135deg, rgba(33, 217, 187, 0.08), transparent 42%),
    #111a16;
  border-color: var(--line);
}

/* Active configuration slot & models drawer */
body.dark-theme .settings-model-card {
  background:
    linear-gradient(180deg, rgba(21, 34, 28, 0.94), rgba(15, 23, 19, 0.94)),
    #0f1713;
  border-color: var(--line);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}

body.dark-theme .settings-model-card:hover {
  border-color: rgba(33, 217, 187, 0.2);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.6);
}

body.dark-theme .settings-model-card header {
  border-bottom-color: var(--line);
}

body.dark-theme .settings-model-card .check-chip.ai-enable,
body.dark-theme .assistant-config .check-chip.ai-enable {
  background: linear-gradient(90deg, rgba(33, 217, 187, 0.18), rgba(33, 217, 187, 0.06));
  border-color: rgba(33, 217, 187, 0.18);
  color: var(--ink);
}

body.dark-theme .provider-select-button,
body.dark-theme .provider-select-option,
body.dark-theme .platform-select-button,
body.dark-theme .platform-select-option {
  background: rgba(15, 23, 19, 0.92);
  border-color: var(--line);
}

body.dark-theme .provider-logo {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(33, 217, 187, 0.16);
}

body.dark-theme .provider-select-menu,
body.dark-theme .platform-select-menu {
  background: rgba(15, 23, 19, 0.98);
  border-color: rgba(33, 217, 187, 0.2);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.46);
}

body.dark-theme .provider-select-option:hover,
body.dark-theme .provider-select-option.is-selected,
body.dark-theme .platform-select-option:hover,
body.dark-theme .platform-select-option.is-selected {
  background: rgba(33, 217, 187, 0.12);
  border-color: rgba(33, 217, 187, 0.16);
}

body.dark-theme .product-source-picker-button,
body.dark-theme .product-source-picker-option {
  background: rgba(15, 23, 19, 0.92);
  border-color: var(--line);
}

body.dark-theme .product-source-picker-menu {
  background: rgba(15, 23, 19, 0.98);
  border-color: rgba(33, 217, 187, 0.2);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.46);
}

body.dark-theme .product-source-picker-search-wrap {
  background: rgba(33, 217, 187, 0.06);
  border-color: var(--line);
}

body.dark-theme .product-source-picker-option:hover,
body.dark-theme .product-source-picker-option:focus-visible,
body.dark-theme .product-source-picker-option.is-selected {
  background: rgba(33, 217, 187, 0.12);
  border-color: rgba(33, 217, 187, 0.16);
}

body.dark-theme .product-library-list-panel {
  background: #151d1a;
  border-color: rgba(255, 255, 255, 0.06);
}

body.dark-theme .product-library-toolbar select,
body.dark-theme .product-pagination select,
body.dark-theme .product-pagination input {
  background: #101814;
  border-color: rgba(229, 236, 233, 0.1);
  color: #e5ece9;
}

body.dark-theme .product-view-switch {
  background: rgba(9, 15, 12, 0.72);
  border-color: rgba(229, 236, 233, 0.1);
}

body.dark-theme .product-view-switch .icon-btn {
  color: #9fb2ab;
}

body.dark-theme .product-view-switch .icon-btn.active {
  background: rgba(33, 217, 187, 0.16);
  color: #36efd0;
}

body.dark-theme .product-library-item,
body.dark-theme .product-library-empty,
body.dark-theme .product-table-wrap {
  background: #101814;
  border-color: rgba(229, 236, 233, 0.1);
  color: #e5ece9;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

body.dark-theme .product-library-item:hover {
  background: #14201b;
  border-color: rgba(33, 217, 187, 0.28);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.42);
}

body.dark-theme .product-library-item strong,
body.dark-theme .product-table td,
body.dark-theme .product-table td span {
  color: #edf7f3;
}

body.dark-theme .product-library-item small,
body.dark-theme .product-library-item p,
body.dark-theme .product-library-empty,
body.dark-theme .product-library-meta span,
body.dark-theme .product-pagination,
body.dark-theme .product-table th,
body.dark-theme .product-table td small {
  color: #a7bbb3;
}

body.dark-theme .product-sku,
body.dark-theme .product-table td strong {
  background: rgba(33, 217, 187, 0.14);
  color: #36efd0;
}

body.dark-theme .product-status {
  background: rgba(167, 187, 179, 0.13);
  color: #c7d8d1;
}

body.dark-theme .product-status.active {
  background: rgba(33, 217, 187, 0.16);
  color: #7ff8df;
}

body.dark-theme .product-status.draft {
  background: rgba(245, 158, 11, 0.18);
  color: #f5c86a;
}

body.dark-theme .product-status.archived {
  background: rgba(229, 236, 233, 0.1);
  color: #c5d1cc;
}

body.dark-theme .product-table th {
  background: #16221d;
  border-bottom-color: rgba(229, 236, 233, 0.12);
}

body.dark-theme .product-table th,
body.dark-theme .product-table td {
  border-bottom-color: rgba(229, 236, 233, 0.08);
}

/* AI prompt template library & placeholder elements override */
body.dark-theme .prompt-template-card,
body.dark-theme .webtool-card,
body.dark-theme .webtool-empty {
  background: rgba(22, 34, 29, 0.86);
  border-color: var(--line);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.45);
}

body.dark-theme .prompt-template-empty {
  background: rgba(17, 26, 22, 0.72);
  border-color: var(--line);
}

body.dark-theme .promptlib-sidebar {
  background: var(--surface);
  border-left-color: var(--line);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.3);
}

body.dark-theme .promptlib-sidebar-item {
  background: rgba(22, 34, 29, 0.6);
}

body.dark-theme .promptlib-custom-modal-body {
  background: var(--surface);
}

body.dark-theme .promptlib-card-send-menu {
  background: var(--surface);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

body.dark-theme .promptlib-sidebar-toggle {
  background: var(--surface);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

body.dark-theme .promptlib-search-bar {
  background: var(--surface);
}

body.dark-theme .webtool-tags span,
body.dark-theme .webtool-icon {
  background: rgba(33, 217, 187, 0.12);
}

body.dark-theme .webtool-icon {
  border-color: rgba(33, 217, 187, 0.18);
}

/* Text translation converter headers override */
body.dark-theme .converter-hero {
  background:
    radial-gradient(circle at 90% 12%, rgba(33, 217, 187, 0.14), transparent 30%),
    linear-gradient(135deg, rgba(15, 23, 19, 0.82), rgba(22, 34, 29, 0.86));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-color: rgba(33, 217, 187, 0.12);
}

/* Floating AI assistant subcomponents override */
body.dark-theme .assistant-panel {
  background: rgba(15, 23, 19, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-color: var(--line);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65);
}

body.dark-theme .assistant-fab::before {
  background: rgba(33, 217, 187, 0.22);
}

body.dark-theme .assistant-fab-badge {
  border-color: #0f1713;
  box-shadow: 0 8px 18px rgba(255, 107, 107, 0.22);
}

body.dark-theme .assistant-head {
  border-bottom-color: rgba(33, 217, 187, 0.14);
  background:
    radial-gradient(circle at 18% 0%, rgba(33, 217, 187, 0.16), transparent 34%),
    linear-gradient(135deg, rgba(15, 23, 19, 0.98), rgba(22, 34, 29, 0.96));
}

body.dark-theme .assistant-avatar {
  background:
    linear-gradient(#0d7b68, #0d7b68) padding-box,
    linear-gradient(135deg, rgba(255, 255, 255, 0.64), #21d9bb 48%, #ff6b6b) border-box;
  box-shadow: 0 12px 30px rgba(33, 217, 187, 0.14);
}

body.dark-theme .assistant-messages {
  background:
    linear-gradient(180deg, rgba(15, 23, 19, 0.96), rgba(9, 15, 12, 0.98));
}

body.dark-theme .assistant-message.bot .assistant-message-body {
  background: var(--surface);
  border-color: var(--line);
}

body.dark-theme .assistant-message-body {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

body.dark-theme .assistant-typing-indicator span {
  background: var(--accent);
}

body.dark-theme .assistant-quick-actions button,
body.dark-theme .assistant-tool-btn {
  background:
    linear-gradient(#16221d, #16221d) padding-box,
    linear-gradient(135deg, rgba(33, 217, 187, 0.2), rgba(245, 158, 11, 0.17)) border-box;
  color: var(--ink);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

body.dark-theme .assistant-quick-actions,
body.dark-theme .assistant-tools {
  background: rgba(15, 23, 19, 0.78);
}

body.dark-theme .assistant-starter-actions button {
  background: rgba(33, 217, 187, 0.09);
  border-color: rgba(33, 217, 187, 0.16);
}

body.dark-theme .assistant-starter-actions button:hover {
  background: rgba(33, 217, 187, 0.14);
  border-color: rgba(33, 217, 187, 0.24);
}

body.dark-theme .assistant-composer {
  background: var(--surface);
  border-top-color: var(--line);
}

body.dark-theme .assistant-composer textarea:focus {
  border-color: rgba(33, 217, 187, 0.36);
  box-shadow: 0 0 0 3px rgba(33, 217, 187, 0.12);
}

body.dark-theme .assistant-run-status {
  background: #16221d;
  border-color: var(--line);
}

body.dark-theme .assistant-tool-btn.active,
body.dark-theme .assistant-tool-btn[aria-pressed="true"] {
  background: rgba(33, 217, 187, 0.18);
  color: var(--accent);
  border-color: rgba(33, 217, 187, 0.32);
  box-shadow: 0 10px 24px rgba(33, 217, 187, 0.12);
}

body.dark-theme .assistant-search-card {
  background: rgba(33, 217, 187, 0.08);
  border-color: rgba(33, 217, 187, 0.18);
}

body.dark-theme .assistant-search-card p {
  color: var(--ink);
}

body.dark-theme .selection-market-card,
body.dark-theme .selection-market-empty {
  background: rgba(33, 217, 187, 0.08);
  border-color: rgba(33, 217, 187, 0.18);
}

body.dark-theme .selection-market-card p {
  color: var(--ink);
}

body.dark-theme .selection-preference-group,
body.dark-theme .selection-overview article,
body.dark-theme .selection-breakdown div,
body.dark-theme .selection-decision-grid article {
  background: rgba(33, 217, 187, 0.07);
  border-color: rgba(33, 217, 187, 0.18);
}

body.dark-theme .selection-detail-card {
  background: rgba(33, 217, 187, 0.045);
  border-color: rgba(33, 217, 187, 0.2);
}

body.dark-theme .selection-main-row.is-open td {
  background: rgba(33, 217, 187, 0.05);
}

body.dark-theme .openclaw-chat-panel,
body.dark-theme .openclaw-config {
  background: #101814;
  border-color: rgba(229, 236, 233, 0.08);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.38);
}

body.dark-theme .openclaw-messages {
  background:
    linear-gradient(180deg, rgba(33, 217, 187, 0.055), transparent 34%),
    #0b120f;
}

body.dark-theme .openclaw-message-body {
  background: #111c17;
  border-color: rgba(33, 217, 187, 0.16);
  color: #e5ece9;
}

body.dark-theme .openclaw-message-head,
body.dark-theme .openclaw-config label {
  color: #9fb2ab;
}

body.dark-theme .openclaw-starter-actions button {
  background: rgba(33, 217, 187, 0.1);
  border-color: rgba(33, 217, 187, 0.2);
  color: #36efd0;
}

body.dark-theme .openclaw-composer {
  background: #0b120f;
  border-top-color: rgba(229, 236, 233, 0.08);
}

body.dark-theme .openclaw-composer textarea,
body.dark-theme .openclaw-config input {
  background: #101814;
  border-color: rgba(229, 236, 233, 0.1);
  color: #e5ece9;
}

body.dark-theme .openclaw-composer textarea::placeholder,
body.dark-theme .openclaw-config input::placeholder {
  color: #849b91;
}

body.dark-theme .openclaw-composer textarea:focus,
body.dark-theme .openclaw-config input:focus {
  border-color: rgba(33, 217, 187, 0.36);
  box-shadow: 0 0 0 3px rgba(33, 217, 187, 0.12);
}

/* Oneclick step panels & diagnostics overlay */
body.dark-theme .oneclick-step {
  background:
    linear-gradient(135deg, rgba(33, 217, 187, 0.08), transparent 46%),
    #111a16;
  border-color: var(--line);
}

body.dark-theme .oneclick-step:hover {
  border-color: rgba(33, 217, 187, 0.22);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

body.dark-theme .step-number {
  background: #1a2520;
  border-color: var(--line);
}

body.dark-theme .oneclick-generate-all {
  background: linear-gradient(135deg, #0e8c77 0%, #0a6455 50%, #12a88e 100%);
  background-size: 200% 200%;
}

body.dark-theme .package-section {
  border-color: var(--line);
}

body.dark-theme .package-section-head {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
}

body.dark-theme .package-image-card {
  background: rgba(33, 217, 187, 0.08);
  border-color: rgba(33, 217, 187, 0.18);
}

body.dark-theme .package-image-preview {
  background: #0d1511;
  border-color: rgba(33, 217, 187, 0.18);
}

body.dark-theme .package-badge.pending {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

body.dark-theme .package-reminder {
  background: rgba(234, 179, 8, 0.06);
  border-color: rgba(234, 179, 8, 0.15);
  color: #d4b74a;
}

/* Hardcoded light container nodes override */
body.dark-theme .attribute-row,
body.dark-theme .uploaded-image-preview,
body.dark-theme .imagebed-file,
body.dark-theme .imagebed-empty,
body.dark-theme .converter-mini,
body.dark-theme .converter-summary article {
  background: #111a16;
  border-color: var(--line);
}

body.dark-theme .title-card,
body.dark-theme .optimization-card {
  background: #111a16;
  border-color: var(--line);
}

body.dark-theme .image-empty-state {
  background:
    linear-gradient(135deg, rgba(33, 217, 187, 0.08), rgba(230, 75, 60, 0.04)),
    #111a16;
  border-color: var(--line);
}

body.dark-theme .imagegen-config-panel {
  background: var(--surface);
}

body.dark-theme .imagegen-config-body {
  border-top-color: var(--line);
}

body.dark-theme .imagegen-style-card,
body.dark-theme .imagegen-size-card {
  background: var(--surface);
}

body.dark-theme .imagegen-preset-btn {
  background: var(--surface);
}

body.dark-theme .imagegen-prompt-history {
  background: var(--surface);
}

body.dark-theme .image-loading-progress {
  background: rgba(33, 217, 187, 0.1);
}

body.dark-theme .image-thumb {
  background: #16221d;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

body.dark-theme .imagebed-drop,
body.dark-theme .imagebed-thumb,
body.dark-theme .imagebed-folder,
body.dark-theme .imagebed-row,
body.dark-theme .imagebed-link-field,
body.dark-theme .imagebed-format-segments,
body.dark-theme .imagebed-prefix-presets button,
body.dark-theme .imagebed-format-segments button,
body.dark-theme .imagebed-toggle,
body.dark-theme .imagebed-search,
body.dark-theme .imagebed-domain-preview,
body.dark-theme .imagebed-view-tabs,
body.dark-theme .imagebed-view-tabs button {
  background: #111a16;
  border-color: var(--line);
}

body.dark-theme .imagebed-format-segments button.active,
body.dark-theme .imagebed-view-tabs button.active {
  background: #17231e;
}

body.dark-theme .imagebed-drop.dragging,
body.dark-theme .imagebed-drop:hover {
  background: rgba(33, 217, 187, 0.08);
  border-color: rgba(33, 217, 187, 0.34);
}

body.dark-theme .imagebed-card {
  background: #111a16;
  border-color: var(--line);
}

body.dark-theme .imagebed-manager-stats div,
body.dark-theme .imagebed-file-head,
body.dark-theme .imagebed-folder-head {
  background: #14201b;
  border-color: var(--line);
}

body.dark-theme .imagebed-row:hover,
body.dark-theme .imagebed-row.selected {
  background: rgba(33, 217, 187, 0.08);
}

body.dark-theme .auth-panel,
body.dark-theme .confirm-card,
body.dark-theme .admin-session-item,
body.dark-theme .admin-log-item,
body.dark-theme .admin-empty {
  background: rgba(24, 33, 31, 0.94);
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-theme .floating-field input,
body.dark-theme .admin-filters select,
body.dark-theme .admin-role-select,
body.dark-theme .admin-status-select {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--ink);
}

body.dark-theme .admin-users-table tr.selected td {
  background: rgba(33, 217, 187, 0.08);
}

/* Topbar brand logo & subtitle contrast adjustment in Dark Theme */
body.dark-theme .hero-brand-title .title-row {
  color: #e5ece9 !important; /* Premium high-contrast silver-white */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8) !important; /* Dark drop shadow instead of white */
}

body.dark-theme .hero-brand-title .title-subline {
  color: rgba(33, 217, 187, 0.68) !important; /* Luminous space-emerald subtitle text */
}

body.dark-theme .hero-brand-title .title-subline::before,
body.dark-theme .hero-brand-title .title-subline::after {
  background: rgba(33, 217, 187, 0.3) !important; /* Glowing subline boundaries */
}
