/* ── Base ── */
body {
    background-color: #002244;
    color: #FFFFFF;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    padding-top: 68px; /* room for fixed speed bar */
    min-height: 100vh;
    touch-action: manipulation;
    box-sizing: border-box;
}

#app {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 10px;
    box-sizing: border-box;
}

.view {
    display: none;
    flex-direction: column;
    gap: 20px;
}

.view.active {
    display: flex;
}

/* ── Giant Buttons ── */
.giant-btn {
    background-color: #FFCC00;
    color: #000000;
    border: 4px solid #FFFFFF;
    border-radius: 20px;
    font-size: 2rem;
    font-weight: bold;
    min-height: 120px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    cursor: pointer;
    box-shadow: 0 8px 16px rgba(0,0,0,0.5);
    user-select: none;
    -webkit-user-select: none;
    box-sizing: border-box;
}

.giant-btn:active {
    transform: scale(0.97);
    background-color: #E6B800;
}

.emoji {
    font-size: 3rem;
}

.back-btn {
    background-color: #DDDDDD !important;
    color: #000000 !important;
    margin-top: 10px;
}

/* Help button — purple, must override .giant-btn yellow */
.help-btn {
    background-color: #AA44FF !important;
    color: #FFFFFF !important;
    border-color: #FFCC00 !important;
}

/* Listening state */
.listening {
    background-color: #FF3333 !important;
    color: white !important;
    border-color: #FFCC00 !important;
    animation: pulse 0.8s infinite alternate;
}

@keyframes pulse {
    from { box-shadow: 0 0 10px #FF3333; }
    to   { box-shadow: 0 0 30px #FF6666; }
}

/* ── Item Count Banner ── */
.item-count {
    background-color: #003366;
    border: 2px solid #00AAFF;
    border-radius: 12px;
    color: #FFCC00;
    font-size: 1.4rem;
    font-weight: bold;
    text-align: center;
    padding: 12px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── OCR Status ── */
.ocr-status {
    text-align: center;
    font-size: 1.2rem;
    margin: 10px;
    color: #FFCC00;
}

/* ── Manual Fallback ── */
.divider {
    width: 100%;
    border: 2px solid #FFFFFF;
    margin: 10px 0;
}

.manual-fallback {
    display: flex;
    gap: 10px;
    width: 100%;
}

.manual-fallback input {
    flex-grow: 1;
    font-size: 1.2rem;
    padding: 15px;
    border-radius: 10px;
    border: 2px solid #FFFFFF;
    background-color: #001122;
    color: #FFFFFF;
    box-sizing: border-box;
}

.manual-btn {
    background-color: #00AAFF;
    color: #FFFFFF;
    border: 2px solid #FFFFFF;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: bold;
    padding: 0 20px;
    cursor: pointer;
    min-height: 56px;
}

/* ── Visual List ── */
.visual-list {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
}

.visual-list li {
    background-color: #003366;
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 10px;
    border: 2px solid #00AAFF;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.2rem;
    word-break: break-word;
    gap: 10px;
}

.list-controls {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.control-btn {
    font-size: 1.4rem;
    border: 2px solid #FFFFFF;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    background-color: #333;
    min-width: 52px;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn.edit   { background-color: #FFCC00; color: black; border-color: black; }
.control-btn.delete { background-color: #FF3333; color: white; border-color: white; }
.control-btn.done   { background-color: #00BB55; color: white; border-color: white; }

/* ── Speed Controls Bar (fixed top, truly full width) ── */
#speed-controls {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 100;
    background-color: #001133;
    border-bottom: 3px solid #00AAFF;
    display: flex;
    flex-direction: row;
    justify-content: stretch;
    align-items: center;
    padding: 6px 8px;
    gap: 6px;
    box-sizing: border-box;
}

.speed-btn {
    flex: 1 1 0;
    background-color: #003366;
    color: #FFCC00;
    border: 2px solid #00AAFF;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: bold;
    padding: 8px 2px;
    cursor: pointer;
    min-height: 52px;
    text-align: center;
    white-space: nowrap;
}

.speed-btn:active {
    background-color: #00AAFF;
    color: #000;
}

/* ── Undo Toast ── */
.undo-toast {
    position: fixed;
    bottom: -140px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #111;
    color: #FFFFFF;
    border: 3px solid #FFCC00;
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 1.2rem;
    font-weight: bold;
    z-index: 200;
    width: calc(100% - 32px);
    max-width: 560px;
    transition: bottom 0.3s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.7);
    box-sizing: border-box;
}

.undo-toast.visible {
    bottom: 20px;
}

#undo-btn {
    background-color: #FFCC00;
    color: #000;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    padding: 12px 20px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}
