:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #111820;
  --muted: #697681;
  --border: #dfe4e8;
  --blue: #225f9e;
  --blue-dark: #174774;
  --green: #14733e;
  --green-bg: #def5e7;
  --red: #a22d27;
  --red-bg: #fde7e5;
  --amber: #806000;
  --amber-bg: #fff2c8;
  --gray-bg: #edf0f2;
  --shadow: 0 10px 30px rgba(24, 39, 55, .08);
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
a { color: var(--blue); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.shell { max-width: 1180px; margin: 0 auto; padding: 24px 20px 64px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, var(--blue), #4b91d2); box-shadow: var(--shadow); }
.nav-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: 18px; }
.card + .card { margin-top: 14px; }
.hero { padding: 22px; border-top: 4px solid var(--blue); }
h1 { margin: 0 0 6px; font-size: clamp(24px, 4vw, 34px); line-height: 1.12; letter-spacing: -.03em; }
h2 { margin: 0 0 12px; font-size: 18px; }
h3 { margin: 0 0 8px; font-size: 15px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }
.text-left { text-align: left; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric { border: 1px solid var(--border); border-radius: 11px; padding: 12px; min-height: 78px; }
.metric-label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.metric-value { font-size: 20px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }
.btn { appearance: none; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 9px; padding: 9px 13px; font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:hover { border-color: #b9c3cb; }
.btn-primary { border-color: var(--blue); background: var(--blue); color: white; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-danger { color: var(--red); }
.btn[disabled] { cursor: wait; opacity: .6; }
.form-row { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
label { display: block; color: var(--muted); font-size: 12px; font-weight: 700; margin-bottom: 5px; }
input, select { width: 100%; background: white; border: 1px solid #cfd7dd; border-radius: 9px; padding: 10px 11px; color: var(--text); }
input:focus, select:focus { outline: 2px solid rgba(34, 95, 158, .2); border-color: var(--blue); }
input[type="checkbox"] { width: auto; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.status { display: none; margin-top: 10px; border-radius: 9px; padding: 10px 12px; }
.status.show { display: block; }
.status.ok { background: var(--green-bg); color: var(--green); }
.status.error { background: var(--red-bg); color: var(--red); }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tab { border: 0; border-radius: 999px; padding: 7px 12px; background: var(--gray-bg); }
.tab.active { background: var(--blue); color: white; }
.auth-wrap { max-width: 520px; margin: 7vh auto; }
.auth-panel { display: none; }
.auth-panel.active { display: block; }
.badge { display: inline-block; border-radius: 999px; padding: 3px 8px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.badge-buy { background: var(--green-bg); color: var(--green); }
.badge-sell { background: var(--red-bg); color: var(--red); }
.badge-hold { background: #e4effb; color: #1d5792; }
.badge-wait { background: var(--amber-bg); color: var(--amber); }
.badge-avoid { background: var(--gray-bg); color: #4f5b64; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; min-width: 760px; font-size: 12px; font-variant-numeric: tabular-nums; }
th, td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: #f2f4f6; color: #46525c; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; position: sticky; top: 0; }
tbody tr:last-child td { border-bottom: 0; }
.num { text-align: right; }
.reason-list { margin: 4px 0 0; padding-left: 17px; }
.reason-list li { margin-bottom: 2px; }
.action-card { border-left: 4px solid var(--blue); }
.action-card.sell { border-left-color: var(--red); }
.callout { border-radius: 10px; background: #f0f5fb; border: 1px solid #d7e4f2; padding: 12px; }
.warning { color: var(--red); font-weight: 700; }
.details { margin-top: 8px; }
details summary { cursor: pointer; font-weight: 700; }
.footer { color: var(--muted); font-size: 11px; text-align: center; margin-top: 26px; }
@media (max-width: 850px) { .grid-4, .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .shell { padding: 16px 12px 48px; } .grid-2, .grid-3, .grid-4, .form-row { grid-template-columns: 1fr; } .topbar { align-items: flex-start; flex-direction: column; } }

.ticker-link { color: var(--blue); font-weight: 800; text-decoration: none; }
.ticker-link:hover { text-decoration: underline; }
.ticker-link:focus-visible { outline: 2px solid rgba(34, 95, 158, .35); outline-offset: 3px; border-radius: 3px; }
.eyebrow { margin: 0 0 5px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.chart-hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.chart-decision { min-width: 170px; text-align: right; }
.chart-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.chart-toolbar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 12px 0 10px; }
.chart-control-group { display: flex; gap: 5px; flex-wrap: wrap; }
.chart-control { border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--muted); padding: 6px 10px; font-size: 12px; font-weight: 750; }
.chart-control:hover { border-color: #aebac3; color: var(--text); }
.chart-control.active { color: white; border-color: var(--blue); background: var(--blue); }
.chart-control:focus-visible { outline: 3px solid rgba(34, 95, 158, .2); outline-offset: 2px; }
.chart-legend { display: flex; gap: 13px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 11px; margin: 0 0 8px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-swatch { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.legend-line { width: 18px; height: 0; border-top: 2px dashed currentColor; display: inline-block; }
.candle-up-swatch { background: #16764a; }
.candle-down-swatch { background: #b23b35; }
.cloud-bull-swatch { background: rgba(29, 150, 89, .32); border: 1px solid rgba(29, 150, 89, .65); }
.cloud-bear-swatch { background: rgba(197, 67, 62, .25); border: 1px solid rgba(197, 67, 62, .6); }
.support-swatch { color: #12814b; }
.resistance-swatch { color: #b12d2a; }
.chart-stage { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: #fbfcfd; }
.chart-svg { display: block; width: 100%; min-width: 760px; height: auto; aspect-ratio: 1200 / 690; }
.chart-grid-line { stroke: #e5e9ec; stroke-width: 1; }
.chart-axis-label { fill: #64717b; font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-projected-label { fill: #8d6f23; font-size: 10px; }
.chart-projection-line { stroke: #bda96b; stroke-width: 1; stroke-dasharray: 4 5; }
.ichimoku-cloud { stroke: none; }
.ichimoku-cloud-bull { fill: rgba(32, 154, 91, .19); }
.ichimoku-cloud-bear { fill: rgba(196, 69, 63, .16); }
.indicator-line { fill: none; stroke-width: 1.45; vector-effect: non-scaling-stroke; }
.span-a-line { stroke: rgba(28, 137, 80, .72); }
.span-b-line { stroke: rgba(181, 60, 54, .68); }
.tenkan-line { stroke: #2f72b7; }
.kijun-line { stroke: #d68722; }
.chikou-line { stroke: #7752a2; stroke-dasharray: 3 3; }
.sma20-line { stroke: #3481c1; }
.sma50-line { stroke: #b17d22; }
.sma200-line { stroke: #6c4d8f; stroke-width: 1.8; }
.candle-wick { stroke-width: 1; vector-effect: non-scaling-stroke; }
.candle-body { stroke-width: .8; vector-effect: non-scaling-stroke; }
.candle-up { fill: #16764a; stroke: #16764a; }
.candle-down { fill: #b23b35; stroke: #b23b35; }
.level-line { stroke-width: 1.15; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; }
.level-label { font-size: 10px; font-weight: 750; }
.level-support { stroke: #12814b; fill: #12814b; }
.level-resistance { stroke: #b12d2a; fill: #b12d2a; }
.level-entry { stroke: #3a6fa0; fill: #3a6fa0; stroke-dasharray: 3 4; }
.level-invalidation { stroke: #8b2824; fill: #8b2824; }
.level-target { stroke: #6c4d8f; fill: #6c4d8f; }
.current-price-line { stroke: #1f5e99; stroke-width: 1.1; stroke-dasharray: 2 3; }
.current-price-label { fill: #1f5e99; font-size: 10px; font-weight: 800; }
.volume-bar { opacity: .38; }
.volume-up { fill: #16764a; }
.volume-down { fill: #b23b35; }
.chart-hit-area { fill: transparent; cursor: crosshair; }
.crosshair-line { stroke: #596772; stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.chart-crosshair[hidden] { display: none; }
.chart-readout { margin-top: 8px; min-height: 38px; padding: 9px 11px; border-radius: 9px; background: #f1f4f6; color: #3f4c56; font-size: 12px; font-variant-numeric: tabular-nums; }
.compact-grid { gap: 18px; }
.level-summary-list { list-style: none; padding: 0; margin: 0; }
.level-summary-list li { display: flex; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--border); padding: 6px 0; font-variant-numeric: tabular-nums; }
.level-summary-list li:last-child { border-bottom: 0; }
.level-summary-list span { color: var(--muted); }

@media (max-width: 700px) {
  .chart-hero { flex-direction: column; }
  .chart-decision { min-width: 0; text-align: left; }
  .chart-toolbar { flex-direction: column; }
  .chart-stage { margin-left: -8px; margin-right: -8px; border-radius: 8px; }
}
