:root {
    color-scheme: light;
    font-family: Inter, "Segoe UI", system-ui, sans-serif;
    color: #132822;
    background: #f3f6f3;
    font-synthesis: none;
    line-height: 1.55;
    --primary: #155947;
    --deep: #142a28;
    --muted: #52645c;
    --edge: #d9e4dd;
    --wash: #e8f2eb;
    --surface: #fff;
    --radius: 18px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; }
a { color: var(--primary); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .52; }
input, select, textarea {
    width: 100%;
    border: 1px solid #b9cbbf;
    border-radius: 9px;
    padding: .7rem .85rem;
    color: inherit;
    background: #fff;
}
textarea { resize: vertical; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
    outline: 3px solid #378a69;
    outline-offset: 3px;
}
h1, h2, p { margin: 0; }
h1, h2 { letter-spacing: -.035em; line-height: 1.12; }
h1 { font-size: clamp(2.35rem, 4.7vw, 4.1rem); font-weight: 720; }
h2 { font-size: 1.42rem; font-weight: 700; }
small { font-size: .8rem; }
.muted { color: var(--muted); }
.eyebrow { color: var(--primary); font-size: .76rem; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }

.shell { display: grid; min-height: 100vh; grid-template-columns: 232px minmax(0, 1fr); }
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 34px;
    position: sticky;
    top: 0;
    height: 100dvh;
    padding: 28px 18px 21px;
    background: #162b29;
    color: #f9fcfa;
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; line-height: 1.08; }
.brand strong { display: block; font-size: 1.12rem; letter-spacing: -.038em; }
.brand small { display: block; margin-top: 5px; color: #c4d8d0; font-weight: 700; font-size: .55rem; letter-spacing: .15em; }
.sidebar > .brand { margin-inline: 8px; }
.brand-mark {
    display: inline-grid;
    flex: none;
    place-items: center;
    width: 43px;
    height: 43px;
    border-radius: 12px;
    background: #bdf0ae;
    color: #1c3926;
    font-size: .87rem;
    font-weight: 850;
    letter-spacing: -.07em;
}
.workspace {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    padding: 11px 10px;
    border: 1px solid #3c5750;
    border-radius: 12px;
    background: #213a36;
}
.workspace strong, .workspace small { display: block; overflow-wrap: anywhere; }
.workspace strong { font-size: .89rem; }
.workspace small { color: #c4d9d0; }
.avatar {
    display: grid;
    flex: none;
    align-items: center;
    width: 33px;
    height: 33px;
    border-radius: 8px;
    color: #efead1;
    background: #4b5140;
    text-align: center;
    font-size: .69rem;
    font-weight: 800;
}
.sidebar nav { display: grid; gap: 5px; margin-top: -9px; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 44px;
    border: 0;
    border-radius: 9px;
    padding: 8px 12px;
    text-align: left;
    color: #d8e6df;
    background: transparent;
    font-size: .9rem;
    font-weight: 600;
}
.nav-item:hover { background: #213a36; }
.nav-item[aria-current="page"] { background: #304d43; color: #e7fedc; }
.sidebar-end { margin-top: auto; padding: 12px 9px 0; border-top: 1px solid #3a534d; }
.sidebar-end p { font-size: .84rem; font-weight: 650; overflow-wrap: anywhere; }
.sidebar-end .text-button { color: #d4e8dc; font-size: .79rem; padding-left: 0; gap: 8px; }
.sidebar :focus-visible { outline-color: #c4f0ae; }

.main { min-width: 0; }
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    min-height: 71px;
    padding: 12px clamp(20px, 4vw, 56px);
    border-bottom: 1px solid var(--edge);
    background: var(--surface);
}
.topbar p { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .84rem; overflow-wrap: anywhere; }
.topbar strong { color: #263a31; }
.crumb-divider { color: #73877c; }
.badge {
    display: inline-flex;
    align-items: center;
    flex: none;
    gap: 7px;
    border-radius: 6px;
    background: #edf4ed;
    color: #315e46;
    padding: 5px 10px;
    font-size: .76rem;
    font-weight: 700;
}
.badge > span { width: 7px; height: 7px; border-radius: 50%; background: #438454; }
.badge > strong { color: inherit; }
.content { max-width: 1392px; margin-inline: auto; padding: 43px clamp(20px, 4vw, 56px) 56px; }
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.hero .eyebrow { margin-bottom: 8px; }
.hero h1 { margin-bottom: 13px; }
.hero p:not(.eyebrow) { max-width: 570px; color: var(--muted); font-size: 1.04rem; }
.hero > .button { flex: none; }
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 43px;
    border: 1px solid transparent;
    border-radius: 9px;
    padding: 9px 14px;
    font-size: .89rem;
    font-weight: 700;
    text-decoration: none;
    line-height: 1.35;
}
.primary { color: #fff; background: var(--primary); }
.primary:hover:not(:disabled) { background: #0d4839; }
.secondary { color: #244638; background: #fff; border-color: #cad9ce; }
.secondary:hover:not(:disabled) { background: var(--wash); }
.text-button { display: inline-flex; gap: 5px; border: 0; border-radius: 5px; padding: 7px; color: var(--primary); background: transparent; font-weight: 700; }
.text-button:hover { text-decoration: underline; }

.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin: 30px 0 21px;
    padding: 0;
    border: 1px solid var(--edge);
    border-radius: 13px;
    overflow: hidden;
    background: var(--surface);
    list-style: none;
}
.steps li {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 10px clamp(8px, 1.4vw, 17px);
    border-top: 3px solid transparent;
    color: #52645c;
    font-size: .86rem;
    line-height: 1.25;
}
.steps li + li { border-left: 1px solid var(--edge); }
.steps li span {
    display: grid;
    flex: none;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    color: #325144;
    background: #edf3ef;
    font-size: .77rem;
    font-weight: 750;
}
.steps li[aria-current="step"] { border-top-color: #529571; background: #e9f3eb; color: #254c36; }
.steps li[aria-current="step"] span { background: #155947; color: #fff; }

.import-grid { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(260px, 1fr); gap: 18px; align-items: start; }
.card { min-width: 0; border: 1px solid var(--edge); border-radius: var(--radius); padding: 23px; background: var(--surface); }
.card > h2 { margin-bottom: 7px; }
.upload-card { box-shadow: 0 8px 24px #345b3e0a; }
.drop-area {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 4px;
    min-height: 198px;
    margin-top: 17px;
    padding: 17px;
    border: 1.5px dashed #82a794;
    border-radius: 12px;
    text-align: center;
    background: #f1f7f2;
}
.drop-area.drop-active { border-color: var(--primary); background: #e2f2e7; }
.drop-area p { overflow-wrap: anywhere; }
.upload-symbol {
    display: grid;
    place-items: center;
    width: 43px;
    height: 43px;
    margin-bottom: 8px;
    border: 1px solid #c9dcca;
    border-radius: 12px;
    color: var(--primary);
    background: #e6f0e4;
    font-size: 1.45rem;
    line-height: 1;
}
.drop-area p strong { font-size: .99rem; }
.drop-area p.muted { font-size: .84rem; }
.drop-area .button { margin-top: 8px; }
.country-field { display: grid; gap: 4px; max-width: 330px; margin: 14px 0 0; }
.country-field label, .search-form label, .form label { font-size: .83rem; font-weight: 700; }
.country-field select { padding: 6px 9px; font-size: .87rem; }
.upload-actions, .section-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 11px; margin-top: 16px; }

.guide-card details { border-bottom: 1px solid var(--edge); font-size: .85rem; }
.guide-card details summary { padding: 12px 0; color: #294d3c; font-weight: 700; cursor: pointer; }
.guide-card details p { margin-bottom: 9px; color: var(--muted); }
.guide-links { display: grid; gap: 8px; margin-top: 14px; }
.guide-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 9px;
    border-radius: 7px;
    background: #f2f6f2;
    font-size: .84rem;
    font-weight: 680;
    text-decoration: none;
}
.guide-links a:hover { background: #e6efe7; }
.guide-links a span { line-height: 1; font-size: 1rem; }

.preview-card, .saved-card, .profile-form { margin-top: 22px; scroll-margin-top: 20px; }
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; flex-wrap: wrap; }
.section-header h2 { margin-bottom: 5px; }
.export-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.search-form { display: grid; gap: 4px; max-width: 460px; margin: 16px 0 12px; }
.search-form > div { display: flex; align-items: center; gap: 8px; }
.table-scroll { overflow: auto; margin-top: 13px; border: 1px solid var(--edge); border-radius: 9px; }
table { width: 100%; border-collapse: collapse; font-size: .84rem; text-align: left; }
th, td { padding: 9px 11px; vertical-align: top; overflow-wrap: anywhere; }
th { color: #355044; background: #edf4ee; }
td { border-top: 1px solid var(--edge); }
.row-status { display: block; font-weight: 720; }
.row-valid { color: #18553a; }
.row-duplicate { color: #735000; }
.row-invalid { color: #911e2a; }
.row-reason { color: var(--muted); line-height: 1.32; }
.summary-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 0; }
.summary-counts > div { display: grid; gap: 3px; padding: 8px 11px; border-radius: 9px; background: #f0f6f0; }
.summary-counts > div:nth-child(2) { background: #fbf5e7; }
.summary-counts > div:nth-child(3) { background: #fbecee; }
.summary-counts dt { color: #4b574b; font-size: .8rem; font-weight: 700; }
.summary-counts dd { margin: 0; font-weight: 730; font-size: 1.25rem; }

.feedback {
    margin-bottom: 14px;
    border: 1px solid #c7dcd0;
    border-radius: 9px;
    padding: 9px 13px;
    color: #235642;
    background: #eaf5ee;
    overflow-wrap: anywhere;
}
.feedback.error { border-color: #ecc6c7; background: #fff1f1; color: #84212a; }
.access-view { display: grid; min-height: 100dvh; place-items: center; padding: 30px 15px; background: radial-gradient(at 18% 7%, #e1efdf 0%, #f3f6f3 60%); }
.access-card {
    width: min(100%, 454px);
    border: 1px solid var(--edge);
    border-radius: 22px;
    padding: clamp(21px, 5vw, 40px);
    background: var(--surface);
    box-shadow: 0 23px 60px #2f59441a;
}
.access-card .brand { margin-bottom: 29px; }
.access-card .brand small { color: #4d6959; }
.access-card h1 { margin: 7px 0 10px; font-size: clamp(1.85rem, 8vw, 2.65rem); }
.access-lab { margin-top: .5rem; font-size: .81rem; }
.access-card .form { margin: 19px 0 10px; }
.access-card .form > .button { justify-self: stretch; }
.form { display: grid; gap: 7px; }
.form > label:not(:first-child), .form > .button, .form > a { margin-top: 8px; }
.form > .button, .form > a { justify-self: start; }
.profile-form { max-width: 660px; }
.draft-form { display: grid; gap: 16px; margin-top: 22px; max-width: 860px; }
.draft-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.draft-form h2 { margin-bottom: 14px; }
.draft-form label { display: grid; gap: 5px; align-content: start; }
.draft-form .wide { grid-column: 1 / -1; }
.draft-form :is(input, select, textarea) { min-width: 0; width: 100%; }
.draft-week { display: grid; gap: 7px; margin-top: 12px; }
.draft-week > div { display: grid; grid-template-columns: minmax(84px, 1fr) minmax(90px, 1fr) minmax(90px, 1fr); gap: 8px; }
.draft-week .day-toggle { display: flex; align-items: center; align-self: end; gap: 7px; min-height: 42px; }
.draft-week input[type="checkbox"] { width: 17px; height: 17px; accent-color: #186647; }
.draft-week input:disabled { opacity: .55; }
.draft-list:not(:empty) { display: grid; gap: 12px; margin-bottom: 12px; }
.draft-row { min-width: 0; border: 1px solid #d1ded4; border-radius: 9px; padding: 12px; margin: 0; display: grid; gap: 9px; }
.draft-row legend { padding-inline: 5px; font-weight: 650; }
.draft-row .delete-row { justify-self: start; }
.draft-policy { margin-top: 18px; }
.draft-actions { margin: 0; }
.draft-actions .feedback { flex-basis: 100%; }
#scan-dialog { width: min(680px, calc(100% - 24px)); max-height: 90vh; border: 1px solid #a2aeb8;
    border-radius: 12px; padding: 0; color: CanvasText; background: Canvas; }
#scan-dialog::backdrop { background: #172330b0; }
.scan-dialog-content { padding: clamp(12px, 4vw, 24px); }
.scan-preview { position: relative; background: #18212c; margin-block: 10px; }
.scan-preview video { width: 100%; max-height: 46vh; object-fit: contain; display: block; }
.scan-preview canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.scan-list { margin: 8px 0; padding-inline-start: 22px; }
.scan-list li { margin-block: 6px; }
.scan-list img { width: 54px; max-height: 64px; object-fit: contain; vertical-align: middle; margin-inline-end: 8px; }
.scan-list button { margin-inline-start: 8px; }
.archive-path, .archive-create { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-block: 10px; }
.archive-drop { padding: 12px; border: 1px dashed #8b9cad; border-radius: 8px; color: #42586a; }
.archive-drop[data-drag], .archive-folder[data-drag] { outline: 2px solid currentColor; outline-offset: 2px; }
.archive-folder { margin-inline-start: 0 !important; }
#invite-result { display: grid; gap: 5px; margin: 9px 0 0; }
#invite-result .button { justify-self: start; }
.profile-form[aria-readonly="true"] :is(input, textarea) { background: #f3f7f3; }
.icon { position: relative; flex: none; display: inline-grid; place-items: center; width: 16px; height: 16px; line-height: 1; }
.icon-contacts { border: 1.4px solid currentColor; border-radius: 3px; }
.icon-contacts::after { content: ""; width: 7px; height: 6px; margin-top: 5px; border: 1px solid currentColor; border-radius: 60% 60% 2px 2px; }
.icon-contacts::before { content: ""; position: absolute; width: 4px; height: 4px; top: 2px; border-radius: 50%; background: currentColor; }
.icon-profile { height: 13px; margin-top: 3px; border: 1.4px solid currentColor; border-radius: 2px; }
.icon-profile::before { content: ""; position: absolute; top: -4px; width: 7px; height: 3px; border: 1px solid currentColor; border-bottom: 0; border-radius: 2px 2px 0 0; }
.icon-team { font-size: 1.13rem; }
.icon-download::before { content: "↓"; font-size: 1rem; transform: translateY(-2px); }
.icon-download::after { content: ""; position: absolute; bottom: 1px; width: 12px; height: 4px; border: 1px solid currentColor; border-top: 0; border-radius: 0 0 2px 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.no-js { padding: 30px; }

@media (max-width: 1000px) {
    .shell { grid-template-columns: 190px minmax(0, 1fr); }
    .sidebar { padding-inline: 12px; }
    .content { padding-top: 34px; }
    .import-grid { grid-template-columns: minmax(0, 1.38fr) minmax(230px, 1fr); gap: 13px; }
    .card { padding: 18px; }
}
@media (max-width: 829px) {
    .shell { display: block; }
    .sidebar { display: grid; grid-template-columns: auto minmax(100px, 1fr) auto; position: static; height: auto; gap: 11px; padding: 12px 19px; }
    .sidebar > .brand { margin-inline: 0; }
    .workspace { justify-self: end; min-height: 41px; max-width: 240px; padding: 4px 7px; }
    .workspace .avatar, .sidebar-end p { display: none; }
    .sidebar-end { grid-column: 3; grid-row: 1; align-self: center; margin-top: 0; padding: 0; border-top: 0; }
    .sidebar nav { display: flex; flex-wrap: wrap; grid-column: 1 / -1; grid-row: 2; margin: 0; gap: 4px; }
    .nav-item { width: auto; min-height: 36px; padding: 5px 8px; gap: 6px; font-size: .81rem; }
    .topbar { min-height: 51px; }
}
@media (max-width: 620px) {
    .hero { display: grid; gap: 14px; }
    .hero > .button { justify-self: start; }
    .hero p:not(.eyebrow) { font-size: .93rem; }
    .steps { margin-top: 21px; }
    .steps li { gap: 5px; padding-block: 8px; font-size: .74rem; }
    .steps li span { width: 21px; height: 21px; font-size: .66rem; }
    .import-grid { grid-template-columns: minmax(0, 1fr); }
    .guide-card { padding: 16px 18px; }
    .upload-actions .button { flex-grow: 1; }
}
@media (max-width: 420px) {
    .sidebar { padding-inline: 12px; gap: 7px; }
    .sidebar .brand small { display: none; }
    .sidebar .brand strong { font-size: .94rem; }
    .sidebar .brand-mark { width: 34px; height: 34px; }
    .workspace small { font-size: .68rem; }
    .workspace strong { font-size: .75rem; }
    .content { padding-inline: 12px; padding-top: 25px; }
    .card { padding-inline: 14px; }
    .draft-grid { grid-template-columns: minmax(0, 1fr); }
    th, td { min-width: 76px; padding: 7px; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}
