* {
  box-sizing: border-box;
}
:root {
  color-scheme: dark;
  font-family: "Segoe UI", sans-serif;
  color: #cad7e8;
  background: #101722;
  font-size: 13px;
}
body {
  margin: 0;
  height: 100dvh;
  overflow: hidden;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
select,
input,
textarea {
  background: #182130;
  border: 1px solid #2c394c;
  border-radius: 5px;
}
button {
  cursor: pointer;
  min-height: 31px;
  padding: 5px 10px;
  white-space: nowrap;
}
button:hover {
  background: #26364b;
  color: #fff;
}
button:disabled {
  opacity: 0.4;
  cursor: default;
}
button.active {
  color: #90c1ff;
  background: #233d5c;
  border-color: #4778ae;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid #66a9ff;
  outline-offset: 2px;
}
input,
select {
  min-height: 30px;
  padding: 4px 7px;
}
input[type="checkbox"] {
  min-height: unset;
  accent-color: #66a9ff;
}
input[type="color"] {
  width: 56px;
  padding: 2px;
}
input[type="range"] {
  padding: 0;
  accent-color: #66a9ff;
}
a {
  color: #8abaff;
  text-decoration: none;
}
h2 {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 12px;
}
p {
  line-height: 1.55;
}
.topbar,
.sessionbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border-bottom: 1px solid #263247;
  background: #151e2b;
}
.topbar {
  height: 56px;
}
.sessionbar {
  height: 44px;
  background: #121b28;
}
.brand {
  font-size: 18px;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 650;
  color: #e4edf8;
}
.brand > span:last-child {
  font-weight: 400;
  color: #8498b3;
}
.brand-mark {
  font-size: 24px;
  color: #66a9ff;
}
.divider {
  height: 20px;
  border-left: 1px solid #344056;
  margin: 0 5px;
}
.grow {
  flex: 1;
}
.legacy {
  margin-left: 8px;
  font-size: 12px;
  color: #8c9db4;
}
#contract {
  max-width: 192px;
  font-size: 12px;
}
#save-state {
  font-size: 11px;
  color: #8194ab;
  margin-right: 6px;
}
#save-state.error {
  color: #ff9ca2;
}
.indicator-label {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}
.indicator-label i {
  width: 15px;
  height: 2px;
  background: #66a9ff;
}
.indicator-label b {
  font-weight: 400;
  color: #8194ab;
}
.toggle {
  display: flex;
  align-items: center;
  font-size: 11px;
  color: #8194ab;
}
#coverage {
  color: #8194ab;
  font-size: 11px;
}
.workspace {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 272px;
  height: calc(100dvh - 100px);
}
.workspace.no-inspector {
  grid-template-columns: 52px minmax(0, 1fr);
}
.workspace.no-inspector aside {
  display: none;
}
.tools {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 12px 7px;
  border-right: 1px solid #263247;
  background: #151e2b;
}
.tools button {
  padding: 0;
  height: 35px;
  font-size: 20px;
  border-color: transparent;
  background: transparent;
}
.tools button.active {
  background: #233d5c;
  color: #90c1ff;
}
.tool-rule {
  border-top: 1px solid #2c394c;
  margin: 3px;
}
.center {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.chart-heading {
  height: 35px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 16px;
  font-size: 12px;
}
#chart-title {
  color: #cdd9e8;
}
#ohlc {
  color: #899fb9;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
}
#chart-shell {
  position: relative;
  flex: 1;
  min-height: 180px;
  overflow: hidden;
  outline: none;
}
#chart {
  position: absolute;
  inset: 0;
}
#drawings {
  z-index: 3;
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  touch-action: none;
}
#drawings.drawing {
  pointer-events: all;
  cursor: crosshair;
}
#drawings [data-id] {
  pointer-events: all;
  cursor: move;
}
#drawings [data-handle] {
  pointer-events: all;
  cursor: crosshair;
}
#chart-empty {
  position: absolute;
  inset: 40% 15%;
  text-align: center;
  color: #8194ab;
}
.chart-caption {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 12px;
  border-top: 1px solid #202c3b;
  font-size: 10px;
  color: #8194ab;
  min-height: 29px;
}
.replaybar {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 51px;
  padding: 9px 12px;
  border-top: 1px solid #263247;
  background: #151e2b;
}
.play {
  min-width: 78px;
  background: #2c4d71;
  border-color: #416d98;
}
#timeline {
  flex: 1;
  min-width: 40px;
}
.journal {
  height: 158px;
  flex-shrink: 0;
  border-top: 1px solid #263247;
  background: #131c29;
}
.journal-heading {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 8px 14px;
  height: 42px;
}
.journal h2 {
  margin: 0;
}
.journal-heading > span {
  flex: 1;
  font-size: 11px;
  color: #91a3b9;
}
.journal-heading button {
  font-size: 11px;
  min-height: 26px;
}
.table-scroll {
  overflow: auto;
  height: calc(100% - 42px);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  text-align: left;
  font-variant-numeric: tabular-nums;
}
th {
  color: #7f94ae;
  font-weight: 500;
  position: sticky;
  top: 0;
  background: #172130;
}
th,
td {
  padding: 7px 14px;
  border-bottom: 1px solid #202c3b;
}
.empty-cell {
  text-align: center;
  padding: 25px;
  color: #758aa3;
}
.positive {
  color: #61cfb8;
}
.negative {
  color: #f08a93;
}
aside {
  border-left: 1px solid #263247;
  background: #151e2b;
  overflow-y: auto;
  scrollbar-width: thin;
}
aside section {
  padding: 17px 15px;
  border-bottom: 1px solid #293448;
}
aside label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  color: #99adc6;
  margin-bottom: 10px;
}
aside input:not([type="color"]),
aside select,
textarea {
  width: 100%;
  min-width: 0;
}
textarea {
  padding: 9px;
  resize: vertical;
  line-height: 1.5;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px;
}
.section-heading > span {
  font-size: 10px;
  color: #7e94af;
}
.drawing-style,
.fields {
  display: flex;
  gap: 10px;
}
.drawing-style label {
  flex: 1;
}
.fields label {
  flex: 1;
  font-size: 10px;
}
.button-row {
  display: flex;
  gap: 6px;
  margin: 8px 0;
}
.button-row button {
  flex: 1;
  font-size: 11px;
}
.buy {
  background: #19493f;
  border-color: #2c7260;
  color: #97e4cc;
}
.sell {
  background: #542e39;
  border-color: #81404d;
  color: #ffb5bf;
}
.full {
  width: 100%;
  font-size: 11px;
}
.small,
.data-note p {
  font-size: 10px;
  color: #8194ab;
  line-height: 1.6;
}
.small {
  margin: 5px 0 10px;
}
.position-status {
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  padding: 10px 0;
  color: #a4b8d1;
}
details {
  font-size: 11px;
}
summary {
  cursor: pointer;
  color: #879bb5;
  margin-bottom: 10px;
}
.drawing-list {
  max-height: 120px;
  overflow: auto;
  scrollbar-width: thin;
  margin-top: 12px;
}
.drawing-list p {
  font-size: 11px;
  color: #758aa3;
}
.drawing-row {
  display: flex;
  gap: 6px;
  width: 100%;
  text-align: left;
  margin: 4px 0;
  font-size: 11px;
  align-items: center;
}
.drawing-row i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.drawing-row span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.drawing-row small {
  margin-left: auto;
  color: #8297b1;
}
.data-note a {
  font-size: 11px;
}
#notice {
  position: fixed;
  bottom: 20px;
  left: 70px;
  max-width: min(620px, 80vw);
  background: #263c54;
  border: 1px solid #4b6b8b;
  border-radius: 6px;
  padding: 12px 18px;
  color: #f0f6ff;
  box-shadow: 0 5px 28px #0005;
  z-index: 30;
  line-height: 1.5;
}
#notice.error {
  background: #542e39;
  border-color: #a05464;
}
@media (max-width: 1050px) {
  .workspace {
    grid-template-columns: 48px minmax(0, 1fr) 238px;
  }
  #coverage,
  .legacy,
  #contract {
    display: none;
  }
  .brand {
    font-size: 16px;
  }
  .topbar {
    gap: 6px;
  }
  .journal {
    height: 130px;
  }
}
@media (max-width: 760px) {
  .workspace {
    grid-template-columns: 44px minmax(0, 1fr);
  }
  aside {
    display: none;
  }
  .workspace.mobile-inspector aside {
    display: block;
    position: fixed;
    right: 0;
    top: 100px;
    bottom: 0;
    width: 270px;
    z-index: 15;
    box-shadow: -10px 0 30px #0007;
  }
  .topbar {
    padding: 0 8px;
  }
  .brand > span:last-child,
  #save-state,
  .topbar > .divider {
    display: none;
  }
  .sessionbar {
    padding: 0 6px;
    gap: 4px;
  }
  .indicator-label b,
  .toggle {
    display: none;
  }
  .sessionbar input {
    width: 128px;
  }
  .journal {
    height: 122px;
  }
  .chart-heading {
    padding: 0 8px;
    gap: 10px;
    font-size: 11px;
  }
  #ohlc {
    font-size: 9px;
  }
  .chart-caption {
    font-size: 9px;
  }
  #tool-hint {
    max-width: 55%;
  }
  .replaybar {
    padding: 6px;
    gap: 4px;
  }
  #session-open {
    display: none;
  }
  .tools {
    padding: 10px 4px;
  }
  .tools button {
    height: 31px;
  }
  .brand-mark {
    display: none;
  }
  .fields {
    gap: 5px;
  }
}

