:root {
    color-scheme: dark;
    font-family: system-ui, sans-serif;
    background: #152b30;
    color: #f4f7f7;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
}

.container {
    max-width: 680px;
    margin: auto;
    padding: 28px 22px;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    font-size: 30px;
    font-weight: 750;
    letter-spacing: -1.5px;
}

.brand span,
.hero h1 span {
    color: #7dd3c5;
}

.version {
    font-size: 12px;
    color: #aac0c5;
}

.hero {
    padding: 52px 0 36px;
    text-align: center;
}

.hero h1 {
    margin: 0;
    font-size: clamp(28px, 6vw, 40px);
    line-height: 1.25;
    letter-spacing: -1.2px;
}

.hero p {
    color: #aac0c5;
    font-size: 14px;
}

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

.action {
    background: #223d43;
    border: 1px solid #365159;
    border-radius: 16px;
    padding: 24px 12px;
    text-align: center;
}

.symbol {
    font-size: 38px;
    line-height: 1;
    color: #7dd3c5;
}

.action h2 {
    font-size: 20px;
    margin: 16px 0 8px;
}

.action p {
    color: #aac0c5;
    font-size: 13px;
    margin: 0 0 12px;
}

.action small {
    color: #9ab0b5;
    font-size: 11px;
}

.system-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 32px;
    padding: 18px 0;
    border-top: 1px solid #365159;
    font-size: 13px;
    color: #aac0c5;
}

.dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.online {
    background: #7dd3c5;
}

.offline {
    background: #f2a65a;
}

.system-status a {
    color: #7dd3c5;
    margin-left: auto;
}

footer {
    text-align: center;
    font-size: 11px;
    color: #9ab0b5;
    padding-top: 12px;
}

.login-form {
    max-width: 400px;
    margin: auto;
    padding: 28px;
    background: #223d43;
    border: 1px solid #365159;
    border-radius: 16px;
}

.login-form label {
    display: block;
    font-size: 14px;
    margin-bottom: 8px;
}

.login-form input:not([type="hidden"]) {
    display: block;
    width: 100%;
    padding: 13px;
    margin-bottom: 22px;
    background: #152b30;
    color: #f4f7f7;
    border: 1px solid #567176;
    border-radius: 8px;
    font-size: 16px;
}

.login-form button {
    width: 100%;
    padding: 14px;
    background: #7dd3c5;
    color: #152b30;
    border: 0;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.login-error {
    color: #ffb9a8;
    font-size: 14px;
}

.account-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
    color: #aac0c5;
    font-size: 13px;
}

.logout-button {
    background: transparent;
    color: #7dd3c5;
    border: 1px solid #567176;
    border-radius: 6px;
    padding: 7px 14px;
    cursor: pointer;
}

.capture-hero {
    padding: 35px 0 25px;
}

.back-link {
    color: #7dd3c5;
    text-decoration: none;
}

.capture-form {
    background: #223d43;
    padding: 24px;
    border: 1px solid #365159;
    border-radius: 16px;
}

.capture-form label {
    display: block;
    font-weight: 700;
    margin-bottom: 16px;
}

.capture-form input[type="file"] {
    display: block;
    max-width: 100%;
    font-size: 16px;
    margin: 16px 0;
}

