/* ==========================================================================
   PERSONAL SIGNAL DRAWER CSS (Research Desk / Bloomberg Terminal Style)
   Smart Running Trade - IDX Realtime Terminal
   Design System: Terminal Minimalist, High Contrast, Anti-Slop Compliant
   ========================================================================== */

.ps-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.65);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.ps-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.ps-drawer {
  --ps-panel: #10151b;
  --ps-surface: #151b22;
  --ps-inset: #0d1217;
  --ps-line: #29313b;
  --ps-line-soft: #1e262e;
  --ps-line-strong: #39424d;
  --ps-ink: #e8edf2;
  --ps-ink-strong: #f4f6f8;
  --ps-dim: #8e9aa7;
  --ps-faint: #7b8692;
  --ps-gold: #d6a84b;
  --ps-gold-ink: #f3d28f;
  --ps-green: #4fd19b;
  --ps-red: #ff7b7b;
  --ps-cyan: #38bdf8;

  position: fixed;
  top: 0;
  right: 44px;
  bottom: 0;
  width: 920px;
  max-width: calc(100vw - 44px);
  height: 100vh;
  background: var(--ps-panel);
  border-left: 1px solid var(--ps-line);
  border-right: 1px solid var(--ps-line);
  box-shadow: -16px 0 40px rgba(0, 0, 0, 0.7);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  transform: translateX(calc(100% + 44px));
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ps-ink);
  box-sizing: border-box;
}

.ps-drawer.open {
  transform: translateX(0);
}

/* Header */
.ps-header {
  padding: 12px 18px;
  background: var(--ps-surface);
  border-bottom: 1px solid var(--ps-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 16px;
}

.ps-hdr-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ps-hdr-kicker {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--ps-gold);
  text-transform: uppercase;
}

.ps-hdr-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.ps-hdr-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ps-ink-strong);
}

.ps-hdr-badge {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(214, 168, 75, 0.12);
  color: var(--ps-gold-ink);
  border: 1px solid rgba(214, 168, 75, 0.35);
  font-weight: 700;
}

.ps-hdr-sub {
  font-size: 11px;
  color: var(--ps-dim);
  line-height: 1.3;
}

.ps-hdr-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ps-btn-hdr {
  background: var(--ps-panel);
  border: 1px solid var(--ps-line);
  color: var(--ps-dim);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.ps-btn-hdr:hover {
  background: var(--ps-surface);
  color: var(--ps-gold);
  border-color: var(--ps-gold);
}

.ps-btn-close:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--ps-red);
  border-color: var(--ps-red);
}

/* Tabs Bar */
.ps-tabs-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 14px;
  background: var(--ps-inset);
  border-bottom: 1px solid var(--ps-line);
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.ps-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--ps-dim);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 10px 14px;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.ps-tab-btn:hover {
  color: var(--ps-ink-strong);
}

.ps-tab-btn.active {
  color: var(--ps-gold);
  border-bottom-color: var(--ps-gold);
}

/* Body */
.ps-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background: var(--ps-panel);
}

/* Section Headings */
.ps-section-head {
  min-height: 40px;
  padding: 8px 16px;
  background: var(--ps-surface);
  border-bottom: 1px solid var(--ps-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}

.ps-section-head b {
  font: 700 11.5px ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ps-ink-strong);
  letter-spacing: 0.06em;
}

.ps-section-head span {
  font-size: 10.5px;
  color: var(--ps-dim);
}

/* Console & Dialogue (Tab 1) */
.ps-console-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

.ps-console-feed {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--ps-panel);
}

.ps-log-entry {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  background: var(--ps-surface);
  border: 1px solid var(--ps-line);
  border-radius: 4px;
  transition: border-color 0.15s ease;
}

.ps-log-entry.user {
  border-left: 3px solid var(--ps-cyan);
  background: #0d1520;
}

.ps-log-entry.ai {
  border-left: 3px solid var(--ps-gold);
  background: #121822;
}