#auto-ruler-order { width: auto; display: inline-block; margin-right: 6px; }

#chart-menu { position:fixed; z-index:100; padding:6px; background:#172130; border:1px solid #3b5069; border-radius:7px; box-shadow:0 8px 28px #0008; }
#chart-menu[hidden] {display:none;}
#chart-menu button {min-width:185px; text-align:left;}

.ema-menu {position:relative;font-size:11px;}
.ema-menu summary {cursor:pointer;border:1px solid #2c394c;border-radius:5px;padding:7px 10px;white-space:nowrap;}
.ema-options {position:absolute;top:34px;left:0;z-index:30;width:215px;padding:12px;background:#172130;border:1px solid #3b5069;border-radius:7px;box-shadow:0 8px 25px #0008;}
.ema-options label {display:flex;align-items:center;gap:8px;margin:4px 0;}
.ema-options input {width:auto;}
#drawings .position-label {opacity:0;pointer-events:none;font-size:10px;stroke-width:2;}
#drawings .position-drawing:hover .position-label {opacity:1;}

.auto-vwap-menu .ema-options { width: 270px; }
.auto-vwap-menu input[type="number"] { width: 100%; min-width: 80px; }

.auto-vwap-menu .small { display:block; margin-top:8px; line-height:1.5; }
.auto-vwap-menu #reset-auto-vwap { margin-top:8px; width:100%; }

.rectangle-settings { margin: 10px 0; padding: 12px; border: 1px solid #263247; border-radius: 8px; background: #101722; }
.rectangle-settings[hidden] { display: none; }
.rectangle-settings output { float: right; color: #a7bed9; }
.rectangle-settings input[type="range"] { width: 100%; accent-color: #66a9ff; }
