h1 {text-align:center;}
/* Slightly smaller default font */
body {font-family: Arial, sans-serif; margin: 20px; font-size: 14px;}
h1 {text-align:center;}
section {margin-top:20px;}
table {width:100%; border-collapse:collapse; table-layout:fixed;}
th, td {border:1px solid #ddd; padding:8px; text-align:right; word-wrap:break-word; white-space:nowrap;}
.refresh-status {font-size: 0.75rem; color:#555; margin-top:4px;}

/* Column width adjustments */
td:first-child, th:first-child {width:12%;}
td:nth-child(2), th:nth-child(2) {width:10%;}
td:nth-child(3), th:nth-child(3) {width:12%;}
td:nth-child(4), th:nth-child(4) {width:8%;}
td:nth-child(5), th:nth-child(5) {width:8%;}
td:nth-child(6), th:nth-child(6) {width:8%;}
td:nth-child(7), th:nth-child(7) {width:15%;}
/* Left align ticker column */
td:first-child, th:first-child {text-align:left;}
/* Percent change styling */
.positive {color:#006600; font-weight:normal;}
.negative {color:#cc0000; font-weight:normal;}
th {background:#f4f4f4;}
/* Prevent subtotal rows from being affected by sorting styles */
.subtotal-row td, .subtotal-row th {
    pointer-events: none;
}
/* iPhone SE (375px width) specific tweaks */
@media (max-width: 375px) {
    body {margin: 10px;}
    h1 {font-size: 1.4rem;}
    /* Reduce table font size for cramped screens */
    th, td {font-size: 0.75rem; padding: 5px;}
    /* Narrow columns to fit more content */
    /* Adjust column widths for very narrow screens */
td:first-child, th:first-child {width: 10%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
/* Prevent numeric columns from wrapping */
td:nth-child(3), td:nth-child(4), td:nth-child(5), td:nth-child(6), td:nth-child(7) {
    white-space: nowrap;
}
    /* Qty column narrower */
    td:nth-child(2), th:nth-child(2) {width: 8%;}
    td:nth-child(3), th:nth-child(3) {width: 14%;}
    td:nth-child(4), th:nth-child(4) {width: 8%;}
    td:nth-child(5), th:nth-child(5) {width: 8%;}
    td:nth-child(6), th:nth-child(6) {width: 8%;}
    td:nth-child(7), th:nth-child(7) {width: 16%;}
}
/* Company name styling for mobile view */
.company-name {
    display:block;
    font-size:0.7rem;
    color:#555;
}
/* Align total value to the right side of its container */
#total-value {
    text-align:right;
    margin-right:0; /* ensure no extra left padding */
}