.primary-button,
.secondary-button {
    display: block;
    width: 100%;
    border: 0;
    padding: 15px;
    margin-top: 18px;
    text-align: center;
    text-decoration: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.primary-button {
    background: #7dd3c5;
    color: #152b30;
}

.secondary-button {
    background: #223d43;
    color: #7dd3c5;
}

.hint {
    font-size: 13px;
    color: #aac0c5;
}

.center {
    text-align: center;
}

.action-link {
    color: inherit;
    text-decoration: none;
}

.action-link:hover {
    border-color: #7dd3c5;
}

.library-item {
    display: block;
    padding: 18px;
    margin-bottom: 12px;
    background: #223d43;
    border-radius: 12px;
    color: #f4f7f7;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.library-item small {
    display: block;
    margin-top: 8px;
    color: #aac0c5;
}

.document-preview {
    width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 12px;
    background: #0d1f23;
}

.document-details {
    background: #223d43;
    border-radius: 12px;
    padding: 18px;
    margin-top: 15px;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.break-text {
    display: block;
    overflow-wrap: anywhere;
    color: #aac0c5;
}

.ocr-panel {
    padding: 18px;
    margin-bottom: 16px;
    border-radius: 12px;
    background: #223d43;
}

.ocr-content {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.6;
    color: #f4f7f7;
    user-select: text;
}

.payment-image-stage {
    position: relative;
    width: 100%;
    container-type: inline-size;
}

.payment-image-stage .document-preview {
    display: block;
    width: 100%;
    height: auto;
}

.payment-stamp {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-28deg);
    color: #bd1717;
    border: 4px solid currentColor;
    outline: 1px solid currentColor;
    outline-offset: -8px;
    border-radius: 7px;
    width: 68%;
    box-sizing: border-box;
    padding: 15px 10px;
    text-align: center;
    opacity: 0.84;
    pointer-events: none;
    font-family: Arial, sans-serif;
    line-height: 1.1;
}

.payment-stamp strong {
    display: block;
    font-size: 48px;
    font-size: clamp(24px, 12cqw, 100px);
    font-weight: 900;
    letter-spacing: 3px;
}

.payment-stamp .stamp-long {
    font-size: 24px;
    font-size: clamp(14px, 5cqw, 42px);
    letter-spacing: 1px;
}

.payment-stamp span {
    display: block;
    font-size: 16px;
    font-size: clamp(11px, 4cqw, 30px);
    font-weight: 800;
    margin-top: 6px;
}

.payment-panel {
    padding: 20px;
    background: #223d43;
    border-radius: 14px;
    margin: 16px 0;
}

.payment-panel fieldset {
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}

.payment-panel label {
    display: block;
    font-weight: 700;
    margin: 12px 0 5px;
}

.payment-panel input,
.payment-panel select,
.payment-panel textarea {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
    border: 1px solid #56777d;
    border-radius: 8px;
    background: #152b30;
    color: #f4f7f7;
    font-size: 16px;
    color-scheme: dark;
}

.payment-panel summary {
    color: #7dd3c5;
    cursor: pointer;
    padding: 12px 0;
}

.payment-warning {
    color: #fbbf24;
}

.payment-history-item {
    border-bottom: 1px solid #365159;
    padding: 12px 0;
    overflow-wrap: anywhere;
}

.payment-history-item p {
    margin: 5px 0;
}

.payment-status-bar {
    background: #223d43;
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0;
}

.payment-status-bar p {
    margin: 5px 0;
}

.payment-status-paid {
    color: #7dd3c5;
}

.vision-consent {
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.5;
    margin: 15px 0 !important;
}

.vision-consent input[type="checkbox"] {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin: 3px 0;
}

.vision-processing {
    padding: 25px 0;
    text-align: center;
}

.vision-spinner {
    width: 42px;
    height: 42px;
    border: 4px solid #365159;
    border-top-color: #7dd3c5;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: vision-spin 1s linear infinite;
}

@keyframes vision-spin {
    to {
        transform: rotate(360deg);
    }
}

.vision-result {
    padding: 12px 0;
    border-bottom: 1px solid #365159;
    overflow-wrap: anywhere;
}

.vision-result p {
    margin: 5px 0;
}

@media (prefers-reduced-motion: reduce) {
    .vision-spinner {
        animation: none;
    }
}

.product-section {
    margin: 24px 0;
}

.product-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: #152b30;
    border: 1px solid #365159;
    border-radius: 12px;
    padding: 15px;
    margin: 12px 0;
}

.product-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 65px;
    height: 65px;
    border-radius: 8px;
    background: #29464d;
    color: #aac0c5;
}

.product-details {
    min-width: 0;
    flex: 1;
    overflow-wrap: anywhere;
}

.product-details p {
    font-size: 14px;
    margin: 5px 0;
}

.vision-reanalyse {
    border-top: 1px solid #365159;
    margin-top: 20px;
    padding-top: 15px;
}

.vision-reanalyse summary {
    cursor: pointer;
    color: #7dd3c5;
}

.review-success {
    padding: 12px;
    color: #7dd3c5;
    border: 1px solid #7dd3c5;
    border-radius: 8px;
}

.smart-library {
    max-width: 900px;
}

.smart-document-card {
    background: #203d43;
    border-radius: 14px;
    padding: 16px;
    margin: 14px 0;
}

.smart-document-main {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    color: #f4f7f7;
    text-decoration: none;
}

