* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: #f5f7fb;
    color: #222;
    padding-bottom: 110px;
}

.container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: 15px;
}

.site-header {
    background: linear-gradient(135deg, #0d6efd, #0b5ed7);
    color: #fff;
    padding: 14px 0;
    box-shadow: 0 4px 18px rgba(0,0,0,0.10);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-circle {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.site-title {
    font-size: 20px;
    margin: 0;
    line-height: 1.2;
}

.site-subtitle {
    font-size: 12px;
    opacity: 0.9;
}

.site-footer {
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    padding: 14px 0 95px;
    text-align: center;
    color: #666;
    font-size: 13px;
    margin-top: 20px;
}

.card {
    background: #fff;
    border-radius: 18px;
    padding: 18px;
    margin-top: 15px;
    margin-bottom: 15px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.07);
}

h1, h2, h3 {
    margin-bottom: 12px;
}

input, textarea, button, select {
    width: 100%;
    padding: 13px;
    border-radius: 12px;
    border: 1px solid #d8dce5;
    margin-bottom: 12px;
    font-size: 15px;
    outline: none;
}

textarea {
    min-height: 90px;
    resize: vertical;
}

button {
    background: #0d6efd;
    color: #fff;
    border: none;
    cursor: pointer;
    font-weight: bold;
}

button:hover {
    opacity: 0.95;
}

.btn-green {
    background: #198754;
}

.btn-red {
    background: #dc3545;
}

.btn-gray {
    background: #6c757d;
}

.text-center {
    text-align: center;
}

.link {
    color: #0d6efd;
    text-decoration: none;
    font-weight: bold;
}

.msg-success {
    background: #d1e7dd;
    color: #0f5132;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 12px;
}

.msg-error {
    background: #f8d7da;
    color: #842029;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 12px;
}

.topbar {
    background: #0d6efd;
    color: #fff;
    padding: 16px;
    border-radius: 18px;
    margin-top: 15px;
    margin-bottom: 15px;
}

.topbar h2 {
    margin: 0;
    font-size: 20px;
}

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: bold;
    color: #fff;
}

.badge-green {
    background: #198754;
}

.badge-red {
    background: #dc3545;
}

.badge-yellow {
    background: #fd7e14;
}

.info-row {
    margin-bottom: 10px;
    font-size: 15px;
    line-height: 1.5;
}

.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    max-width: 500px;
    margin: 0 auto;
    background: #fff;
    height: 72px;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.12);
    border-radius: 18px 18px 0 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 999;
}

.bottom-nav a {
    text-decoration: none;
    color: #444;
    font-size: 12px;
    text-align: center;
    width: 20%;
}

.bottom-nav a .icon {
    display: block;
    font-size: 22px;
    margin-bottom: 3px;
}

.camera-btn-wrap {
    position: relative;
    top: -18px;
}

.camera-btn {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: #0d6efd;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    box-shadow: 0 8px 20px rgba(13,110,253,0.35);
    margin: 0 auto;
    border: 4px solid #fff;
}

.camera-text {
    font-size: 11px;
    margin-top: 2px;
}

.small {
    font-size: 13px;
    color: #666;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
}

@media (max-width: 480px) {
    .container {
        padding: 12px;
    }

    .site-title {
        font-size: 18px;
    }
}

.camera-page-wrap {
    margin-top: 15px;
}

.camera-box {
    background: #000;
    border-radius: 18px;
    overflow: hidden;
    position: relative;
    width: 100%;
    min-height: 280px;
}

#video {
    width: 100%;
    height: auto;
    display: block;
    background: #000;
}

#canvas {
    display: none;
}

.capture-preview {
    width: 100%;
    border-radius: 16px;
    display: none;
    margin-top: 12px;
    border: 1px solid #ddd;
}

.capture-actions {
    margin-top: 15px;
}

.inline-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.note-box {
    background: #fff3cd;
    color: #664d03;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 12px;
    font-size: 14px;
}

.upload-preview-box {
    margin-top: 15px;
}

.page-back {
    display: inline-block;
    margin-bottom: 12px;
    color: #0d6efd;
    text-decoration: none;
    font-weight: bold;
}

.hidden {
    display: none !important;
}

.capture-status {
    margin-top: 10px;
    font-size: 14px;
    color: #555;
}

