* { box-sizing: border-box; }
body {
  font-family: 'Consolas', 'Monaco', monospace;
  background: #1a1a2e;
  color: #eaeaea;
  margin: 0;
  padding: 2rem;
  min-height: 100vh;
}
.container {
  max-width: 720px;
  margin: 0 auto;
}
h1 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: #a0a0ff;
}
.input-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
input[type="date"] {
  padding: 0.6rem 0.8rem;
  font-family: inherit;
  font-size: 0.95rem;
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 6px;
  color: #eaeaea;
}
input[type="date"]:focus {
  outline: none;
  border-color: #a0a0ff;
}
input[type="text"],
input[type="password"] {
  flex: 1;
  padding: 0.6rem 0.8rem;
  font-family: inherit;
  font-size: 0.95rem;
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 6px;
  color: #eaeaea;
}
input[type="text"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: #a0a0ff;
}
button {
  padding: 0.6rem 1.2rem;
  font-family: inherit;
  font-size: 0.95rem;
  background: #0f3460;
  border: 1px solid #a0a0ff;
  border-radius: 6px;
  color: #a0a0ff;
  cursor: pointer;
  white-space: nowrap;
}
button:hover {
  background: #1a4a7a;
}
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.output {
  background: #0d0d1a;
  border: 1px solid #0f3460;
  border-radius: 6px;
  padding: 1rem;
  min-height: 120px;
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 0.9rem;
  line-height: 1.5;
}
.output.empty {
  color: #666;
}
.output.error {
  color: #ff6b6b;
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 0.75rem;
}
.section-title h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: #a0a0ff;
}
.small-btn {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}
.block {
  margin-bottom: 1.25rem;
}
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.checkbox-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: #cbd5f5;
}
.checkbox-item input[type="checkbox"] {
  accent-color: #a0a0ff;
}
.table-container {
  background: #0d0d1a;
  border: 1px solid #0f3460;
  border-radius: 6px;
  padding: 0.75rem;
  min-height: 120px;
  overflow-x: auto;
  font-size: 0.9rem;
}
.table-container.empty {
  color: #666;
  display: flex;
  align-items: center;
}
.table-container.error {
  color: #ff6b6b;
}
.summary-table {
  width: 100%;
  border-collapse: collapse;
}
.summary-table th,
.summary-table td {
  padding: 0.45rem 0.6rem;
  text-align: center;
  border-bottom: 1px solid #16213e;
}
.summary-table th {
  color: #a0a0ff;
  font-weight: 600;
  background: #111827;
  position: sticky;
  top: 0;
}
.summary-table td.sticky-col {
  text-align: left;
  font-weight: 600;
  color: #eaeaea;
  background: #0f172a;
}
.chart {
  margin-top: 0.75rem;
  background: #0d0d1a;
  border: 1px solid #0f3460;
  border-radius: 6px;
  padding: 0.75rem;
}
.chart-header {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  color: #a0a0ff;
}
.chart-area {
  position: relative;
  height: 220px;
  display: flex;
  align-items: flex-end;
  border-bottom: 1px solid #0f3460;
  overflow: visible;
}
.chart-y-axis {
  width: 42px;
  height: 180px;
  position: relative;
  align-self: flex-end;
  margin-bottom: 24px;
  border-right: 1px solid #0f3460;
  color: #8892c5;
  font-size: 0.7rem;
}
.chart-y-axis .tick {
  position: absolute;
  right: 6px;
  transform: translateY(50%);
}
.chart-bars {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 8px 4px 24px;
  overflow-x: auto;
}
.chart-bar {
  position: relative;
  width: 48px;
  min-width: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.bar-stack {
  width: 100%;
  height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border: 1px solid #16213e;
  border-radius: 4px;
  overflow: hidden;
  background: #111827;
}
.bar-segment {
  width: 100%;
  position: relative;
  cursor: pointer;
}
.bar-label {
  font-size: 0.75rem;
  color: #cbd5f5;
  text-align: center;
  word-break: break-word;
}
.chart-tooltip {
  position: absolute;
  padding: 6px 8px;
  font-size: 0.75rem;
  color: #fff;
  background: rgba(15, 52, 96, 0.95);
  border: 1px solid #a0a0ff;
  border-radius: 6px;
  pointer-events: none;
  white-space: nowrap;
  transform: translate(-50%, -110%);
  z-index: 10;
  display: none;
}
