
* {
    box-sizing: border-box;
}

:root {
    --background: #0b1120;
    --panel: #172234;
    --border: #304054;
    --text: #f1f5f9;
    --muted: #94a3b8;
    --accent: #2dd4bf;
}

body {
    margin: 0;
    padding: 16px;
    background: var(--background);
    color: var(--text);
    font-family: Arial, sans-serif;
}

.app {
    width: 100%;
    max-width: 480px;
    margin: auto;
}

header {
    margin-bottom: 20px;
}

header h1 {
    margin: 0;
    font-size: 28px;
    color: var(--accent);
}

header p {
    margin: 7px 0;
    color: var(--muted);
    font-size: 14px;
}

.status {
    padding: 12px;
    background: var(--panel);
    border-radius: 10px;
    margin-bottom: 14px;
    font-size: 14px;
}

.status.ready {
    color: var(--accent);
}

.status.error {
    color: #f87171;
}

.scanner {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #050913;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}

.scanner video,
.scanner canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.scanner canvas {
    pointer-events: none;
}

.placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--muted);
    padding: 20px;
}

.placeholder span {
    font-size: 18px;
    font-weight: bold;
}

.placeholder p {
    font-size: 13px;
}

.scan-status {
    font-size: 14px;
    text-align: center;
    color: var(--muted);
    min-height: 20px;
}

.result {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
}

.label {
    color: var(--muted);
    font-size: 13px;
    margin: 0 0 12px;
}

#resistance {
    color: var(--accent);
    font-size: 38px;
    margin: 8px 0;
}

#tolerance {
    margin: 8px 0;
}

hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 18px 0;
}

.bands {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.band {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    text-transform: capitalize;
}

.band-swatch {
    width: 32px;
    height: 32px;
    border-radius: 7px;
    border: 1px solid #64748b;
}

.detail {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    padding: 9px 0;
    gap: 12px;
}

.detail span {
    color: var(--muted);
}

.controls {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

button,
.upload-button {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
}

button {
    background: var(--accent);
    color: #042f2e;
}

button.secondary,
.upload-button {
    background: var(--panel);
    border: 1px solid var(--border);
    color: var(--text);
}

button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.instructions {
    margin-top: 24px;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.7;
}

.instructions h3 {
    color: var(--text);
    font-size: 15px;
}

footer {
    margin: 25px 0 10px;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.7;
}
