* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding-left: 2%;
  font-family: Verdana, sans-serif;
  background: #f5f6f8;
  color: #1f2937;
}

.container {
  max-width: 1100px;
  margin: 24px auto;
  padding: 0 0px;
}

h1 {
  margin: 0 0 20px;
  font-size: 1.7rem;
}

.hint {
  margin: 0 0 10px;
  font-size: 0.95rem;
}

.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 14px;
}

.tickerInfo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 14px;
}

.row {
  margin: 0;
}

.controls-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.controls-row:nth-of-type(1) {
  margin-bottom: 30px; /* space between Quote and Chart rows */
}

.controls-row:nth-of-type(2) {
  margin-bottom: 20px; /* space between Chart and Prev rows */
}

.metrics-row + .metrics-row {
  margin-top: 10px; /* space between Prev/Open and Open/Bid rows */
}

.metrics-row:last-of-type {
  grid-template-columns: 150px 150px 90px 90px; /* wider Bid/Ask, narrower P/E/EPS */
}

.metrics-row:last-of-type .metric input {
  width: 100%; /* fill the grid cell */
}

#tickerInput {
  height: 40px;
  width: 80px;
  border: 1px solid #cfd4dc;
  border-radius: 8px;
  padding: 0 10px;
  min-width: 120px;
  font-size: 0.95rem;
}

.checkboxWrap {
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/*
#tickerInput{
    width: 120px;
}
*/

#tickerSuggestions {
  position: absolute;
  top: 100%;
  left: 0;
  width: 300px;
  background: white;
  border: 1px solid #ccc;
  z-index: 1000;
  display: none;
  max-height: 300px;
  overflow-y: auto;
}

.tickerSuggestion {
  padding: 6px 10px;
  cursor: pointer;
}

.tickerSuggestion:hover {
  background: #eee;
}

#intradayBtn,
#epsBtn,
#quoteBtn,
#dailyBtn {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  background: #1d4ed8;
  color: #fff;
  cursor: pointer;
  font-size: 0.95rem;
}

#intradayBtn:hover,
#epsBtn:hover,
#quoteBtn:hover,
#dailyBtn:hover {
  background: #7ca6fa;
}

.metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 120px);
  gap: 8px; /* gap between metric cells */
}

.metrics-row.third-row {
  grid-template-columns: 150px 150px 90px 90px; /* wider Bid/Ask, narrower P/E/EPS */
}

.metrics-row.third-row .metric input {
  width: 100%;
}

.metrics-row.forth-row {
  grid-template-columns: 90px 90px 150px 150px; /* wider Bid/Ask, narrower P/E/EPS */
}

.metrics-row.forth-row .metric input {
  width: 100%;
}

.metric {
  display: flex;
  flex-direction: column; /* label above the input */
  align-items: center; /* center-align label and box */
  gap: 2px; /* minimal gap between label and box */
  font-size: 0.88rem;
}

.metric input {
  height: 38px;
  width: 120px; /* fixed smaller width */
  max-width: 100%;
  align-self: center;
  border: 1px solid #cfd4dc;
  border-radius: 8px;
  padding: 0 6px;
  background: #fff;
  color: #1f2937;
  font-size: 0.9rem;
  text-align: center;
}

.metric input.positive {
  color: green;
  font-weight: bold;
}

.metric input.negative {
  color: red;
  font-weight: bold;
}

#status {
  font-size: 0.9rem;
}


#chartContainer {
  width: 98%;
  margin-top: 20px;
  background: white;
  border: 1px solid #cfd4dc;
}

#chartContainer iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.top-row {
  display: flex;
  align-items: flex-start;
  gap: 30px;
  width: 100%;
  margin-bottom: 40px;
}

.company-section {
  display: flex;
  flex-direction: column;
}

.ticker-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.tickerInputWrap {
  position: relative;
}

#tickerInfo {
  margin-top: 8px;
  line-height: 1.4;
}

.index-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.index-row {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.index-label {
  width: 60px;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: right;
}

.index-row input {
  height: 34px;
  width: 110px;

  border: 1px solid #cfd4dc;
  border-radius: 8px;

  padding: 0 6px;

  background: #fff;
  color: #1f2937;

  font-size: 0.9rem;

  text-align: center;
}

.index-row input.positive {
  color: green;
  font-weight: bold;
}

.index-row input.negative {
  color: red;
  font-weight: bold;
}

.index-row input.index-price {
  width: 100px;
}

.index-row input.index-change {
  width: 80px;
}

.index-row input.index-percent {
  width: 80px;
}





#chartContainer {
  width: 98%;
  margin-top: 20px;
  background: white;
  border: 1px solid #cfd4dc;
}

#chartContainer iframe {
  width: 100%;
  border: none;
  display: block;
}


/* Daily chart */
#chartContainer.daily-chart {
  height: 840px;
}

#chartContainer.daily-chart iframe {
  height: 100%;
}


/* Intraday chart */
#chartContainer.intraday-chart {
  height: 840px;
}

#chartContainer.intraday-chart iframe {
  height: 100%;
}


/* EPS chart */
#chartContainer.eps-chart {
  height: 600px;
}

#chartContainer.eps-chart iframe {
  height: 100%;
}
