/* ProofIt — Vérificateur ASiC-E offline — feuille de style autonome */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1e293b;
    background: #f8fafc;
    line-height: 1.55;
}
code, pre, .mono { font-family: ui-monospace, SF Mono, Monaco, Consolas, "Liberation Mono", monospace; }
.muted { color: #64748b; }
.small { font-size: 0.85em; }
button { cursor: pointer; font: inherit; }

.topbar {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { display: block; }
.brand-name { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; }
.brand-sub { color: #64748b; font-size: 0.78rem; }
.topbar-meta { display: flex; gap: 8px; }
.badge {
    padding: 2px 8px; border-radius: 999px; font-size: 0.72rem;
    background: #f1f5f9; color: #475569; font-weight: 500;
}
.badge-emerald { background: #d1fae5; color: #065f46; }

main { max-width: 1100px; margin: 0 auto; padding: 28px 20px 80px; }

/* Drop zone */
.drop-zone {
    border: 2px dashed #cbd5e1;
    background: #fff;
    border-radius: 16px;
    padding: 60px 24px;
    text-align: center;
    transition: border-color 0.15s, background 0.15s;
}
.drop-zone.dragover {
    border-color: #10b981;
    background: #ecfdf5;
}
.drop-icon { font-size: 3rem; line-height: 1; }
.drop-zone h1 { margin: 14px 0 6px; font-size: 1.4rem; }
.drop-zone code { background: #f1f5f9; padding: 2px 6px; border-radius: 4px; font-size: 0.92em; }
.link-button {
    background: none; border: none; color: #047857; text-decoration: underline; padding: 0;
}
.root-key-input { margin-top: 20px; text-align: left; max-width: 540px; margin-inline: auto; }
.root-key-input summary { cursor: pointer; color: #475569; font-size: 0.9rem; }
.root-key-input input {
    margin-top: 8px;
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-family: ui-monospace, monospace;
    font-size: 0.85rem;
}

/* Report */
.report { margin-top: 16px; }
.report-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px;
}
.report-header h2 { margin: 0; font-size: 1.4rem; }
.button-secondary {
    padding: 7px 14px; border: 1px solid #cbd5e1; background: #fff;
    border-radius: 6px; font-size: 0.88rem; color: #475569;
}
.button-secondary:hover { border-color: #94a3b8; }

.summary {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
    padding: 16px 20px; margin-bottom: 16px;
}
.summary .checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.check {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 8px;
    background: #f8fafc; border: 1px solid #e2e8f0;
}
.check.ok    { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.check.warn  { background: #fef3c7; border-color: #fcd34d; color: #78350f; }
.check.fail  { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }
.check .icon { font-size: 1.2em; line-height: 1; flex-shrink: 0; }
.check .label { font-weight: 600; font-size: 0.92rem; }
.check .sub   { font-size: 0.8rem; opacity: 0.8; margin-top: 2px; }

/* Tabs */
.tabs {
    display: flex; gap: 4px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.tab {
    background: none; border: none;
    padding: 9px 14px;
    color: #64748b; font-weight: 500; font-size: 0.92rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
}
.tab:hover { color: #1e293b; }
.tab.active {
    color: #047857; border-bottom-color: #10b981;
}
.tab-panel { animation: fadein 0.15s ease-out; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.card {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
    padding: 14px 18px; margin-bottom: 12px;
}
.card-title { font-weight: 600; margin: 0 0 8px; font-size: 0.95rem; }

.kvtable { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.kvtable th, .kvtable td { padding: 6px 8px; text-align: left; vertical-align: top; border-bottom: 1px solid #f1f5f9; }
.kvtable th { width: 200px; color: #64748b; font-weight: 500; }
.kvtable td.mono { font-family: ui-monospace, monospace; word-break: break-all; font-size: 0.82rem; }

.entry {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
    padding: 10px 14px; margin-bottom: 8px;
    font-size: 0.88rem;
}
.entry-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.entry-seq { color: #94a3b8; font-family: ui-monospace, monospace; font-size: 0.8rem; }
.entry-type {
    padding: 2px 8px; border-radius: 4px; font-weight: 600;
    background: #f1f5f9; color: #475569; font-size: 0.78rem;
}
.entry-type.session-plan-committed,
.entry-type.session-plan-resolved,
.entry-type.signing-context-attested { background: #d1fae5; color: #065f46; }
.entry-type.login { background: #dbeafe; color: #1e40af; }
.entry-type.artifact-attached { background: #fef3c7; color: #78350f; }
.entry-hash { color: #475569; font-family: ui-monospace, monospace; font-size: 0.78rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.entry-time { color: #94a3b8; font-size: 0.78rem; }
.entry-detail { margin-top: 8px; padding-top: 8px; border-top: 1px dashed #e2e8f0; display: none; }
.entry.open .entry-detail { display: block; }

.verdict-badge {
    display: inline-block; padding: 4px 10px; border-radius: 6px;
    font-weight: 600; font-size: 0.85rem;
}
.verdict-MATCH     { background: #d1fae5; color: #065f46; }
.verdict-PARTIAL   { background: #fef3c7; color: #78350f; }
.verdict-DIVERGENT { background: #fee2e2; color: #991b1b; }
.verdict-EMPTY     { background: #f1f5f9; color: #475569; }

.seal-mode-OWN       { background: #d1fae5; color: #065f46; padding: 2px 8px; border-radius: 4px; font-size: 0.78rem; font-weight: 600; }
.seal-mode-DELEGATED { background: #fef3c7; color: #78350f; padding: 2px 8px; border-radius: 4px; font-size: 0.78rem; font-weight: 600; }

.eml-preview {
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px;
    padding: 10px 12px;
    font-family: ui-monospace, monospace; font-size: 0.78rem;
    white-space: pre-wrap; word-break: break-all;
    max-height: 240px; overflow-y: auto;
}

.file-tree {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
    padding: 10px 14px;
    font-family: ui-monospace, monospace; font-size: 0.85rem;
}
.file-row { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px solid #f8fafc; }
.file-row:last-child { border-bottom: none; }
.file-row .name { color: #1e293b; word-break: break-all; }
.file-row .size { color: #94a3b8; padding-left: 12px; flex-shrink: 0; }

.howto {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
    padding: 20px 24px; margin-top: 24px;
}
.howto h2 { margin: 0 0 8px; font-size: 1.05rem; }
.howto ol { margin: 8px 0; padding-left: 20px; }
.howto li { padding: 3px 0; font-size: 0.9rem; }

.footer {
    border-top: 1px solid #e2e8f0; padding: 14px 24px;
    text-align: center; font-size: 0.78rem; color: #94a3b8;
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}

@media (max-width: 640px) {
    main { padding: 16px 12px 60px; }
    .topbar { padding: 12px 16px; }
    .drop-zone { padding: 36px 14px; }
    .drop-zone h1 { font-size: 1.15rem; }
    .kvtable th { width: auto; display: block; padding-bottom: 0; }
    .kvtable td { display: block; padding-top: 2px; }
}