.smart-document-main:hover {
    color: #f4f7f7;
}

.smart-document-thumb {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 92px;
    min-height: 112px;
    flex-shrink: 0;
    border-radius: 7px;
    background: #142b30;
    overflow: hidden;
}

.smart-document-thumb img {
    width: 100%;
    max-height: 145px;
    object-fit: contain;
    display: block;
}

.smart-thumb-stamp {
    position: absolute;
    top: 48%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-28deg);
    border: 2px solid #bd1717;
    border-radius: 3px;
    color: #bd1717;
    font-family: Arial, sans-serif;
    font-size: 19px;
    font-weight: 900;
    padding: 2px 6px;
    background: rgba(255,255,255,0.8);
}

.smart-stamp-small {
    font-size: 10px;
    white-space: nowrap;
}

.smart-document-content {
    min-width: 0;
    flex: 1;
}

.smart-document-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 12px;
    margin-bottom: 6px;
}

.smart-document-heading strong {
    font-size: 19px;
    overflow-wrap: anywhere;
}

.smart-document-amount {
    font-size: 18px;
    font-weight: 800;
    white-space: nowrap;
}

.smart-document-content p {
    margin: 4px 0;
    font-size: 14px;
    overflow-wrap: anywhere;
}

.smart-document-meta {
    color: #80cdc1;
}

.smart-document-description {
    color: #e1e9e9;
}

.smart-document-muted {
    color: #aac0c5;
    font-size: 12px !important;
}

.smart-ai-label {
    color: #aac0c5;
    font-size: 11px !important;
}

.smart-document-status {
    color: #80cdc1;
}

.smart-document-warning {
    color: #fbbf24;
}

.smart-payment-paid {
    color: #80cdc1;
    font-weight: 700;
}

.smart-payment-unpaid,
.smart-payment-partially_paid {
    color: #fbbf24;
}

.smart-payment-cancelled {
    color: #fca5a5;
}

.smart-document-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 16px;
    border-top: 1px solid #365159;
    padding-top: 12px;
    margin-top: 12px;
    font-size: 13px;
}

.smart-document-actions a,
.smart-rename summary {
    color: #80cdc1;
    cursor: pointer;
}

.smart-rename[open] {
    flex-basis: 100%;
}

.smart-rename form {
    margin-top: 12px;
}

.smart-rename input {
    box-sizing: border-box;
    display: block;
    width: 100%;
    padding: 11px;
    background: #142b30;
    color: #f4f7f7;
    border: 1px solid #56777d;
    border-radius: 8px;
    font-size: 16px;
    margin: 8px 0;
}

@media (max-width: 600px) {

    .smart-document-card {
        padding: 12px;
    }

    .smart-document-main {
        gap: 12px;
    }

    .smart-document-thumb {
        width: 66px;
        min-height: 90px;
    }

    .smart-document-heading strong {
        font-size: 17px;
    }

    .smart-document-amount {
        font-size: 16px;
    }

    .smart-thumb-stamp {
        font-size: 14px;
    }

    .smart-stamp-small {
        font-size: 8px;
    }
}

.product-photo {
    display: block;
    width: 90px;
    height: 90px;
    object-fit: contain;
    background: white;
    border-radius: 8px;
    padding: 4px;
    box-sizing: border-box;
    flex-shrink: 0;
}

.product-candidate-image {
    display: block;
    width: 100%;
    max-width: 380px;
    height: 230px;
    object-fit: contain;
    background: white;
    border-radius: 10px;
    margin: 0 auto 15px;
}

.product-details a {
    color: #80cdc1;
    font-size: 13px;
}

.local-product-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 90px;
    height: 90px;
    flex: 0 0 90px;
    box-sizing: border-box;
    padding: 12px;
    border-radius: 10px;
    background: #25464d;
}

.local-product-visual img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-category-label {
    color: #80cdc1;
    font-size: 13px !important;
}

.optional-product-photo {
    font-size: 12px;
    color: #aac0c5;
    margin: 5px 0;
}

.optional-product-photo summary {
    cursor: pointer;
}

.optional-product-photo a {
    display: inline-block;
    margin-top: 6px;
}

@media (max-width: 600px) {
    .local-product-visual {
        width: 72px;
        height: 72px;
        flex-basis: 72px;
        padding: 10px;
    }
}

.supplier-panel {
    background: #203d43;
    padding: 18px;
    border-radius: 12px;
    margin: 16px 0;
}