.ps-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.ps-log-entry.user .ps-log-head {
  color: var(--ps-cyan);
}

.ps-log-entry.ai .ps-log-head {
  color: var(--ps-gold);
}

.ps-log-text {
  font-size: 12px;
  line-height: 1.55;
  color: var(--ps-ink);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Spec Card (Formula Grid) */
.ps-spec-card {
  margin-top: 8px;
  background: var(--ps-inset);
  border: 1px solid var(--ps-line-strong);
  border-radius: 4px;
  overflow: hidden;
}

.ps-spec-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #141c26;
  border-bottom: 1px solid var(--ps-line);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--ps-gold-ink);
}

.ps-spec-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--ps-line);
}

.ps-spec-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 12px;
  border-right: 1px solid var(--ps-line);
  font-size: 11px;
}

.ps-spec-item:last-child {
  border-right: none;
}

.ps-spec-label {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9.5px;
  color: var(--ps-dim);
  text-transform: uppercase;
}

.ps-spec-val {
  font-weight: 700;
  color: var(--ps-ink-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.ps-spec-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 12px;
  background: #111720;
}

.ps-btn-primary {
  background: var(--ps-gold);
  color: #0b0f14;
  border: 1px solid #b88f3e;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
  letter-spacing: 0.04em;
}

.ps-btn-primary:hover {
  background: #e2b75a;
}

.ps-btn-sec {
  background: var(--ps-surface);
  color: var(--ps-ink);
  border: 1px solid var(--ps-line);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ps-btn-sec:hover {
  background: #1c242e;
  color: var(--ps-gold);
  border-color: var(--ps-line-strong);
}

/* Prompt Console Bar */
.ps-console-bottom {
  padding: 12px 18px;
  background: var(--ps-surface);
  border-top: 1px solid var(--ps-line);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

.ps-chips-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.ps-chip-btn {
  background: var(--ps-inset);
  border: 1px solid var(--ps-line);
  color: var(--ps-dim);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  padding: 4px 9px;
  border-radius: 3px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.12s ease;
}

.ps-chip-btn:hover {
  background: #1a222c;
  color: var(--ps-ink-strong);
  border-color: var(--ps-line-strong);
}

.ps-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.ps-input-field {
  flex: 1;
  background: var(--ps-inset);
  border: 1px solid var(--ps-line);
  color: var(--ps-ink-strong);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 12.5px;
  padding: 9px 12px;
  border-radius: 4px;
  outline: none;
  transition: border-color 0.15s ease;
}

.ps-input-field:focus {
  border-color: var(--ps-gold);
  box-shadow: 0 0 0 1px rgba(214, 168, 75, 0.25);
}

/* Scanner Table (Tab 2) */
.ps-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--ps-inset);
  border-bottom: 1px solid var(--ps-line);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: var(--ps-dim);
  flex-shrink: 0;
}

.ps-meta-bar b {
  color: var(--ps-gold);
  font-weight: 700;
}

.ps-table-container {
  flex: 1;
  overflow: auto;
  background: var(--ps-panel);
}

.ps-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  text-align: left;
}

.ps-table th {
  position: sticky;
  top: 0;
  background: var(--ps-surface);
  border-bottom: 1px solid var(--ps-line);
  color: var(--ps-dim);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 8px 10px;
  text-transform: uppercase;
  z-index: 2;
  white-space: nowrap;
}

.ps-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--ps-line-soft);
  color: var(--ps-ink);
  vertical-align: middle;
  white-space: nowrap;
}

.ps-table tr:hover td {
  background: #141b24;
}

.ps-ticker-link {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--ps-cyan);
  cursor: pointer;
  text-decoration: none;
}

.ps-ticker-link:hover {
  color: #7dd3fc;
  text-decoration: underline;
}

.ps-badge-gain {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 700;
  color: var(--ps-green);
  background: rgba(79, 209, 155, 0.1);
  border: 1px solid rgba(79, 209, 155, 0.35);
}

