/* LOI WORKSPACE STYLES - INTEGRATED INTO WISERISE EXPANSION */
.loi-panel-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
  padding: 24px;
  margin-top: 14px;
}

.loi-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.loi-panel-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 8px;
}
.loi-panel-desc {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 3px;
}

/* LOI WORKSPACE GRID */
.loi-workspace-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
}
@media (max-width: 1080px) {
  .loi-workspace-grid { grid-template-columns: 1fr; }
}

.loi-form-panel {
  background: #fafafa;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  height: fit-content;
}
.loi-form-group { margin-bottom: 11px; }
.loi-form-group label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.loi-input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12.5px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
}
.loi-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
}
.loi-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.flyer-drop-box {
  border: 2px dashed #94a3b8;
  border-radius: 8px;
  background: #f8fafc;
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 12px;
}
.flyer-drop-box:hover, .flyer-drop-box.drag-over {
  border-color: #2563eb;
  background: #eff6ff;
}

.deal-economics-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  margin-top: 6px;
  margin-bottom: 10px;
}

.btn-micro {
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #64748b;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-micro:hover { background: #eff6ff; color: #2563eb; }
.btn-micro.active { background: var(--navy); color: #fff; border-color: var(--navy); }

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--navy);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-action:hover { opacity: 0.9; transform: translateY(-1px); }

/* OFFICIAL LETTER SHEET */
.loi-letter-sheet {
  background: #fff;
  border: 1px solid #d1d5db;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  padding: 32px 38px;
  color: #111;
  font-size: 11.5px;
  line-height: 1.35;
  border-radius: 4px;
}
.banner-tbl { width: 100%; border-collapse: collapse; border-bottom: 2px solid var(--navy); margin-bottom: 12px; }
.banner-tbl td { vertical-align: middle; padding-bottom: 10px; }
.logo-cell { width: 72px; }
.logo-box { width: 64px; height: 64px; border: 1px solid #E5E7EB; border-radius: 8px; overflow: hidden; background: #fff; }
.logo-box img { width: 64px; height: 64px; display: block; object-fit: cover; }
.loi-doc-title { font-size: 16px; font-weight: 800; letter-spacing: 0.06em; color: var(--navy); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.loi-doc-sub { font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #334155; }
.loi-doc-meta { font-size: 11px; color: #64748B; }

.sec-tbl { width: 100%; border-collapse: collapse; border: 1px solid #E5E7EB; border-radius: 6px; margin-bottom: 6px; }
.sec-h { background: var(--navy); color: #fff; font-size: 10.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; padding: 6px 10px; }
.k-cell { width: 34%; color: #4B5563; font-weight: 700; background: #FAFBFC; padding: 5px 10px; border-top: 1px solid #EEF2F7; vertical-align: top; }
.v-cell { padding: 5px 10px; border-top: 1px solid #EEF2F7; vertical-align: top; color: #111; }

.prot-cell { width: 50%; padding: 8px 10px; border-top: 1px solid #E5EAF0; vertical-align: top; }
.prot-k { font-weight: 800; color: var(--navy); font-size: 11.5px; margin-bottom: 2px; }
.prot-d { color: #171717; font-size: 11px; line-height: 1.35; }

.sig-h { background: var(--navy); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: 0.06em; padding: 6px 10px; margin-top: 8px; }
.sig-tbl { width: 100%; border-collapse: collapse; margin-top: 6px; }
.sig-tbl td { width: 50%; vertical-align: top; padding: 6px 14px 0 4px; }
.sig-line { border-bottom: 1px solid #111; height: 22px; margin: 4px 0; }
.sig-tbl p { margin: 0; font-size: 11px; color: #334155; }

/* TOAST */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--navy);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  display: none;
  z-index: 999;
}

/* PRINT */
@media print {
  body { background: #fff !important; padding: 0 !important; }
  .sidebar, .topbar, .trust-strip, .hero, #overview-view, #properties-view, #pipeline-view, #readiness-view,
  .loi-panel-header, .loi-form-panel, .loi-actions-bar, #email-box, #draft-status-box, .toast, footer {
    display: none !important;
  }
  .shell { margin: 0 !important; width: 100% !important; }
  main { padding: 0 !important; }
  .loi-panel-card { border: none !important; box-shadow: none !important; padding: 0 !important; margin: 0 !important; }
  .loi-workspace-grid { display: block !important; }
  .loi-letter-sheet { border: none !important; box-shadow: none !important; padding: 0 !important; margin: 0 !important; width: 100% !important; }
  @page { size: letter; margin: 0.5in; }
}


/* ZERO-CSP INLINE UTILITIES FOR LOI VIEW */
.hidden-input { display: none; }
.flyer-doc-icon { font-size: 26px; margin-bottom: 2px; }
.flyer-label-title { font-weight: 800; font-size: 12.5px; color: var(--navy); }
.flyer-label-sub { font-size: 11px; color: #64748b; }
.loi-group-caption { font-size: 10.5px; font-weight: 700; color: #64748b; text-transform: uppercase; margin-bottom: 3px; display: block; }
.preset-select { font-weight: 600; background: #f8fafc; }
.brand-label-row { color: #1e3a8a; font-size: 11px; display: flex; justify-content: space-between; }
.auto-llc-tag { color: #b45309; font-weight: 800; }
.brand-select { font-weight: 700; background: #f8fafc; border-color: #cbd5e1; }
.custom-brand-group { display: none; }
.tenant-input { font-weight: 600; background: #f1f5f9; }

.deal-econ-header { font-size: 10.5px; font-weight: 800; color: var(--navy); text-transform: uppercase; margin-bottom: 6px; display: flex; justify-content: space-between; }
.auto-math-tag { color: #059669; }
.field-label-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; }
.field-label { margin: 0; }
.micro-btn-group { display: flex; gap: 2px; }

.btn-toggle-email { width: 100%; justify-content: center; padding: 8px 0; font-size: 12px; }

.loi-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0b1f3a;
  color: #fff;
  padding: 10px 16px;
  border-radius: 6px;
  flex-wrap: wrap;
  gap: 10px;
}
.dispatch-title { font-weight: 800; font-size: 13px; color: #f5e7b2; display: flex; align-items: center; gap: 6px; }
.dispatch-sub { font-size: 11px; color: #94a3b8; margin-top: 2px; }
.dispatch-actions { display: flex; gap: 8px; }
.btn-dispatch-outline { background: rgba(255,255,255,0.15); color: #fff; border-color: rgba(255,255,255,0.3); }
.btn-dispatch-gold { background: #c4a35a; color: #1a1400; border: none; font-weight: 800; padding: 6px 14px; }

.draft-status-box {
  display: none;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  padding: 12px 16px;
}
.draft-status-box-inner { display: flex; justify-content: space-between; align-items: flex-start; }
.draft-tag { background: #10b981; color: #fff; font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 4px; display: inline-block; margin-bottom: 4px; }
.draft-title-text { font-weight: 800; font-size: 13px; color: #065f46; }
.draft-meta-text { font-size: 11.5px; color: #047857; margin-top: 2px; }
.btn-slack-review { background: #047857; color: #fff; border: none; }

.meta-badge { color: #B8860B; font-weight: 800; }
.meta-dot { color: #D1D5DB; padding: 0 6px; }
.sig-line-date { margin-top: 12px; }

.email-toggle-box {
  display: none;
  background: #fafafa;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px;
}
.email-box-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.email-box-heading { font-size: 12px; font-weight: 800; color: var(--navy); }
.broker-email-textarea {
  width: 100%;
  min-height: 130px;
  padding: 8px;
  font-size: 11.5px;
  font-family: monospace;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
}

.mb-12 { margin-bottom: 12px; }
.loi-letter-column { display: flex; flex-direction: column; gap: 12px; }

/* Language toggle visibility */
html[lang="en"] .lang-zh { display: none !important; }
html[lang="zh"] .lang-en { display: none !important; }
body:not(.lang-zh) .lang-zh { display: none !important; }
body.lang-zh .lang-en { display: none !important; }

.btn-danger { color: #dc2626 !important; }

/* Freshness Watchdog Header Status Pill */
.system-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.system-status-pill:hover {
  background: #f9fafb;
  border-color: rgba(0, 0, 0, 0.25);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}
.system-status-pill:active {
  transform: scale(0.97);
}
.status-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-pulse-dot.online {
  background-color: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse-green 2.2s infinite;
}
.status-pulse-dot.stale {
  background-color: #f59e0b;
  box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
  animation: pulse-amber 2s infinite;
}
.status-pulse-dot.offline {
  background-color: #ef4444;
}
.status-pulse-dot.new-version {
  background-color: #8b5cf6;
  box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.7);
  animation: pulse-purple 1.5s infinite;
}
@keyframes pulse-green {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
@keyframes pulse-amber {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}
@keyframes pulse-purple {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 7px rgba(139, 92, 246, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(139, 92, 246, 0); }
}
.status-refresh-icon {
  font-size: 13px;
  color: #6b7280;
  display: inline-block;
  line-height: 1;
  margin-left: 2px;
  transition: transform 0.2s ease;
}
.status-refresh-icon.spinning {
  animation: spin-refresh 0.75s linear infinite;
}
@keyframes spin-refresh {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
