/* ==========================================================================
   Signature monitor — page-specific styles
   Extends assets/site.css
   ========================================================================== */

.monitor-hero {
    padding: calc(var(--nav-height) + 72px) 0 42px;
    text-align: center;
}

.tool-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(15, 23, 42, 0.42);
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 600;
    transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.tool-breadcrumb:hover {
    color: var(--accent);
    border-color: var(--accent-line);
    background: var(--accent-soft);
}

.tool-breadcrumb i {
    font-size: 0.65rem;
}

.monitor-hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 5.5vw, 3.9rem);
    font-weight: 800;
    line-height: 1.04;
    letter-spacing: -0.05em;
    text-wrap: balance;
}

.monitor-hero h1 .gradient {
    background: linear-gradient(100deg, var(--accent) 0%, var(--accent-warm) 48%, var(--accent-cool) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.monitor-hero > .container > p {
    max-width: 650px;
    margin: 18px auto 0;
    color: var(--text-soft);
    font-size: clamp(0.94rem, 1.5vw, 1.05rem);
    line-height: 1.7;
    text-wrap: balance;
}

.monitor-hero .hero-meta {
    margin-top: 28px;
}

.monitor-shell {
    display: grid;
    gap: 16px;
    max-width: 940px;
    padding-bottom: 20px;
}

.tool-card {
    padding: clamp(22px, 4vw, 34px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.7), rgba(8, 13, 22, 0.86));
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.16);
}

.tool-card-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 24px;
    text-align: left;
}

.tool-icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(251, 146, 60, 0.22);
    border-radius: 13px;
    color: var(--accent);
    background: var(--accent-soft);
    font-size: 0.9rem;
}

.tool-card-head h2 {
    font-family: var(--font-display);
    font-size: 1.12rem;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -0.03em;
}

.tool-card-head p {
    max-width: 72ch;
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.65;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.field-wide {
    grid-column: 1 / -1;
}

.field label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-soft);
    font-size: 0.73rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.field input,
.field select {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    background-color: rgba(3, 7, 18, 0.6);
    font: inherit;
    font-size: 0.84rem;
    color-scheme: dark;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.field select {
    padding-right: 38px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%238b9bb4' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
}

.field input:hover,
.field select:hover {
    border-color: var(--border-strong);
}

.field input:focus,
.field select:focus {
    border-color: var(--accent);
    background-color: rgba(3, 7, 18, 0.8);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.field-help {
    display: block;
    margin-top: 5px;
    color: var(--muted-dim);
    font-size: 0.69rem;
    line-height: 1.5;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.btn-sm {
    min-height: 40px;
    padding: 9px 16px;
    border-radius: 12px;
    font-size: 0.78rem;
}

.btn:disabled {
    opacity: 0.42;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.tool-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    color: var(--muted-dim);
    font-size: 0.7rem;
    line-height: 1.6;
}

.tool-note i {
    margin-top: 2px;
    color: var(--accent);
}

.preview-wrap {
    margin-top: 4px;
    text-align: center;
}

.preview-frame {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #020406;
    box-shadow: inset 0 0 60px rgba(251, 146, 60, 0.05), 0 12px 32px rgba(0, 0, 0, 0.3);
}

#displayCanvas {
    display: block;
    max-width: 100%;
    height: auto;
    cursor: crosshair;
}

.scan-status {
    max-width: 680px;
    margin: 18px auto 0;
    padding: 11px 15px;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-soft);
    background: rgba(3, 7, 18, 0.48);
    font-size: 0.78rem;
    line-height: 1.55;
    text-align: center;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.scan-status.is-match {
    border-color: var(--accent-line);
    color: var(--accent);
    background: var(--accent-soft);
}

.detected {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-top: 20px;
}

.detected-label {
    color: var(--muted);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

#detectedNum {
    color: var(--accent);
    font-family: var(--font-display);
    font-size: clamp(2rem, 6vw, 3.2rem);
    font-weight: 800;
    line-height: 1;
    text-shadow: 0 0 28px rgba(251, 146, 60, 0.24);
}

.ocr-box {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(3, 7, 18, 0.45);
    text-align: center;
}

.ocr-box p {
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 0.69rem;
    letter-spacing: 0.04em;
}

#cropCanvas {
    max-width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #000;
}

video {
    display: none;
}

@media (max-width: 700px) {
    .monitor-hero {
        padding-top: calc(var(--nav-height) + 58px);
        padding-bottom: 34px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .field-wide {
        grid-column: auto;
    }

    .button-row .btn {
        flex: 1 1 100%;
    }
}

@media (max-width: 520px) {
    .tool-card-head {
        gap: 11px;
    }

    .tool-icon {
        width: 38px;
        height: 38px;
        border-radius: 11px;
        font-size: 0.8rem;
    }

    .tool-card-head h2 {
        font-size: 1rem;
    }
}
