:root {
    --blue: #1976d2;
    --blue-dark: #14508f;
    --gray-100: #f5f7fa;
    --gray-200: #e4e7ec;
    --dark: #101828;
    --danger: #d92d20;
    --success: #12805c;
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-100);
    color: var(--dark);
}

.app { max-width: 720px; margin: 0 auto; padding: 0 0 40px; }

.app-header {
    background: var(--dark);
    color: #fff;
    padding: 16px 20px;
    position: sticky;
    top: 0;
    z-index: 10;
}
.app-header h1 { margin: 0; font-size: 18px; }

main { padding: 16px; }

section { background: #fff; border-radius: var(--radius); padding: 16px; margin-bottom: 16px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }

h2 { margin: 0 0 12px; font-size: 16px; }

.camera-wrap {
    position: relative;
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 3/4;
}
#video { width: 100%; height: 100%; object-fit: cover; display: block; }
.hidden { display: none; }

.camera-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 12px;
}

.btn {
    border: none;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    padding: 14px 20px;
    cursor: pointer;
    transition: transform .1s ease, opacity .2s ease;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-shutter { background: var(--blue); color: #fff; flex: 1; padding: 16px; font-size: 17px; }
.btn-secondary { background: var(--gray-200); color: var(--dark); width: 52px; height: 52px; padding: 0; font-size: 20px; }
.btn-primary { background: var(--success); color: #fff; width: 100%; padding: 16px; font-size: 16px; margin-top: 12px; }

.hint { color: #667085; font-size: 13px; margin: 10px 0 0; }

.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.photo-thumb { position: relative; border-radius: 8px; overflow: hidden; aspect-ratio: 1/1; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-remove {
    position: absolute; top: 4px; right: 4px;
    background: rgba(0,0,0,.6); color: #fff; border: none; border-radius: 50%;
    width: 24px; height: 24px; font-size: 14px; line-height: 1; cursor: pointer;
}

.field-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.field-row label { display: flex; flex-direction: column; font-size: 13px; color: #475467; gap: 4px; min-width: 0; }
.field-row input { width: 100%; min-width: 0; padding: 10px 8px; }
.field-block { display: flex; flex-direction: column; font-size: 13px; color: #475467; gap: 4px; margin-bottom: 12px; }

@media (max-width: 600px) {
    .field-row { grid-template-columns: 1fr; gap: 12px; }
}

.notes-input-row { display: flex; gap: 8px; align-items: flex-start; }
.notes-input-row textarea { flex: 1; }
.btn-mic { width: 44px; height: 44px; padding: 0; font-size: 18px; flex-shrink: 0; }
.btn-mic.recording { background: var(--danger); color: #fff; animation: pulse 1s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .6; } }

input, textarea {
    font-size: 16px;
    padding: 10px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-family: inherit;
}
textarea { resize: vertical; }

.status-message { font-size: 14px; margin-top: 10px; min-height: 18px; }
.status-message.error { color: var(--danger); }
.status-message.success { color: var(--success); }
