/**
 * Advanced Chart workspace — toolbar + full-height TradingView host.
 */
.lw-adv-chart-card {
  padding: 16px;
}

.lw-adv-chart-toolbar {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(200px, 1.25fr) auto;
  gap: 14px 16px;
  align-items: center;
  margin-bottom: 12px;
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.lw-adv-chart-label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
}

.lw-adv-chart-field--saved {
  min-width: 0;
}

.lw-adv-chart-select-wrap {
  position: relative;
}

.lw-adv-chart-select-wrap::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 12px;
  height: 8px;
  margin-top: -4px;
  pointer-events: none;
  background: center / contain no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23475569' d='M1.4.4 6 5l4.6-4.6L12 2l-6 6-6-6z'/%3E%3C/svg%3E");
}

.lw-adv-chart-input,
.lw-adv-chart-select {
  width: 100%;
  min-height: 44px;
  padding: 11px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.lw-adv-chart-input:focus,
.lw-adv-chart-select:focus {
  outline: none;
  border-color: #00568a;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.lw-adv-chart-input {
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.lw-adv-chart-select {
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 40px;
  background-color: #fff;
  color: #1e293b;
  line-height: 1.35;
}

.lw-adv-chart-select:invalid,
.lw-adv-chart-select option[value=""] {
  color: #64748b;
}

.lw-adv-chart-select option {
  font-weight: 500;
  color: #0f172a;
  background: #fff;
  padding: 8px;
}

.lw-adv-chart-select:disabled {
  cursor: not-allowed;
  color: #64748b;
  background-color: #f1f5f9;
}

.lw-adv-chart-symbol-wrap {
  position: relative;
}

.lw-adv-chart-suggest {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}

.lw-adv-chart-suggest-item {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.lw-adv-chart-suggest-item:hover {
  background: #f1f5f9;
}

.lw-adv-chart-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding-bottom: 1px;
}

.lw-adv-chart-fullpage {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #00568a;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.lw-adv-chart-fullpage:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #00568a;
}

.lw-adv-chart-fullpage .fa {
  font-size: 14px;
  opacity: 0.9;
}

.lw-adv-chart-btn {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.lw-adv-chart-btn--primary {
  background: #00568a;
  color: #fff;
}

.lw-adv-chart-btn--primary:hover {
  background: #004770;
}

.lw-adv-chart-btn--ghost {
  background: #fff;
  border-color: #cbd5e1;
  color: #334155;
}

.lw-adv-chart-btn--ghost:hover:not(:disabled) {
  background: #f8fafc;
}

.lw-adv-chart-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.lw-adv-chart-hint {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.45;
  color: #64748b;
}

.lw-adv-chart-host-wrap {
  min-height: 560px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  overflow: visible;
  background: #0f172a;
  touch-action: pan-y;
  overscroll-behavior: auto;
}

.lw-adv-chart-host {
  min-height: 560px;
}

.kse-chart-auth-dialog[hidden] {
  display: none;
}

.kse-chart-auth-dialog {
  position: fixed;
  z-index: 10020;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}

.kse-chart-auth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 12, 27, 0.72);
  backdrop-filter: blur(3px);
}

.kse-chart-auth-panel {
  position: relative;
  width: min(100%, 430px);
  box-sizing: border-box;
  padding: 32px;
  border: 1px solid #dbe5ec;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 64px rgba(2, 12, 27, 0.32);
  text-align: center;
}

.kse-chart-auth-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  color: #475569;
  background: transparent;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.kse-chart-auth-close:hover,
.kse-chart-auth-close:focus-visible {
  color: #0f172a;
  background: #f1f5f9;
}

.kse-chart-auth-icon {
  display: grid;
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  place-items: center;
  border-radius: 15px;
  color: #0f766e;
  background: #ccfbf1;
  font-size: 21px;
}

.kse-chart-auth-panel h2 {
  margin: 0 0 10px;
  color: #0f172a;
  font-size: 1.45rem;
}

.kse-chart-auth-panel p {
  margin: 0;
  color: #64748b;
  line-height: 1.55;
}

.kse-chart-auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 24px;
}

.kse-chart-auth-actions a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid #0f766e;
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
}

.kse-chart-auth-login {
  color: #0f766e;
  background: #fff;
}

.kse-chart-auth-signup {
  color: #fff;
  background: #0f766e;
}

.kse-chart-auth-login:hover,
.kse-chart-auth-login:focus-visible {
  color: #115e59;
  background: #f0fdfa;
}

.kse-chart-auth-signup:hover,
.kse-chart-auth-signup:focus-visible {
  color: #fff;
  background: #115e59;
}

@media (max-width: 900px) {
  .lw-adv-chart-toolbar {
    grid-template-columns: 1fr;
  }

  .lw-adv-chart-actions {
    width: 100%;
  }

  .lw-adv-chart-btn {
    flex: 1 1 auto;
  }
}

@media (max-width: 480px) {
  .kse-chart-auth-panel {
    padding: 28px 20px 22px;
  }

  .kse-chart-auth-actions {
    grid-template-columns: 1fr;
  }
}
