﻿.context-menu-root[hidden] { display: none; }
.context-menu { position: fixed; min-width: 230px; z-index: 1000; padding: 8px; background: rgba(16,24,39,.98); backdrop-filter: blur(16px); border: 1px solid rgba(148,163,184,.18); border-radius: 16px; box-shadow: var(--shadow); overflow: visible; }
.context-menu-body { min-width: 230px; max-width: min(320px, calc(100vw - 16px)); }
.context-item { display: flex; align-items: center; width: 100%; text-align: left; background: transparent; color: var(--txt); border: 0; border-radius: 9px; padding: 8px 10px; }
.context-item-inner { display: inline-flex; align-items: center; gap: 8px; min-width: 0; width: 100%; }
.context-item-text { flex: 1; min-width: 0; }
.context-item-icon { flex: 0 0 16px; width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center; color: #94a3b8; }
.context-item-icon svg { display: block; width: 16px; height: 16px; }
.context-item-icon .ctx-platform-img { display: block; width: 16px; height: 16px; object-fit: contain; border-radius: 2px; }
.context-item:hover { background: rgba(95,115,120,.14); transform: none; }
.context-item.disabled { color: var(--muted); cursor: default; font-weight: 700; }
.context-item.danger { color: var(--err); }
.context-divider { height: 1px; background: #4b5557; margin: 6px 2px; }
.context-item-wrap { position: relative; }
.context-item-wrap.has-submenu > .context-item { padding-right: 28px; }
.context-item-wrap.has-submenu > .context-item::after { content: '›'; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.context-item-wrap.has-submenu.disabled > .context-item { color: var(--muted); cursor: default; }
.context-item-wrap.submenu-active > .context-item { background: rgba(95,115,120,.14); }
.context-submenu { position: fixed; min-width: 240px; max-width: min(280px, calc(100vw - 16px)); padding: 8px; background: rgba(16,24,39,.98); backdrop-filter: blur(16px); border: 1px solid rgba(148,163,184,.18); border-radius: 16px; box-shadow: var(--shadow); z-index: 1100; overflow-x: hidden; }
.context-submenu[hidden] { display: none !important; }
.context-submenu-palette { min-width: 0; max-width: calc(100vw - 16px); width: max-content; padding: 0; overflow: visible; }
.context-color-panel { padding: 12px 14px; }
.context-color-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; width: 274px; max-width: calc(100vw - 44px); }
.context-color-dot { width: 100%; aspect-ratio: 1; border-radius: 4px; border: 2px solid rgba(255,255,255,.12); cursor: pointer; padding: 0; transition: border-color .12s, transform .12s; box-sizing: border-box; }
.context-color-dot:hover { border-color: rgba(255,255,255,.75); transform: scale(1.08); }
.modal-bg { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.55); align-items: center; justify-content: center; z-index: 900; backdrop-filter: blur(4px); }
.modal-bg.show { display: flex; }
.modal,
.modal-panel {
  width: min(920px, 94vw);
  max-width: 94vw;
  max-height: 92vh;
  overflow: auto;
  padding: 0;
  background: #202627;
  border: 1px solid #4b5557;
  border-radius: 4px;
  box-shadow: 0 18px 48px rgba(0,0,0,.48);
  font-family: 'Segoe UI', Arial, sans-serif;
}
.modal-common { width: min(560px, 92vw); }
.modal-import { width: 780px; }
.modal-send-trade { width: 700px; }
.modal-head {
  padding: 10px 14px 8px;
  border-bottom: 1px solid #343c3e;
  background: #3f3f3f;
}
.modal-head .eyebrow,
.modal-panel .eyebrow {
  margin: 0 0 2px;
  color: #b8c0c3;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.modal-head h3,
.modal-panel .modal-head h3 {
  margin: 0;
  color: var(--txt);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.1px;
}
.modal-head span,
.modal-panel .modal-head span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}
.modal-panel > .import-grid,
.modal-panel > .send-trade-form,
.modal-panel > .common-modal-body,
.modal-panel > .bulk-proxy-head,
.modal-panel > .bulk-proxy-editor,
.modal-panel > .import-summary,
.modal-panel > .import-options,
.modal-panel > .modal-actions {
  margin-left: 18px;
  margin-right: 18px;
}
.modal-panel > .import-grid,
.modal-panel > .send-trade-form,
.modal-panel > .common-modal-body,
.modal-panel > .bulk-proxy-head {
  margin-top: 14px;
}
.common-modal-body textarea { margin: 0; }
.modal-message {
  margin: 0;
  color: #b8c4c8;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}
.modal-panel > .modal-actions {
  padding: 12px 0 14px;
  border-top: 1px solid #344143;
}
.modal-panel > .modal-actions button {
  min-width: 92px;
  padding: 8px 15px;
  border-radius: 3px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .01em;
  background: #454545;
  color: #e6edf0;
  border-color: #5a5a5a;
  transform: none;
}
.modal-panel > .modal-actions button.secondary {
  background: #303536;
  color: #e6edf0;
  border-color: #4b5557;
}
.modal-panel > .modal-actions button:hover {
  background: #535353;
  border-color: #737373;
  opacity: 1;
  transform: none;
}
.modal-panel > .modal-actions button.secondary:hover {
  background: #3a4446;
  border-color: #647174;
}
.modal-panel > .modal-actions button:focus-visible {
  outline: 2px solid #cfd8dc;
  outline-offset: 2px;
}
.modal-panel.modal-panel--confirm { width: min(400px, 92vw); }
.modal-panel--confirm > .common-modal-body {
  margin-top: 12px;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.modal-panel--confirm > .modal-actions {
  margin-top: 10px;
  padding: 10px 0 12px;
  border-top: 0;
}

.context-menu { border-radius: 3px; background: #202627; border-color: #4b5557; }
.context-item { border-radius: 2px; padding: 6px 8px; }
.context-submenu { border-radius: 3px; background: #202627; border-color: #4b5557; }
.context-submenu-palette { border-radius: 3px; }
.context-color-dot { border-radius: 3px; }
.inline-cell-editor {
  position: fixed;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  width: auto;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(148,163,184,.18);
  background: #1c2324;
  box-shadow: 0 10px 32px rgba(0,0,0,.42);
}
.inline-cell-editor .modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 8px 7px 12px;
  border-bottom: 1px solid rgba(148,163,184,.12);
  background: rgba(15,23,42,.45);
}
.inline-cell-editor .modal-head-main { min-width: 0; flex: 1; }
.inline-cell-editor .modal-head h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  color: #e2e8f0;
}
.inline-cell-editor .modal-head span {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  color: var(--muted);
  line-height: 1.3;
}
.inline-cell-editor .cell-editor-close {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 4px;
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 16px;
  line-height: 1;
  transform: none;
}
.inline-cell-editor .cell-editor-close:hover {
  background: rgba(148,163,184,.12);
  color: #e2e8f0;
  opacity: 1;
  transform: none;
}
.inline-cell-editor .common-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  margin: 0;
  padding: 10px 12px;
  border: 0;
  background: transparent;
}
.inline-cell-editor--readonly .common-modal-body {
  padding: 8px 12px 10px;
}
.inline-cell-editor .cell-editor-content {
  max-height: min(280px, 50vh);
  overflow: auto;
  font-size: 12px;
  line-height: 1.5;
  color: #e6edf0;
  white-space: pre-wrap;
  word-break: break-word;
  user-select: text;
}
.inline-cell-editor .modal-actions {
  flex-shrink: 0;
  margin: 0;
  padding: 7px 10px 8px;
  border-top: 1px solid rgba(148,163,184,.1);
  gap: 6px;
}
.inline-cell-editor.modal-panel > .modal-actions button {
  min-width: 0;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  transform: none;
}
.inline-cell-editor.modal-panel > .modal-actions button:hover {
  transform: none;
}
.inline-cell-editor.modal-panel > .modal-actions button.secondary {
  background: #2a3132;
  border-color: #3f4a4c;
}
.inline-cell-editor.modal-panel > .import-grid,
.inline-cell-editor.modal-panel > .send-trade-form,
.inline-cell-editor.modal-panel > .common-modal-body,
.inline-cell-editor.modal-panel > .bulk-proxy-head,
.inline-cell-editor.modal-panel > .bulk-proxy-editor,
.inline-cell-editor.modal-panel > .import-summary,
.inline-cell-editor.modal-panel > .import-options,
.inline-cell-editor.modal-panel > .modal-actions {
  margin-left: 0;
  margin-right: 0;
}
.inline-cell-editor.modal-panel > .import-grid,
.inline-cell-editor.modal-panel > .send-trade-form,
.inline-cell-editor.modal-panel > .common-modal-body,
.inline-cell-editor.modal-panel > .bulk-proxy-head {
  margin-top: 0;
}
.inline-cell-editor.modal-panel > .modal-actions {
  margin-top: 0;
  padding-top: 7px;
  padding-bottom: 8px;
}


.modal-panel.inline-cell-editor .modal-head { padding: 6px 8px 6px 10px; }
.modal-panel.inline-cell-editor .modal-head h3 { margin: 0; font-size: 12px; font-weight: 600; }
.modal-auto-price .auto-price-user-row { padding: 12px 18px; border-bottom: 1px solid #343c3e; background: #2a3031; }
.modal-auto-price .auto-price-user-row label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #e6edf0; }
.modal-auto-price .auto-price-user-row select { min-width: 180px; }
.field-card { border: 1px solid #3d4a4d; background: #1b2223; border-radius: 7px; padding: 10px; }
.field-card.compact { padding: 8px 10px; }
.form-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #e6edf0; font-size: 12px; font-weight: 700; margin-bottom: 6px; }
.help-text { display: block; min-height: 28px; color: var(--muted); font-size: 11px; line-height: 1.35; margin-bottom: 8px; }
.modal-panel textarea, .modal-panel input[type=text], .modal-panel input[type=number] {
  display: block;
  width: 100%;
  box-sizing: border-box;
  background: #121819;
  border-color: #4a585b;
  border-radius: 5px;
  font-family: inherit;
  font-size: 12px;
}
.modal-panel textarea { min-height: 260px; resize: vertical; line-height: 1.45; }
.inline-cell-editor.modal-panel textarea {
  min-height: 88px;
  max-height: min(240px, 40vh);
  resize: vertical;
  border-radius: 5px;
}
.inline-cell-editor.modal-panel .field-card {
  padding: 8px;
  border-radius: 5px;
  border-color: rgba(148,163,184,.14);
  background: rgba(12,18,24,.55);
}
.common-modal-body textarea { margin: 0; }
.modal-panel textarea:focus, .modal-panel input[type=text]:focus, .modal-panel input[type=number]:focus { border-color: #7b878a; box-shadow: 0 0 0 2px rgba(148,163,184,.12); }

.pill { display: inline-flex; align-items: center; min-height: 22px; padding: 3px 8px; margin-left: 5px; border: 1px solid #3d4a4d; border-radius: 999px; background: #1b2223; font-size: 11px; }

#toast.toast {
  position: fixed;
  top: 48px;
  right: 12px;
  z-index: 20000;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 220px;
  max-width: min(440px, calc(100vw - 24px));
  padding: 14px 16px;
  border-radius: 8px;
  border: 0;
  color: #fff;
  font-size: 13px;
  line-height: 1.45;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
  pointer-events: none;
  cursor: default;
}
#toast.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
  cursor: pointer;
}
#toast.toast.ok {
  background: #3d9a47;
}
#toast.toast.err {
  background: #c62828;
}
#toast .toast-icon {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  margin-top: 1px;
  color: #fff;
}
#toast .toast-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}
#toast .toast-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
#toast .toast-title {
  font-size: 14px;
  font-weight: 700;
}
#toast .toast-msg {
  font-size: 13px;
  font-weight: 400;
  opacity: .96;
  word-break: break-word;
}

.shell-error {
  margin: 20px;
  padding: 12px;
  border: 1px solid var(--err);
  border-radius: 4px;
  color: var(--err);
  background: rgba(239,68,68,.08);
  white-space: pre-wrap;
}

