:root {
    --ink: #1c393d;
    --deep: #1c393d;
    --green: #02bf5a;
    --orange: #02bf5a;
    --paper: #f7f8f7;
    --white: #fff;
    --muted: #747373;
    --line: #e3e8e7;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: Arial, Helvetica, sans-serif;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input { font: inherit; }
.topbar, main, footer { max-width: 1240px; margin: auto; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 22px 28px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-icon { display: block; width: 50px; height: 50px; }
.brand-word { color: #070b0c; font-size: 28px; font-weight: 800; letter-spacing: -.04em; }
.portal-label { padding-left: 13px; color: #667579; border-left: 1px solid #d7dedd; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.back-link { color: var(--green); text-decoration: none; font-size: 13px; font-weight: 750; }
main { padding: 62px 28px 100px; }
.intro { display: grid; grid-template-columns: 1fr auto; gap: 60px; align-items: end; margin-bottom: 50px; }
.eyebrow { margin: 0 0 12px; color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
h1, h2, h3 { font-family: Arial, Helvetica, sans-serif; font-weight: 400; }
h1 { margin: 0; font-size: clamp(52px, 7vw, 84px); line-height: .95; letter-spacing: -.05em; }
h1 em { color: var(--orange); font-weight: 400; }
.lede { max-width: 700px; margin: 22px 0 0; color: var(--muted); font-size: 17px; line-height: 1.65; }
.steps { display: flex; align-items: center; gap: 0; margin: 0; padding: 0; list-style: none; }
.steps li { display: flex; align-items: center; gap: 8px; color: #9aa29e; font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.steps li:not(:last-child)::after { content: ""; width: 32px; height: 1px; margin: 0 10px; background: #ccd4d0; }
.steps span { display: grid; place-items: center; width: 26px; height: 26px; border: 1px solid #cbd4d0; border-radius: 50%; }
.steps .current { color: var(--deep); }
.steps .current span { color: white; border-color: var(--orange); background: var(--orange); }
.steps .done { color: var(--green); }
.steps .done span { color: white; border-color: var(--green); background: var(--green); }
.message { margin: -20px 0 26px; padding: 15px 18px; border-radius: 9px; font-size: 13px; }
.message strong { margin-right: 5px; }
.message.error { color: #822f2f; border: 1px solid #e8bcbc; background: #fbe9e8; }
.message.success { color: #245d48; border: 1px solid #b9d7c9; background: #e5f1eb; }
.workspace { display: grid; grid-template-columns: minmax(300px, .75fr) minmax(440px, 1.25fr); gap: 20px; align-items: start; }
.panel { padding: 28px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); }
.panel-heading { display: flex; align-items: center; gap: 13px; margin-bottom: 25px; }
.panel-heading .number { color: var(--green); font: 400 14px Arial, Helvetica, sans-serif; }
.panel-heading p { margin: 0 0 3px; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .14em; }
.panel-heading h2 { margin: 0; font-size: 27px; }
.count { margin-left: auto; padding: 6px 9px; color: var(--green); background: #e5f0ea; border-radius: 5px; font-size: 10px; font-weight: 750; text-transform: uppercase; }
.folder-picker {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 225px; padding: 25px; border: 1px dashed #acc2b8; border-radius: 11px;
    background: #f8faf8; cursor: pointer; text-align: center;
}
.folder-picker:hover { border-color: var(--green); background: #f2f7f4; }
.folder-icon {
    display: grid; place-items: center; width: 62px; height: 70px; margin-bottom: 17px;
    color: #a64e31; background: #f4ded5; border-radius: 8px 8px 15px 5px;
    font-size: 12px; font-weight: 850; letter-spacing: .05em;
}
.folder-picker strong { font-size: 14px; }
.folder-picker > span:last-of-type { margin-top: 6px; color: var(--muted); font-size: 11px; }
.folder-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.primary, .secondary, .download {
    display: inline-flex; align-items: center; justify-content: center; gap: 20px;
    min-height: 46px; padding: 12px 20px; border-radius: 7px; cursor: pointer;
    text-decoration: none; font-size: 12px; font-weight: 800;
}
.primary { color: white; border: 1px solid var(--green); background: var(--green); }
.primary:hover, .download:hover { background: #226048; }
.primary:disabled { cursor: not-allowed; opacity: .45; }
.secondary { color: var(--green); border: 1px solid #b9cbc3; background: white; }
.full { width: 100%; margin-top: 13px; }
.privacy { margin: 15px 4px 0; color: #89928e; font-size: 10px; line-height: 1.5; text-align: center; }
.upload-status { margin: 13px 4px 0; color: var(--muted); font-size: 10px; line-height: 1.5; text-align: center; }
.upload-status.loading { color: var(--green); font-weight: 700; }
.file-list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.file-list li { display: flex; align-items: center; min-width: 0; padding: 11px 10px; border: 1px solid #e6ebe8; border-radius: 8px; background: #fbfcfb; }
.file-list li[draggable="true"] { cursor: grab; }
.file-list li.dragging { opacity: .42; cursor: grabbing; }
.file-list li.drag-over { border-color: var(--green); box-shadow: 0 0 0 2px rgba(2, 191, 90, .13); }
.drag-handle { width: 22px; color: #9aa6a1; font-size: 21px; line-height: 1; text-align: center; cursor: grab; user-select: none; }
.position { width: 28px; color: #8e9994; font: 400 16px Arial, Helvetica, sans-serif; text-align: center; }
.file-type { display: grid; place-items: center; width: 36px; height: 42px; margin: 0 12px 0 7px; color: #a64e31; background: #f5e1d9; border-radius: 5px; font-size: 8px; font-weight: 900; }
.file-info { min-width: 0; flex: 1; }
.file-info strong { display: block; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.file-info small { display: block; margin-top: 5px; color: #929b97; font-size: 9px; }
.file-controls form { display: flex; margin-left: 10px; }
.file-controls button { width: 31px; height: 31px; padding: 0; color: var(--green); border: 1px solid #d5dfda; border-radius: 5px; background: white; cursor: pointer; }
.file-controls button:hover:not(:disabled) { color: white; border-color: var(--green); background: var(--green); }
.file-controls button:disabled { color: #c9cfcc; cursor: not-allowed; }
.file-controls button.remove { color: #a2584c; }
.sort-status { margin: 11px 2px 0; color: #89928e; font-size: 10px; }
.sort-status.saving { color: var(--green); }
.sort-status.error { color: #a2584c; }
.actions { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.empty { min-height: 310px; display: flex; flex-direction: column; justify-content: center; align-items: center; color: var(--muted); text-align: center; }
.empty > span { padding: 10px 13px; color: #7b9188; border: 1px dashed #b8c7c0; border-radius: 7px; word-spacing: 12px; font: 400 14px Arial, Helvetica, sans-serif; }
.empty h3 { margin: 20px 0 5px; color: var(--ink); font-size: 21px; }
.empty p { margin: 0; font-size: 12px; }
.download-card {
    display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 22px;
    margin-top: 20px; padding: 27px 30px; color: white; border-radius: 14px; background: var(--deep);
}
.check { display: grid; place-items: center; width: 48px; height: 48px; color: white; border-radius: 50%; background: var(--green); font-size: 23px; }
.download-card .eyebrow { color: #a9c5b9; margin-bottom: 5px; }
.download-card h2 { margin: 0; font-size: 28px; }
.download-card p:last-child { margin: 6px 0 0; color: #aabbb4; font-size: 11px; }
.download { color: white; border: 1px solid #589078; background: var(--green); }
.email-card {
    display: grid; grid-template-columns: 1fr 1.2fr; gap: 35px; align-items: end;
    margin-top: 20px; padding: 26px 28px; border: 1px solid var(--line);
    border-radius: 14px; background: white;
}
.email-card h2 { margin: 0; font-size: 25px; }
.email-card > div > p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.email-card label { display: block; margin-bottom: 7px; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.email-fields { display: grid; grid-template-columns: 1fr auto; }
.email-fields input { min-width: 0; padding: 13px 14px; color: var(--deep); border: 1px solid #bccbc5; border-right: 0; border-radius: 7px 0 0 7px; }
.email-fields button { padding: 13px 17px; color: white; border: 0; border-radius: 0 7px 7px 0; background: var(--green); cursor: pointer; font-weight: 800; }
.email-fields button:disabled { cursor: wait; opacity: .55; }
footer { padding: 25px 28px 40px; color: var(--muted); border-top: 1px solid var(--line); font-size: 10px; }
.processing-overlay {
    position: fixed;
    z-index: 1000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    visibility: hidden;
    opacity: 0;
    background: rgba(28, 57, 61, .78);
    backdrop-filter: blur(4px);
    transition: opacity .18s ease, visibility .18s ease;
}
.processing-overlay.visible { visibility: visible; opacity: 1; }
.processing-card {
    width: min(390px, 100%);
    padding: 38px 30px 34px;
    border-radius: 14px;
    background: white;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .25);
    text-align: center;
}
.processing-spinner {
    display: block;
    width: 58px;
    height: 58px;
    margin: 0 auto 24px;
    border: 5px solid #dff5e8;
    border-top-color: var(--green);
    border-right-color: var(--green);
    border-radius: 50%;
    animation: processing-spin .75s linear infinite;
}
.processing-card strong { display: block; color: var(--deep); font-size: 18px; }
.processing-card p { margin: 9px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.is-processing { overflow: hidden; }
@keyframes processing-spin { to { transform: rotate(360deg); } }
button:focus-visible, a:focus-visible, .folder-picker:focus-within { outline: 3px solid #e99a67; outline-offset: 3px; }
@media (max-width: 850px) {
    .intro { grid-template-columns: 1fr; }
    .steps { display: none; }
    .workspace, .email-card { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    main { padding-top: 38px; }
    .back-link { font-size: 0; }
    .back-link::after { content: "←"; font-size: 20px; }
    .panel { padding: 20px; }
    .file-controls form { gap: 2px; }
    .file-controls button { width: 28px; }
    .download-card { grid-template-columns: auto 1fr; }
    .download { grid-column: 1 / -1; }
    .actions { align-items: stretch; flex-direction: column-reverse; }
    .actions form, .actions button { width: 100%; }
    .email-fields { grid-template-columns: 1fr; }
    .email-fields input { border-right: 1px solid #bccbc5; border-radius: 7px 7px 0 0; }
    .email-fields button { border-radius: 0 0 7px 7px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
@media (prefers-reduced-motion: reduce) {
    .processing-spinner { animation-duration: 1.8s; }
}