.supplier-panel h2 {
    margin: 8px 0 12px;
    font-size: 21px;
    overflow-wrap: anywhere;
}

.supplier-panel p {
    margin: 8px 0;
    overflow-wrap: anywhere;
}

.supplier-accent {
    color: #80cdc1;
}

.supplier-input {
    box-sizing: border-box;
    width: 100%;
    display: block;
    font-size: 16px;
    padding: 12px;
    margin: 10px 0;
    background: #142b30;
    color: #f4f7f7;
    border: 1px solid #56777d;
    border-radius: 8px;
}

.supplier-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    margin: 16px 0;
    line-height: 1.5;
}

.supplier-check input {
    flex-shrink: 0;
    margin-top: 4px;
}

.supplier-template {
    padding: 14px;
    background: #142b30;
    border-radius: 9px;
    margin: 12px 0;
}

.supplier-alias {
    font-size: 14px;
    padding: 7px 10px;
    background: #142b30;
    border-radius: 6px;
}

.supplier-error {
    color: #fca5a5;
}

.payment-suggestion-panel {
    padding: 16px;
    background: #203d43;
    border-radius: 12px;
    margin: 16px 0;
    overflow-wrap: anywhere;
}

.payment-suggestion-panel h2 {
    font-size: 20px;
    margin: 0 0 12px;
}

.payment-suggestion-panel p {
    margin: 8px 0;
    line-height: 1.5;
}

.payment-suggestion-accent {
    color: #80cdc1;
    font-size: 17px;
    font-weight: 700;
}

.payment-suggestion-panel details {
    margin: 12px 0;
}

.payment-suggestion-panel summary {
    cursor: pointer;
    font-size: 14px;
    color: #80cdc1;
}

.upload-panel {
    padding: 28px 18px;
    text-align: center;
    border: 2px dashed #56777d;
    border-radius: 15px;
    background: #203d43;
}

.upload-panel h2 {
    font-size: 21px;
    margin: 14px 0;
}

.upload-panel input[type=file] {
    max-width: 100%;
    font-size: 14px;
    margin: 12px 0;
}

.pdf-document-preview {
    display: block;
    width: 100%;
    max-width: 600px;
    height: auto;
    margin: auto;
    border-radius: 8px;
    background: white;
}

.pdf-extracted-text {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 13px;
    line-height: 1.5;
    max-height: 600px;
    overflow: auto;
    padding: 12px;
    background: #142b30;
    border-radius: 8px;
}

.voice-recorder {
    margin: 20px 0;
    text-align: center;
}

.voice-record-button {
    border: 0;
    border-radius: 50%;
    background: #bd4040;
    color: white;
    width: 72px;
    height: 72px;
    cursor: pointer;
}

.voice-record-button:disabled {
    opacity: 0.6;
}

.voice-record-button[hidden],
#voice-stop[hidden] {
    display: none !important;
}

#voice-timer {
    font-size: 25px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.voice-player {
    width: 100%;
    margin: 12px 0;
}

.voice-transcript {
    white-space: pre-wrap;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.find-input {
    display: block;
    box-sizing: border-box;
    width: 100%;
    padding: 17px 14px;
    border: 1px solid #56777d;
    border-radius: 12px;
    background: #203d43;
    color: #f4f7f7;
    font-size: 18px;
    margin: 12px 0;
}

.find-result-heading {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    text-decoration: none;
    color: inherit;
}

.find-result-heading > div {
    min-width: 0;
    flex: 1;
}

.find-preview {
    width: 78px;
    height: 100px;
    object-fit: contain;
    border-radius: 6px;
    background: #142b30;
    flex-shrink: 0;
}

.find-result-heading h2 {
    color: #80cdc1;
    font-size: 19px;
}

.find-result-count {
    margin: 20px 0 10px;
}

.find-evidence-label {
    font-size: 12px;
    color: #80cdc1;
    font-weight: bold;
}

.find-snippet {
    font-size: 14px;
    line-height: 1.5;
    padding: 8px;
    background: #142b30;
    border-radius: 6px;
}

.find-result details {
    margin: 15px 0;
}

.find-result summary {
    cursor: pointer;
    font-size: 14px;
}

.find-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
}

.find-examples a {
    color: #80cdc1;
    background: #142b30;
    padding: 9px 13px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
}