.result-box {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 12px;
    background: #fafafa;
    margin-top: 10px;
}

.mono {
    font-family: monospace;
    word-break: break-word;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stat-box {
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 14px;
    text-align: center;
}

.stat-number {
    font-size: 24px;
    font-weight: bold;
    color: #0d6efd;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 13px;
    color: #666;
}

.history-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.history-item:last-child {
    border-bottom: none;
}

.history-thumb {
    width: 92px;
    min-width: 92px;
}

.history-thumb img {
    width: 100%;
    height: 72px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #ddd;
}

.history-content {
    flex: 1;
    min-width: 0;
}

.history-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 8px;
}

.mini-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: bold;
    color: #fff;
}

.mini-green {
    background: #198754;
}

.mini-red {
    background: #dc3545;
}

.mini-gray {
    background: #6c757d;
}

.details-link {
    display: inline-block;
    margin-top: 8px;
    text-decoration: none;
    font-weight: bold;
    color: #0d6efd;
}

@media (max-width: 480px) {
    .history-item {
        flex-direction: column;
    }

    .history-thumb {
        width: 100%;
    }

    .history-thumb img {
        width: 100%;
        height: auto;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: #f5f7fb;
    color: #222;
    padding-bottom: 110px;
}

.container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: 15px;
}

.site-header {
    background: linear-gradient(135deg, #0d6efd, #0b5ed7);
    color: #fff;
    padding: 14px 0;
    box-shadow: 0 4px 18px rgba(0,0,0,0.10);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-circle {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.site-title {
    font-size: 20px;
    margin: 0;
    line-height: 1.2;
}

.site-subtitle {
    font-size: 12px;
    opacity: 0.9;
}

.site-footer {
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    padding: 14px 0 95px;
    text-align: center;
    color: #666;
    font-size: 13px;
    margin-top: 20px;
}

.card {
    background: #fff;
    border-radius: 18px;
    padding: 18px;
    margin-top: 15px;
    margin-bottom: 15px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.07);
}

h1, h2, h3 {
    margin-bottom: 12px;
}

input, textarea, button, select {
    width: 100%;
    padding: 13px;
    border-radius: 12px;
    border: 1px solid #d8dce5;
    margin-bottom: 12px;
    font-size: 15px;
    outline: none;
}

textarea {
    min-height: 90px;
    resize: vertical;
}

button {
    background: #0d6efd;
    color: #fff;
    border: none;
    cursor: pointer;
    font-weight: bold;
}

button:hover {
    opacity: 0.95;
}

.btn-green {
    background: #198754;
}

.btn-red {
    background: #dc3545;
}

.btn-gray {
    background: #6c757d;
}

.text-center {
    text-align: center;
}

.link {
    color: #0d6efd;
    text-decoration: none;
    font-weight: bold;
}

.msg-success {
    background: #d1e7dd;
    color: #0f5132;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 12px;
}

.msg-error {
    background: #f8d7da;
    color: #842029;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 12px;
}

.topbar {
    background: #0d6efd;
    color: #fff;
    padding: 16px;
    border-radius: 18px;
    margin-top: 15px;
    margin-bottom: 15px;
}

.topbar h2 {
    margin: 0;
    font-size: 20px;
}

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: bold;
    color: #fff;
}

.badge-green {
    background: #198754;
}

.badge-red {
    background: #dc3545;
}

.badge-yellow {
    background: #fd7e14;
}

.info-row {
    margin-bottom: 10px;
    font-size: 15px;
    line-height: 1.5;
}

.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    max-width: 500px;
    margin: 0 auto;
    background: #fff;
    height: 72px;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.12);
    border-radius: 18px 18px 0 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 999;
}

.bottom-nav a {
    text-decoration: none;
    color: #444;
    font-size: 12px;
    text-align: center;
    width: 20%;
}

.bottom-nav a .icon {
    display: block;
    font-size: 22px;
    margin-bottom: 3px;
}

.camera-btn-wrap {
    position: relative;
    top: -18px;
}

.camera-btn {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: #0d6efd;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    box-shadow: 0 8px 20px rgba(13,110,253,0.35);
    margin: 0 auto;
    border: 4px solid #fff;
}

.camera-text {
    font-size: 11px;
    margin-top: 2px;
}

.small {
    font-size: 13px;
    color: #