* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #0a0a0a;
    color: #e0e0e0;
    min-height: 100vh;
}

header {
    text-align: center;
    padding: 16px;
    background: #111;
    border-bottom: 1px solid #222;
}

header h1 {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
}

main {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
}

/* Start / New Photo button */
.start-btn {
    display: block;
    width: 100%;
    padding: 16px;
    background: #1a8a5c;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
}

.start-btn:active {
    background: #15a566;
    transform: scale(0.98);
}

/* Results */
#image-container {
    width: 100%;
    max-height: 55vh;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

#image-container img {
    width: 100%;
    height: 100%;
    max-height: 55vh;
    object-fit: contain;
    display: block;
}

#count-display {
    text-align: center;
    padding: 16px 0;
}

#pill-count {
    font-size: 64px;
    font-weight: 700;
    color: #1a8a5c;
}

/* Controls */
.controls-section {
    background: #151515;
    border-radius: 12px;
    padding: 20px;
    margin-top: 12px;
}

.controls-section h2 {
    font-size: 16px;
    margin-bottom: 16px;
    color: #aaa;
}

.control-group {
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-group label {
    min-width: 110px;
    font-size: 14px;
    color: #ccc;
}

.control-group .hint {
    font-size: 11px;
    color: #777;
    display: block;
}

.control-group input[type="range"] {
    flex: 1;
    accent-color: #1a8a5c;
}

.control-group .value {
    min-width: 50px;
    text-align: right;
    font-size: 14px;
    color: #1a8a5c;
    font-variant-numeric: tabular-nums;
}

.checkbox-group {
    justify-content: flex-start;
}

.checkbox-group label {
    min-width: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.recount-btn {
    width: 100%;
    padding: 14px;
    margin-top: 8px;
    background: #1a8a5c;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.recount-btn:active {
    background: #15a566;
}

.recount-btn:disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
}

.hidden {
    display: none !important;
}

/* Error */
.error-msg {
    background: #3a1515;
    color: #ff6b6b;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    margin: 12px 0;
}