.ps-badge-loss {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 700;
  color: var(--ps-red);
  background: rgba(255, 123, 123, 0.1);
  border: 1px solid rgba(255, 123, 123, 0.35);
}

.ps-btn-table {
  background: transparent;
  border: 1px solid var(--ps-line);
  color: var(--ps-dim);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.ps-btn-table:hover {
  background: var(--ps-surface);
  color: var(--ps-gold);
  border-color: var(--ps-gold);
}

/* Strategy Cards (Tab 3) */
.ps-cards-list {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.ps-strat-card {
  background: var(--ps-surface);
  border: 1px solid var(--ps-line);
  border-radius: 4px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s ease;
}

.ps-strat-card:hover {
  border-color: var(--ps-line-strong);
}

.ps-strat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ps-strat-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ps-ink-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.ps-strat-desc {
  font-size: 11.5px;
  color: var(--ps-dim);
  line-height: 1.4;
}

.ps-strat-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Switch */
.ps-switch {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 18px;
}

.ps-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.ps-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #29313b;
  transition: 0.2s;
  border-radius: 18px;
}

.ps-slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  transition: 0.2s;
  border-radius: 50%;
}

.ps-switch input:checked + .ps-slider {
  background-color: var(--ps-green);
}

.ps-switch input:checked + .ps-slider:before {
  transform: translateX(14px);
}

/* Notification Settings (Tab 4) */
.ps-settings-grid {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 740px;
}

.ps-setting-card {
  background: var(--ps-surface);
  border: 1px solid var(--ps-line);
  border-radius: 4px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ps-setting-hdr {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--ps-gold);
  border-bottom: 1px solid var(--ps-line-soft);
  padding-bottom: 8px;
}

.ps-form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ps-form-group label {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  color: var(--ps-dim);
  text-transform: uppercase;
}

.ps-form-group input {
  background: var(--ps-inset);
  border: 1px solid var(--ps-line);
  color: var(--ps-ink-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 4px;
  outline: none;
}

.ps-form-group input:focus {
  border-color: var(--ps-gold);
}

.ps-helper-text {
  font-size: 10.5px;
  color: var(--ps-faint);
  line-height: 1.4;
}

/* Empty / State Notices */
.ps-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  color: var(--ps-dim);
  gap: 8px;
}

.ps-empty-state b {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  color: var(--ps-ink);
}

.ps-empty-state p {
  font-size: 11.5px;
  max-width: 420px;
  line-height: 1.5;
  margin: 0;
}


/* Notification 2-Column Layout & Side Guide */
.ps-notif-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 16px;
  padding: 16px 20px;
}

@media (max-width: 860px) {
  .ps-notif-layout {
    grid-template-columns: 1fr;
  }
}

.ps-settings-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ps-guide-card {
  background: var(--ps-surface);
  border: 1px solid var(--ps-line);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  height: fit-content;
}

.ps-guide-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--ps-inset);
  border-bottom: 1px solid var(--ps-line);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--ps-gold);
}

.ps-guide-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ps-guide-step {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.ps-step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(214, 168, 75, 0.15);
  border: 1px solid var(--ps-gold);
  color: var(--ps-gold);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.ps-step-content {
  flex: 1;
  font-size: 11px;
  line-height: 1.45;
  color: var(--ps-ink);
}

.ps-step-content b {
  display: block;
  font-size: 11.5px;
  color: var(--ps-ink-strong);
  margin-bottom: 3px;
}

.ps-step-content p {
  margin: 3px 0;
  color: var(--ps-dim);
}

.ps-code-chip {
  display: inline-block;
  background: var(--ps-inset);
  border: 1px solid var(--ps-line-strong);
  color: var(--ps-cyan);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  padding: 1px 5px;
  border-radius: 3px;
}

.ps-step-tip {
  color: var(--ps-gold-ink) !important;
  font-size: 10.5px;
}

.ps-step-note {
  color: var(--ps-red) !important;
  font-size: 10.5px;
}

.ps-guide-list {
  margin: 3px 0 3px 16px;
  padding: 0;
  color: var(--ps-dim);
  font-size: 10.5px;
}


/* Config Modal & Web Toast */
.ps-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10005;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.ps-modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.ps-config-modal {
  width: 520px;
  max-width: 92vw;
  background: #151b22;
  border: 1px solid #39424d;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.85);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #e8edf2;
  transform: translateY(12px) scale(0.98);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.ps-modal-backdrop.open .ps-config-modal {
  transform: translateY(0) scale(1);
}

.ps-modal-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: #0d1217;
  border-bottom: 1px solid #29313b;
}

.ps-modal-title {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ps-gold);
  letter-spacing: 0.05em;
}

