.cal-heatmap-container {
	display: block;
}

.cal-heatmap-container .graph
{
	font-family: "Lucida Grande", Lucida, Verdana, sans-serif;
}

.cal-heatmap-container .graph-label
{
	fill: #999;
	font-size: 10px;
}

.cal-heatmap-container .graph, .cal-heatmap-container .graph-legend rect {
	shape-rendering: crispedges;
}

.cal-heatmap-container .graph-rect
{
	fill: var(--border);
}

.cal-heatmap-container .graph-subdomain-group rect:hover
{
	fill: var(--border1);
}

.cal-heatmap-container .subdomain-text {
	font-size: 8px;
	fill: var(--text);
	pointer-events: none;
}

.cal-heatmap-container .qi {
	background-color: #999;
	fill: #999;
}

.cal-heatmap-container .q0 {
    background-color: #222 !important;
    fill: #222 !important;
    color: var(--bg) !important;
}
.cal-heatmap-container .q1 {
    background-color: var(--fg) !important;
    fill: var(--fg) !important;
}

/* Subdomain text color for unfueled (q0) and fueled (q1) days */
.cal-heatmap-container .q0 ~ .subdomain-text,
.cal-heatmap-container .subdomain-text {
    fill: var(--text) !important;
    color: var(--text) !important;
}
.cal-heatmap-container .q1 ~ .subdomain-text {
    fill: var(--bg) !important;
    color: var(--bg) !important;
}

/* For SVG structure, target text inside rects */
.cal-heatmap-container .graph-subdomain-group .q1 + text.subdomain-text {
    fill: var(--bg) !important;
}
.cal-heatmap-container .graph-subdomain-group .q0 + text.subdomain-text {
    fill: var(--text) !important;
    color: var(--text) !important;
}

.cal-heatmap-container .q2
{
	background-color: #cedb9c;
	fill: #9cc069;
}

.cal-heatmap-container .q3
{
	background-color: #b5cf6b;
	fill: #669d45;
}

.cal-heatmap-container .q4
{
	background-color: #637939;
	fill: #637939;
}

.cal-heatmap-container .q5
{
	background-color: #3b6427;
	fill: #3b6427;
}

.cal-heatmap-container rect.highlight
{
	stroke:#444;
	stroke-width:1;
}

.cal-heatmap-container text.highlight
{
	fill: #444;
}

.cal-heatmap-container rect.highlight-now
{
	stroke: red;
}

.cal-heatmap-container text.highlight-now
{
	fill: red;;
	font-weight: 800;
}

.cal-heatmap-container .domain-background {
	fill: none;
	shape-rendering: crispedges;
}

.ch-tooltip {
	padding: 10px;
	background: var(--border);
	color: var(--text);
	font-size: 12px;
	line-height: 1.4;
	width: 140px;
	position: absolute;
    border-radius: 3px;
	z-index: 99999;
	text-align: center;
	display: none;
	box-sizing: border-box;
}

.ch-tooltip::after{
	position: absolute;
	width: 0;
	height: 0;
	border-color: transparent;
	border-style: solid;
	content: "";
	padding: 0;
	display: block;
	bottom: -6px;
	left: 50%;
	margin-left: -6px;
    border-width: 6px 6px 0;
    border-top-color: #222;
}

.cal-heatmap-nav-row {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
    gap: 180px;
    animation: cardStackIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) both;
}
#fuel-heatmap {
    animation: cardStackIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) both;
}
.cal-heatmap-arrow {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text);
    opacity: 0.8;
    cursor: pointer;
    padding: 0 8px;
    transition: opacity 0.2s;
    user-select: none;
}
.cal-heatmap-arrow:disabled,
.cal-heatmap-arrow.disabled {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}

#custom-heatmap-container {
    margin: 0 auto;
    padding: 0;
    background: var(--bg);
    border-radius: 0;
    width: 100vw;
    max-width: 100vw;
    overflow-x: auto;
}
#custom-heatmap-months {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 4px;
    margin-left: 0;
    width: 100%;
}
.custom-heatmap-month-label {
    text-align: left;
    font-size: 1rem;
    color: var(--text);
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
    letter-spacing: 1px;
    padding-left: 2px;
    padding-bottom: 2px;
    background: none;
    border: none;
}
#custom-heatmap-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.custom-heatmap-cell {
    width: 32px;
    height: 32px;
    background: #222;
    color: var(--text);
    font-size: 1rem;
    font-family: 'IBM Plex Mono', monospace;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    user-select: none;
}
.custom-heatmap-cell.refueled {
    background: var(--fg);
    color: var(--bg);
    font-weight: 600;
}
#custom-heatmap-days {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    margin-top: 0px;
    margin-left: 8px;
    gap: 4px;
}
.custom-heatmap-day-label {
    height: 32px;
    display: flex;
    align-items: center;
    color: var(--text);
    font-size: 1rem;
    font-family: 'IBM Plex Mono', monospace;
    opacity: 0.8;
    padding-left: 4px;
}
@media (max-width: 600px) {
    #custom-heatmap-grid .custom-heatmap-cell, .custom-heatmap-day-label {
        width: 24px;
        height: 24px;
        font-size: 0.9rem;
    }
    .custom-heatmap-month-label {
        font-size: 0.9rem;
    }
}
