:root {
  color: #172033;
  background: #f4f6f8;
  font-family: "Segoe UI", sans-serif;
  line-height: 1.45;
}

body { margin: 0; }
a { color: #0b5f56; }
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
aside { background: #102033; color: #f7f4ee; padding: 24px 18px; }
aside a { color: #f7f4ee; display: block; padding: 8px 0; text-decoration: none; }
main { padding: 32px; min-width: 0; }
p, .notice, .card { overflow-wrap: break-word; }
.mark { letter-spacing: 0.12em; text-transform: uppercase; font-size: 12px; margin: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.card, form.card, .notice { background: white; border: 1px solid #d9e0e7; border-radius: 8px; padding: 16px; }
.notice { background: #fff8e8; }
label { display: block; margin: 12px 0 4px; font-weight: 600; }
input, select, textarea { width: min(420px, 100%); padding: 8px; border: 1px solid #c5ced6; border-radius: 6px; }
button { background: #0b5f56; color: white; border: 0; border-radius: 6px; padding: 8px 14px; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; background: white; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid #e4eaef; }
.audit-table { overflow-x: auto; }
.audit-table td { vertical-align: top; }
.audit-source { color: #44515c; font-size: 0.85rem; }
.audit-digest { margin-top: 4px; }
.audit-digest summary { cursor: pointer; font-size: 0.85rem; }
.audit-digest code { display: block; max-width: 34ch; overflow-wrap: anywhere; margin-top: 4px; }
@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; }
  aside { padding-bottom: 8px; }
}

.public-shell { min-height: 100vh; background: linear-gradient(180deg, #f7f5f1 0%, #e7eef0 100%); color: #172033; }
.public-bar { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; }
.public-main { width: min(720px, calc(100% - 32px)); margin: 0 auto 48px; padding: 0; }
.verify-qr svg { width: 180px; height: auto; display: block; }
.staff-link { color: #0b5f56; font-weight: 650; }
.verify-hero h1 { font-size: clamp(2rem, 6vw, 3.2rem); line-height: 1.05; margin: 0 0 8px; }
.verify-card, .privacy-card, .result-card { background: white; border-radius: 18px; padding: 20px; box-shadow: 0 12px 40px rgba(16, 32, 51, 0.08); }
.drop-zone { display: grid; gap: 6px; border: 1.5px dashed #8aa8a4; border-radius: 16px; padding: 28px 16px; text-align: center; background: #f6fbfa; cursor: pointer; }
.drop-zone.dragover { background: #e5f5f2; border-color: #0b5f56; }
.drop-zone input { width: auto; margin: 0 auto 8px; }
.drop-title { font-size: 1.15rem; font-weight: 700; }
.drop-hint, .file-name, .verify-status { color: #44515c; }
#verify-button { width: 100%; min-height: 48px; font-size: 1.05rem; border-radius: 12px; }
.domain-warning { background: #fff6df; border-radius: 12px; padding: 12px 14px; }
.result-card { margin-top: 16px; }
.tone-verified { border-top: 8px solid #0e7c4a; }
.tone-rejected { border-top: 8px solid #a33b32; }
.tone-unknown { border-top: 8px solid #5d6b76; }
.privacy-card { margin-top: 16px; }
@media (max-width: 640px) {
  .public-bar { padding: 16px; }
  .verify-card, .privacy-card, .result-card { padding: 16px; }
}

/* Customer verification surface */
.public-shell { background: radial-gradient(ellipse at 50% 0%, #e9f3ef 0%, #f5f7f6 55%); color: #192d36; font-size: 15px; }
.public-shell *, .public-shell *::before, .public-shell *::after { box-sizing: border-box; }
.public-shell [hidden] { display: none !important; }
.public-bar { max-width: 1100px; margin: auto; padding: 24px 36px; gap: 16px; }
.public-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #163b36; font-size: 18px; letter-spacing: -.4px; }
.brand-symbol { display: grid; place-items: center; width: 34px; height: 38px; color: #087b60; }
.brand-symbol svg { width: 30px; height: 32px; }
.official-host { display: flex; gap: 8px; align-items: center; color: #52645e; font-size: 12px; background: #ffffffa6; border: 1px solid #dce7e1; border-radius: 24px; padding: 7px 11px; }
.official-host span { color: #16805f; font-size: 8px; }
.public-main { width: min(720px, calc(100% - 40px)); margin: 24px auto 40px; }
.auth-main { width: min(440px, calc(100% - 40px)); margin: 48px auto; padding: 0; }
.auth-card { background: white; padding: 32px; border: 1px solid #dfe7e3; border-radius: 20px; box-shadow: 0 10px 32px #173e2d08; }
.auth-card h1 { font-size: 30px; letter-spacing: -.8px; margin: 0 0 8px; }
.auth-intro { color: #5b6d73; margin: 0 0 24px; }
.auth-form input { width: 100%; min-height: 42px; font: inherit; }
.auth-form button { width: 100%; min-height: 44px; margin-top: 24px; font: inherit; font-weight: 650; cursor: pointer; }
.auth-verify-link { font-size: 13px; font-weight: 600; }
.graphic-import { max-width: 600px; }
.graphic-import input, .graphic-import select, .signing-options select { box-sizing: border-box; max-width: 100%; font: inherit; }
.graphic-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 300px)); gap: 16px; }
.graphic-tile img { width: 100%; height: 160px; object-fit: contain; background: #f7f9f8; border-radius: 8px; }
.graphic-tile h3 { margin-bottom: 4px; }
.graphic-tile p { font-size: 13px; color: #52645e; }
.signing-options { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); gap: 24px; margin: 20px 0; }
.stamp-preview-panel { text-align: center; }
.stamp-preview { position: relative; width: min(260px, 100%); aspect-ratio: 1; margin: auto; background: white; }
.stamp-preview img { position: absolute; object-fit: contain; }
.stamp-background { inset: 0; width: 100%; height: 100%; }
.stamp-handwriting { left: 21%; top: 31%; width: 58%; height: 26%; }
.stamp-date { position: absolute; top: 62%; left: 15%; width: 70%; color: #143831; font: 14px/1.2 Arial, sans-serif; }
.stamp-date-choice { font-weight: 400; }
.stamp-date-choice input { width: auto; }
@media (max-width: 700px) { .signing-options { grid-template-columns: 1fr; } }
@media (max-width: 480px) {
  .auth-main { margin: 24px auto; }
  .auth-card { padding: 24px; }
  .auth-shell .public-bar { padding: 20px; gap: 12px; flex-wrap: wrap; }
}
.verify-hero { text-align: center; margin-bottom: 28px; }
.verify-eyebrow { font-size: 11px; letter-spacing: 1.8px; color: #547269; font-weight: 700; margin: 0 0 10px; }
.verify-hero h1 { font-size: clamp(30px, 5vw, 42px); letter-spacing: -1.4px; line-height: 1.15; margin: 0 0 12px; font-weight: 750; }
.verify-intro { color: #5b6d73; margin: 0; font-size: 16px; }
.verify-card, .result-card { border: 1px solid #dfe7e3; border-radius: 20px; padding: 28px; box-shadow: 0 10px 32px #173e2d08; }
.drop-zone { position: relative; display: flex; flex-direction: column; align-items: center; gap: 7px; margin: 0; padding: 24px 20px; border: 1.5px dashed #9ebdb0; border-radius: 13px; background: #f8fbf9; font-weight: 400; transition: background .15s, border-color .15s; }
.drop-zone:hover, .drop-zone.dragover { background: #edf7f1; border-color: #16805f; }
.drop-zone:focus-within { outline: 3px solid #74bba0; outline-offset: 3px; }
.drop-zone .file-input { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; opacity: 0; overflow: hidden; }
.upload-mark { display: grid; place-items: center; width: 44px; height: 44px; background: #e9f2ec; color: #387c62; border-radius: 12px; margin-bottom: 5px; }
.upload-mark svg { width: 26px; height: 26px; }
.drop-title { font-size: 17px; font-weight: 650; color: #243d34; }
.drop-hint { font-size: 13px; color: #6a7e75; }
.choose-file { border: 1px solid #ccdad2; background: white; padding: 7px 16px; font-size: 13px; border-radius: 7px; color: #285740; font-weight: 650; margin-top: 8px; }
.file-name { font-size: 15px; font-weight: 650; color: #254a3b; overflow-wrap: anywhere; max-width: 100%; order: 2; }
.file-size { font-size: 12px; color: #6a7e75; order: 3; }
.has-file .choose-file { order: 4; }
.has-file .drop-hint { display: none; }
.reference-details { margin: 20px 0 16px; font-size: 13px; color: #49675a; }
.reference-details summary, .technical-details summary, .privacy-card summary { cursor: pointer; font-weight: 600; }
.reference-details summary span { font-weight: 400; color: #7a8781; }
.reference-details label { font-size: 12px; margin-top: 12px; }
.reference-details input { width: 100%; font-size: 14px; padding: 11px; background: #fcfdfc; }
#verify-button { display: flex; justify-content: center; align-items: center; gap: 12px; width: 100%; min-height: 50px; margin: 0; background: #08664f; font-size: 15px; font-weight: 650; border-radius: 9px; cursor: pointer; }
#verify-button:hover { background: #075540; }
#verify-button:disabled { cursor: wait; opacity: .7; }
.button-arrow { font-size: 19px; }
.button-spinner { display: none; width: 16px; height: 16px; border: 2px solid #ffffff60; border-top-color: white; border-radius: 50%; animation: verify-spin .8s linear infinite; }
.is-busy .button-spinner { display: inline-block; }
.is-busy .button-arrow { display: none; }
.is-busy .drop-zone { cursor: pointer; }
.verify-status { margin: 10px 0 0; font-size: 13px; text-align: center; }
.verify-status:empty { display: none; }
.verify-privacy-line { margin: 14px 0 0; color: #738179; font-size: 12px; text-align: center; }
.verify-privacy-line span { margin-right: 4px; }
.status-legend { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; margin: 16px 0 22px; color: #6c7c74; font-size: 11px; }
.status-legend span { display: flex; align-items: center; gap: 6px; }
.status-legend i { width: 6px; height: 6px; border-radius: 100%; background: #687786; }
.status-legend .dot-green { background: #098252; }.status-legend .dot-yellow { background: #c58a16; }.status-legend .dot-red { background: #c34a40; }
.result-card { --result: #536976; --tint: #f0f4f6; margin: 0 0 20px; border-top: 1px solid #dfe7e3; border-left: 4px solid var(--result); padding: 26px; }
.result-card.tone-verified { --result: #087a4c; --tint: #e7f5ed; }
.result-card.tone-warning { --result: #94600b; --tint: #fff4d9; }
.result-card.tone-rejected { --result: #b1352f; --tint: #ffedeb; }
.result-heading { display: flex; gap: 15px; align-items: center; }
.result-symbol { flex-shrink: 0; display: grid; place-items: center; width: 52px; height: 52px; background: var(--tint); border-radius: 50%; color: var(--result); font-size: 30px; font-weight: 500; }
.result-eyebrow { font-size: 10px; letter-spacing: 1.4px; margin: 0 0 3px; color: var(--result); font-weight: 700; }
.result-heading h2 { font-size: clamp(22px, 4vw, 28px); color: var(--result); letter-spacing: -.6px; line-height: 1.15; margin: 0; }
.result-summary { font-size: 15px; line-height: 1.6; margin: 20px 0 12px; }
.result-next { background: var(--tint); border-radius: 8px; padding: 12px 14px; font-size: 14px; color: var(--result); }
.result-checks { display: flex; gap: 8px 18px; flex-wrap: wrap; font-size: 12px; color: var(--result); margin: 16px 0 20px; }
.checked-file { border-top: 1px solid #e4ebe7; padding-top: 16px; margin-top: 20px; display: flex; flex-direction: column; gap: 4px; }
.field-caption { font-size: 10px; letter-spacing: 1px; color: #74867c; font-weight: 650; }
.checked-file-name { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.checked-hash { font-size: 12px; color: #7b8882; }
.checked-hash code { color: #4e675a; font-size: 12px; }
.result-meta { font-size: 12px; color: #718077; margin: 14px 0; }
.technical-details { padding-top: 14px; margin-top: 18px; border-top: 1px solid #e4ebe7; font-size: 12px; color: #5d6d64; }
.technical-details p { line-height: 1.65; margin: 12px 0 0; }
.full-hash { display: block; overflow-wrap: anywhere; margin-top: 6px; }
.privacy-card { background: transparent; padding: 0 8px; margin: 24px 0 0; box-shadow: none; font-size: 12px; color: #718077; }
.privacy-card summary { text-align: center; }
.privacy-card p { line-height: 1.7; }
.public-footer { display: flex; justify-content: space-between; gap: 15px; max-width: 1030px; padding: 20px 30px 28px; margin: auto; color: #839088; font-size: 11px; }
.public-footer a { color: #6c7d73; font-size: 11px; font-weight: 400; text-decoration: none; }
.public-shell :focus-visible { outline: 3px solid #68ae94; outline-offset: 4px; }
@keyframes verify-spin { to { transform: rotate(360deg); } }
@media (max-width: 600px) {
  .public-bar { padding: 18px 20px; flex-wrap: wrap; gap: 10px; }
  .public-brand { font-size: 16px; }.official-host { font-size: 10px; padding: 6px 8px; }
  .public-main { margin-top: 22px; width: calc(100% - 28px); }
  .verify-hero { padding: 0 8px; margin-bottom: 22px; }.verify-intro { font-size: 14px; }
  .verify-card, .result-card { padding: 20px; border-radius: 16px; }
  .drop-zone { padding: 22px 12px; }.status-legend { gap: 8px 14px; font-size: 10px; }
  .result-symbol { width: 44px; height: 44px; font-size: 26px; }.result-heading { gap: 12px; }
  .public-footer { padding: 18px 20px; }
}
@media (prefers-reduced-motion: reduce) { .button-spinner { animation: none; }.drop-zone { transition: none; } }

.document-action-hint { display: block; color: #5b6d64; font-size: .85rem; margin-top: 6px; max-width: 55ch; }

.page-heading h1, .email-compose h1 { margin-bottom: 8px; }
.page-heading p, .email-compose > p { color: #5b6d64; }
.customer-editor { margin-bottom: 24px; }
.customer-editor h2 { margin-top: 0; font-size: 20px; }
.form-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px 24px; }
.customer-editor input:not([type=checkbox]), .customer-editor select, .customer-editor textarea, .email-editor input, .email-editor select, .email-editor textarea { box-sizing: border-box; width: 100%; font: inherit; }
.customer-editor label, .email-editor label { font-size: 14px; }
.field-help { font-size: 12px; color: #65756c; margin: 6px 0; }
.checkbox-label { display: flex; align-items: center; gap: 8px; }.checkbox-label input { width: auto; }
.form-actions { display: flex; gap: 10px; }.secondary-button { background: white; border: 1px solid #bdcdc3; color: #285740; }
.table-scroll { overflow-x: auto; }.table-scroll td { overflow-wrap: anywhere; max-width: 240px; }
.email-compose { max-width: 820px; }.email-editor { margin-top: 18px; }
.attachment-preview { display: flex; gap: 14px; align-items: center; }.attachment-preview > span { color: #176b52; background: #e4f3eb; padding: 12px 10px; border-radius: 8px; font-size: 12px; font-weight: 700; }
.attachment-preview p { font-size: 12px; color: #65756c; margin: 4px 0 0; }.attachment-preview strong { overflow-wrap: anywhere; }
.action-link { display: inline-block; border: 1px solid #b7ccc1; padding: 7px 12px; border-radius: 6px; text-decoration: none; margin-left: 12px; color: #185e46; font-size: 13px; }
@media(max-width:600px) { .form-columns { grid-template-columns: 1fr; }.action-link { margin: 8px 0 0; } }

.user-editor { margin: 22px 0; }.user-editor h2 { margin-top: 0; font-size: 20px; }
.user-editor input:not([type=checkbox]), .user-editor select { width: 100%; box-sizing: border-box; font: inherit; }
.user-roles { border: 1px solid #d9e4dd; border-radius: 8px; margin: 22px 0 14px; padding: 12px 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 8px 18px; }
.user-roles legend { padding: 0 8px; font-size: 14px; font-weight: 650; }
.user-roles .role-choice { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0; font-weight: 400; cursor: pointer; }
.role-choice input { width: auto; margin-top: 5px; }.role-choice .field-help { display: block; line-height: 1.5; }
.role-choice strong { font-size: 14px; }.role-badge, .user-state, .user-you { display: inline-block; border-radius: 4px; padding: 3px 7px; margin: 2px 5px 2px 0; font-size: 12px; background: #edf2ef; color: #335a46; }
.user-state.active { background: #e3f3e9; color: #14633e; }.user-state.inactive { background: #f0e9e7; color: #824537; }.user-you { margin-left: 8px; }