.ps-modal-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 80vh;
  overflow-y: auto;
}

.ps-modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ps-modal-field label {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ps-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ps-modal-input {
  background: #0d1217;
  border: 1px solid #29313b;
  color: #f4f6f8;
  font-family: inherit;
  font-size: 12.5px;
  padding: 8px 12px;
  border-radius: 4px;
  outline: none;
}

.ps-modal-input:focus {
  border-color: var(--ps-gold);
}

.ps-time-picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.ps-time-input {
  background: #0d1217;
  border: 1px solid #29313b;
  color: var(--ps-gold);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  width: 110px;
}

.ps-time-input:focus {
  border-color: var(--ps-gold);
}

.ps-radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #0d1217;
  border: 1px solid #29313b;
  border-radius: 4px;
  padding: 10px 14px;
}

.ps-radio-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 12px;
}

.ps-radio-opt input[type="radio"] {
  cursor: pointer;
  accent-color: var(--ps-gold);
}

.ps-check-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #0d1217;
  border: 1px solid #29313b;
  border-radius: 4px;
  padding: 10px 14px;
}

.ps-check-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 12px;
}

.ps-check-opt input[type="checkbox"] {
  cursor: pointer;
  accent-color: var(--ps-cyan);
}

.ps-modal-ftr {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px;
  background: #0d1217;
  border-top: 1px solid #29313b;
}

/* Floating Web Toast Alert */
.ps-web-toast-container {
  position: fixed;
  bottom: 24px;
  right: 64px;
  z-index: 10010;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.ps-web-toast {
  width: 340px;
  background: #151b22;
  border: 1px solid var(--ps-gold);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.9);
  border-radius: 4px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: auto;
  animation: psToastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes psToastIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.ps-toast-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ps-toast-title {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--ps-gold);
}

.ps-toast-time {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9.5px;
  color: var(--ps-dim);
}

.ps-toast-body {
  font-size: 12px;
  line-height: 1.45;
  color: #f4f6f8;
}

.ps-toast-ftr {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}


/* Interactive Quick Reply Chips in Chat */
.ps-chat-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed rgba(214, 168, 75, 0.25);
}

.ps-chat-chip-btn {
  background: rgba(214, 168, 75, 0.08);
  border: 1px solid rgba(214, 168, 75, 0.4);
  color: var(--ps-gold-ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ps-chat-chip-btn:hover {
  background: var(--ps-gold);
  color: #0b0f14;
  border-color: var(--ps-gold);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(214, 168, 75, 0.3);
}

/* Interactive Tuning Box in Formula Spec Card */
.ps-tune-box {
  background: #0d1219;
  border-top: 1px solid var(--ps-line-soft);
  padding: 8px 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-size: 11px;
}

.ps-tune-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.ps-tune-input {
  background: #0b0f14;
  border: 1px solid var(--ps-line);
  color: var(--ps-gold-ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 3px;
  outline: none;
}

.ps-tune-input:focus {
  border-color: var(--ps-gold);
}

.ps-tune-select {
  background: #0b0f14;
  border: 1px solid var(--ps-line);
  color: var(--ps-ink-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 3px;
  outline: none;
}

.ps-tune-select:focus {
  border-color: var(--ps-gold);
}

.ps-tune-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--ps-dim);
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.ps-tune-check input {
  accent-color: var(--ps-gold);
  cursor: pointer;
}
