:root {
    color: #18211b;
    background: #f3f6f1;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-synthesis: none;
    --ink: #18211b;
    --muted: #637068;
    --surface: #ffffff;
    --line: #dbe3dc;
    --brand: #155f3d;
    --brand-dark: #0c422a;
    --accent: #dff1e5;
    --danger: #a92d2d;
    --warning: #8a5700;
    --shadow: 0 12px 36px rgba(35, 57, 42, .08);
}

* { box-sizing: border-box; }

html { min-width: 320px; }

body {
    margin: 0;
    min-width: 320px;
    min-height: 100dvh;
    background: linear-gradient(145deg, #edf3eb 0, #f8faf7 42%, #eef4ef 100%);
}

button, input, select, textarea { font: inherit; }

button, a, input, select, textarea { min-height: 44px; }

button { cursor: pointer; }

button:disabled { cursor: wait; opacity: .62; }

:focus-visible { outline: 3px solid #e49e34; outline-offset: 2px; }

.hidden { display: none !important; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: fixed;
    z-index: 20;
    left: 12px;
    top: -60px;
    padding: 10px 14px;
    background: var(--ink);
    color: #fff;
    border-radius: 8px;
}

.skip-link:focus { top: 12px; }

.app-shell { min-height: 100vh; }

.app-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 68px;
    padding: 12px max(18px, calc((100vw - 1180px) / 2));
    color: #fff;
    background: #0e3e27;
}

.brand { font-weight: 760; letter-spacing: -.02em; }

.brand { flex: none; }
.partner-name { min-width: 0; color: #d8ebe0; text-align: right; overflow-wrap: anywhere; }

.app-main {
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: 28px 22px 98px;
}

.app-nav {
    position: fixed;
    z-index: 12;
    bottom: 0;
    left: 0;
    right: 0;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    gap: 8px;
    padding: 8px max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(12px);
	overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scrollbar-color: #7e9585 #edf2ee;
}

.app-nav::-webkit-scrollbar { height: 6px; }
.app-nav::-webkit-scrollbar-track { background: #edf2ee; }
.app-nav::-webkit-scrollbar-thumb { background: #7e9585; border-radius: 3px; }

.nav-link {
    display: grid;
    place-items: center;
    padding: 9px 12px;
    min-height: 44px;
    white-space: nowrap;
    border-radius: 10px;
    color: #4c5c52;
    font-size: 12px;
    font-weight: 650;
    text-decoration: none;
}

.nav-link[aria-current="page"] { color: var(--brand-dark); background: var(--accent); }

.initial-loader, .auth-card, .empty-state, .error-state {
    width: min(520px, 100%);
    margin: 8vh auto 0;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.auth-card h1, .page-title { margin: 0 0 8px; letter-spacing: -.035em; }

.auth-card p, .page-lead, .muted { color: var(--muted); }

.field { display: grid; gap: 6px; margin: 16px 0; font-weight: 650; }

.field input, .field select, .field textarea, .period-control input, .period-control select {
    width: 100%;
    min-width: 0;
    padding: 10px 12px;
    color: var(--ink);
    border: 1px solid #bfcac1;
    border-radius: 10px;
    background: #fff;
}

.button, .button-secondary, .button-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 44px;
    padding: 9px 15px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-weight: 700;
    text-decoration: none;
}

.button { color: #fff; background: var(--brand); }
.button:hover { background: var(--brand-dark); }
.button-secondary { color: var(--brand-dark); background: #fff; border-color: #aabaae; }
.button-danger { color: #fff; background: var(--danger); }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.form-message { min-height: 24px; margin: 12px 0; color: var(--muted); }
.form-message[role="alert"], .error-text { color: var(--danger); }
.success-text { color: var(--brand); }

.page-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 20px; }

.suspension-banner, .timezone-warning {
    margin: 0 0 18px;
    padding: 12px 14px;
    border: 1px solid #e5bd6f;
    border-radius: 12px;
    color: #664000;
    background: #fff7e5;
}

.self-employment-callout {
    display: grid;
    gap: 14px;
    margin: 0 0 18px;
    padding: 18px;
    border: 1px solid #8ebc99;
    border-radius: 16px;
    background: #edf8ef;
    box-shadow: 0 7px 24px rgba(42, 66, 48, .08);
}
.self-employment-callout strong { display: block; margin-bottom: 7px; font-size: 19px; color: var(--brand-dark); }
.self-employment-callout p { max-width: 78ch; margin: 0 0 7px; line-height: 1.5; }
.self-employment-callout p:last-child { margin-bottom: 0; }
.self-employment-guide { max-width: 820px; }
.self-employment-guide > p, .onboarding-steps { max-width: 74ch; }
.onboarding-path { padding: 10px 12px; border-left: 3px solid var(--brand); border-radius: 8px; font-weight: 700; background: #f5f7f4; }
.onboarding-steps { display: grid; gap: 10px; padding-left: 22px; line-height: 1.5; }

.period-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    gap: 12px;
    margin: 18px 0 22px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, .82);
}

.preset-row { display: flex; flex-wrap: wrap; gap: 9px; }
.period-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.preset-row button { min-height: 44px; padding: 7px 13px; border: 1px solid #b7c4b9; border-radius: 999px; background: #fff; }
.preset-row button[aria-pressed="true"] { color: #fff; background: var(--brand); border-color: var(--brand); }
.period-control { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; font-size: 13px; font-weight: 650; }
.period-actions { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.period-actions .form-message { margin: 0; min-height: 0; }
.period-actions .form-message:empty { display: none; }
.period-summary { overflow-wrap: anywhere; margin: 0; color: var(--muted); font-size: 13px; }

.section-grid, .metric-grid, .link-list { display: grid; gap: 16px; }
.section-grid { grid-template-columns: 1fr; }
.metric-grid { grid-template-columns: 1fr; }

.section-card, .metric-card, .link-card, .session-card {
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: 0 7px 24px rgba(42, 66, 48, .055);
}

.section-card h2, .link-card h2, .session-card h2 { margin: 0 0 12px; font-size: 19px; }
.clipper-next { margin-bottom: 18px; padding: 20px; border: 1px solid #8ebc99; border-radius: 16px; background: #edf8ef; box-shadow: 0 7px 24px rgba(42, 66, 48, .08); }
.clipper-next h2 { margin: 5px 0 8px; font-size: clamp(22px, 4vw, 30px); }
.clipper-next p { max-width: 74ch; margin: 0; line-height: 1.55; }
.clipper-kicker { color: var(--brand); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.clipper-grid, .clipper-lessons { display: grid; gap: 16px; }
.clipper-grid { grid-template-columns: 1fr; }
.clipper-lessons { margin-top: 16px; }
.clipper-lesson { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfa; }
.clipper-lesson h3 { margin: 8px 0; font-size: 17px; }
.clipper-lesson p { margin: 0 0 12px; line-height: 1.5; }
.clipper-lesson-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.clipper-unavailable { margin: 14px 0 0; padding: 12px; border-radius: 10px; color: #664000; background: #fff7e5; }
.clipper-rules-card summary { min-height: 44px; cursor: pointer; font-size: 19px; font-weight: 700; }
.clipper-rules, .clipper-workflow { display: grid; gap: 10px; padding-left: 22px; line-height: 1.5; }
.clipper-workflow { margin-bottom: 0; }
.clipper-marking { border-style: dashed; }
.clipper-marking .status { margin-bottom: 10px; }
.clipper-empty { width: 100%; margin: 0; box-shadow: none; }
.clipper-video { display: grid; gap: 8px; }
.clipper-video-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 10px; background: #111; }
.clipper-video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.clipper-video-fallback { font-size: 13px; font-weight: 700; }
.clipper-work-button { margin-top: 16px; }
.clipper-video-workspace, .clipper-video-list { display: grid; gap: 16px; }
.clipper-video-form { max-width: 780px; }
.clipper-video-card { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 7px 24px rgba(42, 66, 48, .055); }
.clipper-video-card h2 { min-width: 0; margin: 0; font-size: 19px; overflow-wrap: anywhere; }
.clipper-video-details { margin: 14px 0; }
.clipper-video-details dd { word-break: break-word; }
.clipper-video-preview { display: block; width: 100%; max-height: 440px; margin-top: 14px; border-radius: 12px; background: #111; }
.clipper-video-ready { padding: 12px 14px; border-radius: 10px; color: #105635; background: #dff1e5; line-height: 1.5; }
.clipper-video-actions { margin-top: 14px; }
.clipper-video-empty { width: 100%; margin: 0; }
.status-ready_for_marking { color: #105635; background: #dff1e5; }
.metric-label { display: block; color: var(--muted); font-size: 13px; }
.metric-value { display: block; margin-top: 5px; font-size: clamp(24px, 5vw, 34px); font-weight: 760; letter-spacing: -.035em; overflow-wrap: anywhere; hyphens: auto; }
.metric-note { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.negative { color: var(--danger); }

.skeleton { position: relative; overflow: hidden; min-height: 92px; background: #eef2ed; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.72), transparent); animation: shimmer 1.35s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

.series-bars { display: grid; grid-template-columns: repeat(var(--points), minmax(0, 1fr)); column-gap: min(3px, calc(100% / var(--points) / 4)); align-items: end; height: 150px; padding-top: 12px; }
.series-bar { min-height: 2px; border-radius: 4px 4px 0 0; background: #4e9a6b; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 10px 8px; border-bottom: 1px solid #edf0ed; text-align: left; vertical-align: top; }
.data-table th { color: var(--muted); font-size: 12px; }

.status { display: inline-flex; min-height: 28px; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #edf0ed; }
.status-active { color: #105635; background: #dff1e5; }
.status-inactive, .status-revoked { color: #7a350f; background: #ffeadb; }
.status-draft { color: #4b5563; background: #edf0ed; }
.status-submitted { color: #664000; background: #fff0c7; }
.status-approved { color: #105635; background: #dff1e5; }
.status-needs_changes { color: #7a350f; background: #ffeadb; }
.legal-profile-form { max-width: 760px; }

.link-url { overflow-wrap: anywhere; }
.link-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.link-metric { min-width: 0; padding: 10px; border-radius: 10px; background: #f5f7f4; }
.link-metric dt { color: var(--muted); font-size: 12px; }
.link-metric dd { margin: 3px 0 0; font-weight: 720; overflow-wrap: anywhere; hyphens: auto; }

.definition-list { display: grid; grid-template-columns: minmax(110px, 190px) 1fr; gap: 10px 16px; }
.definition-list dt { color: var(--muted); }
.definition-list dd { margin: 0; overflow-wrap: anywhere; }

.load-more { margin-top: 14px; }

.wizard-card { width: min(720px, 100%); overflow-wrap: anywhere; }
.wizard-progress { margin: 0 0 4px; color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.wizard-title { margin: 0 0 10px; letter-spacing: -.035em; }
.wizard-title:focus { outline: none; }
.wizard-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.wizard-summary { padding: 10px 12px; border-radius: 10px; background: #f5f7f4; }

.kind-choice { display: grid; gap: 10px; margin: 18px 0; padding: 0; border: 0; min-width: 0; }
.kind-choice legend { margin-bottom: 8px; padding: 0; font-weight: 700; }
.kind-option { display: flex; gap: 12px; align-items: flex-start; min-height: 44px; padding: 12px 14px; border: 1px solid #c7d2c9; border-radius: 12px; background: #fff; cursor: pointer; }
.kind-option:has(input:checked) { border-color: var(--brand); background: #f1f9f4; box-shadow: inset 0 0 0 1px var(--brand); }
.kind-option input { flex: none; width: 20px; height: 20px; min-height: 0; margin: 2px 0 0; accent-color: var(--brand); }
.ip-tax-choice { grid-column: 1 / -1; }
.ip-tax-option { display: grid; grid-template-columns: minmax(0, 1fr) 44px; column-gap: 8px; align-items: start; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; }
.ip-tax-option:has(input:checked) { border-color: var(--brand); background: #f1f9f4; }
.ip-tax-info { display: grid; place-items: center; width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--brand); }
.ip-tax-info span { display: grid; place-items: center; width: 22px; height: 22px; border: 1.5px solid currentColor; border-radius: 50%; font-weight: 700; font-family: Georgia, serif; }
.ip-tax-explanation { grid-column: 1 / -1; margin: 6px 0 4px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.ip-tax-guide summary { cursor: pointer; min-height: 44px; padding: 10px 0; color: var(--brand); text-decoration: underline; }
.ip-tax-guide ol { margin: 6px 0; padding-left: 24px; }
.ip-tax-guide li + li { margin-top: 10px; }
.kind-text { display: grid; gap: 2px; min-width: 0; }
.kind-hint { color: var(--muted); font-size: 13px; }

.country-picker { display: grid; gap: 6px; margin: 18px 0 8px; min-width: 0; }
.country-label { font-weight: 700; }
.country-picker input { width: 100%; min-width: 0; padding: 10px 12px; color: var(--ink); border: 1px solid #bfcac1; border-radius: 10px; background: #fff; }
.country-list { max-height: min(16rem, 40dvh); margin: 0; padding: 4px; overflow-y: auto; overscroll-behavior: contain; list-style: none; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.country-option { display: flex; justify-content: space-between; gap: 12px; align-items: center; min-height: 44px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.country-option:hover, .country-option.active { background: var(--accent); }
.country-option[aria-selected="true"] { font-weight: 700; }
.country-name { min-width: 0; overflow-wrap: anywhere; }
.country-code { flex: none; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.country-empty { margin: 0; }

.contract-head { margin-bottom: 10px; }
.contract-title { margin: 0; font-size: 19px; overflow-wrap: anywhere; }
.contract-version { margin: 4px 0 0; font-size: 13px; }
.contract-body { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfa; overflow-wrap: anywhere; line-height: 1.55; font-size: 15px; }
.contract-body p { margin: 0 0 10px; }
.contract-body h2 { margin: 18px 0 8px; font-size: 16px; line-height: 1.35; }
.contract-body h2.document-part { margin-top: 28px; padding-top: 14px; border-top: 2px solid var(--line); font-size: 18px; }
.contract-body p.clause { padding-left: 3em; text-indent: -3em; }
.contract-body .clause-number { display: inline-block; min-width: 3em; text-indent: 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.contract-body table { width: 100%; border-collapse: collapse; margin: 6px 0 12px; }
.contract-body th, .contract-body td { text-align: left; vertical-align: top; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.contract-tools { margin-top: 10px; }
.contract-changed { margin: 0 0 14px; padding: 12px 14px; border: 1px solid #e5bd6f; border-radius: 12px; color: #664000; background: #fff7e5; }
.consent { display: flex; gap: 12px; align-items: flex-start; margin-top: 16px; padding: 12px 14px; border: 1px solid #c7d2c9; border-radius: 12px; background: #fff; font-weight: 650; cursor: pointer; }
.consent input { flex: none; width: 22px; height: 22px; min-height: 0; margin: 1px 0 0; accent-color: var(--brand); }
.party-form { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 20px; }
.party-form .field { margin: 10px 0; }
.field-hint { font-weight: 400; font-size: 14px; }
.field-error { color: #b42318; font-weight: 600; font-size: 14px; }
.field input[aria-invalid="true"], .field select[aria-invalid="true"] { border-color: #b42318; }
.party-flag { margin-top: 8px; }
.contract-body.terms-body { max-height: none; margin-bottom: 18px; }
.terms-body td:first-child { width: 42%; color: var(--muted); }
@media (min-width: 760px) {
    .party-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .party-form .field:first-child, .party-form .party-flag, .party-form .form-message, .party-form .wizard-actions { grid-column: 1 / -1; }
}

.primary-link-card { margin-bottom: 18px; border-color: #9fcdb1; background: linear-gradient(180deg, #f3fbf6, #fff 60%); }
.primary-link-url { margin: 0 0 14px; padding: 12px 14px; border: 1px dashed #9fcdb1; border-radius: 12px; background: #fff; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; overflow-wrap: anywhere; word-break: break-all; user-select: all; }
.primary-copy { min-width: 190px; }
.primary-copy[data-copy-state="copied"] { background: var(--brand-dark); }
.copy-message:empty { display: none; }
.inline-error { width: 100%; margin: 0; box-shadow: none; }
.link-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.status-primary { color: #fff; background: var(--brand); }
.link-card-primary { border-color: #9fcdb1; }
.link-card-inactive { opacity: .78; }

.creative-layout { display: grid; gap: 18px; }
.creative-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.creative-card { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 7px 24px rgba(42, 66, 48, .055); }
.creative-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.creative-card h2 { min-width: 0; margin: 0; font-size: 19px; overflow-wrap: anywhere; }
.creative-date { margin: 8px 0 14px; color: var(--muted); font-size: 13px; }
.creative-problem { margin: 12px 0; padding: 10px 12px; border-radius: 10px; color: #664000; background: #fff7e5; }
.creative-problem[role="alert"] { color: #7a350f; background: #ffeadb; }
.creative-erid-box { margin: 14px 0; padding: 12px 14px; border: 1px solid #cbd5e1; border-radius: 12px; background: #f8fafc; }
.creative-erid { display: block; margin-top: 5px; font-size: 16px; overflow-wrap: anywhere; user-select: all; }
.creative-erid-box p { margin: 8px 0 0; }
.creative-progress { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); }
.creative-actions { margin-top: 14px; }
.creative-empty, .creative-error { width: 100%; margin: 0; }
.creative-skeleton { min-height: 180px; }
.status-pending { color: #4b5563; background: #edf0ed; }
.status-processing, .status-reconciling { color: #664000; background: #fff0c7; }
.status-ready { color: #105635; background: #dff1e5; }
.status-failed { color: #7a350f; background: #ffeadb; }

@media (min-width: 620px) {
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .link-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .period-panel { grid-template-columns: 1fr; }
	.clipper-lessons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.creative-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.clipper-video-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 900px) {
    .app-main { padding-bottom: 42px; }
    .app-nav { position: sticky; top: 68px; bottom: auto; width: min(1180px, calc(100% - 44px)); margin: 0 auto; padding: 8px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 14px 14px; grid-auto-columns: max-content; }
    .nav-link { font-size: 14px; }
    .metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .section-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .section-grid .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.clipper-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.clipper-wide { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
    .app-header { min-height: 58px; padding: 10px 14px; --mobile-header-min-height: 58px; --mobile-header-padding: 10px; --mobile-header-inline: 14px; }
    .partner-name { max-width: 50%; font-size: 13px; }
    .app-main { padding: 20px 14px 94px; }
	.app-nav { grid-auto-columns: max-content; }
    .page-head { align-items: start; flex-direction: column; }
    .auth-card { margin-top: 3vh; padding: 20px; }
    .wizard-card { margin-top: 0; }
    .wizard-actions { position: sticky; bottom: 0; margin: 18px -20px -20px; padding: 12px 20px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); border-radius: 0 0 18px 18px; background: rgba(255, 255, 255, .97); }
    body.picker-open .wizard-actions { position: static; margin: 18px 0 0; padding: 0; border-top: 0; background: none; }
    .wizard-actions .button, .wizard-actions .button-secondary { flex: 1 1 140px; }
    .contract-body { padding: 12px; font-size: 15px; }
    .primary-link-actions > * { flex: 1 1 100%; }
    .definition-list { grid-template-columns: 1fr; gap: 3px; }
    .definition-list dd { margin-bottom: 9px; }
    .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
    .data-table thead { display: none; }
    .data-table tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
    .data-table td { display: grid; grid-template-columns: minmax(0, 44%) minmax(0, 1fr); gap: 8px; padding: 5px 0; border: 0; }
    .data-table td::before { content: attr(data-label); color: var(--muted); font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.contract-summary dd.contract-hash { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; word-break: break-all; }
.contract-card { margin-bottom: 20px; }
.contract-card .contract-body { max-height: none; }
.candidate-card { display: grid; gap: 12px; justify-items: start; }
.candidate-card p { max-width: 70ch; margin: 0; }
.candidate-card h2 { margin: 0; }
.candidate-reported { color: var(--brand); font-weight: 600; }
.candidate-offer { margin-bottom: 12px; }

.link-button { padding: 0; color: var(--link, #2f5aa8); font: inherit; text-decoration: underline; background: none; border: 0; cursor: pointer; }
.link-button:hover { text-decoration: none; }
.owner-email { overflow-wrap: anywhere; }
.toast { margin: 12px 0 0; padding: 10px 12px; color: var(--ink); border-left: 3px solid var(--brand); border-radius: 8px; background: #f5f7f4; }

.npd-slot:empty { display: none; }
.npd-choice { display: grid; gap: 8px; margin: 18px 0 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfa; }
.npd-legend { display: flex; align-items: center; gap: 8px; padding: 0; font-weight: 700; }
.npd-option { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.npd-option input { width: 20px; height: 20px; min-height: 20px; flex: none; }
.help-trigger { min-height: 32px; min-width: 32px; padding: 0 6px; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--brand); font-size: 15px; line-height: 1; }
.help-panel { display: grid; gap: 10px; justify-items: start; margin-top: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.help-panel p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }

.password-field { min-width: 0; }
.password-row { display: flex; gap: 8px; align-items: stretch; min-width: 0; }
.password-row input { flex: 1 1 auto; min-width: 0; }
.password-eye { flex: none; width: 48px; border: 1px solid #bfcac1; border-radius: 10px; background: #fff; font-size: 16px; }
.password-eye[aria-pressed="true"] { background: var(--accent); }
.login-line { margin: 0 0 14px; font-weight: 700; overflow-wrap: anywhere; }

.links-cta .button { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.placement-form { display: grid; gap: 4px; }
.contract-technical { margin-top: 16px; }
.contract-technical summary { min-height: 44px; display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 700; list-style: none; }
.contract-technical summary::-webkit-details-marker { display: none; }
.contract-technical summary::before { content: "▸"; color: var(--brand); font-size: 13px; }
.contract-technical[open] summary::before { content: "▾"; }
.contract-technical .definition-list { margin-top: 8px; }

.npd-choice .help-trigger { min-height: 44px; padding: 8px 12px; border-radius: 8px; line-height: 1.4; text-align: left; }

.button, .button-secondary, .button-danger { transition: background-color 120ms ease, box-shadow 120ms ease, transform 120ms ease; }
.button-secondary:hover { background: #eef5ef; box-shadow: 0 2px 6px rgba(35, 57, 42, .12); }
.button-danger:hover { background: #8a2424; }
.button:active:not(:disabled), .button-secondary:active:not(:disabled), .button-danger:active:not(:disabled) { transform: translateY(1px); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .12); }
button:disabled { cursor: not-allowed; box-shadow: none; transform: none; }
button[aria-busy="true"] { cursor: progress; }
.checkbox-field { display: flex; align-items: flex-start; gap: 10px; margin: 16px 0; min-height: 44px; padding: 10px 0; line-height: 1.5; cursor: pointer; }
input[type="checkbox"] { width: 18px; height: 18px; min-height: 18px; flex: 0 0 18px; margin: 3px 0 0; padding: 0; accent-color: var(--brand); }
.time-note { display: flex; align-items: center; gap: 8px; color: var(--muted); }

.section-card > .button-row, .preview-document-link { margin: 16px 0; }
.preview-document .contract-body { max-height: none; }
.link-card { scroll-margin: 100px 0; transition: background-color 150ms ease, box-shadow 150ms ease; }
.link-card-created { background: #edf8f0; box-shadow: 0 0 0 2px var(--brand); }
@media (prefers-reduced-motion: reduce) {
    .button, .button-secondary, .button-danger, .link-card { transition: none; }
    .button:active:not(:disabled), .button-secondary:active:not(:disabled), .button-danger:active:not(:disabled) { transform: none; }
}

select { appearance: none; padding: 10px 42px 10px 12px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 20 20'%3E%3Cpath d='m5 7 5 5 5-5' fill='none' stroke='%23546b60' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center / 18px; }
.field select, .period-control select { padding-right: 42px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 20 20'%3E%3Cpath d='m5 7 5 5 5-5' fill='none' stroke='%23546b60' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; }
.quick-setup { display: flex; gap: 12px; padding: 14px 16px; margin: 14px 0; border-radius: 12px; background: #f0f6ed; color: #284536; }
.quick-setup p { margin: 4px 0 0; }
.bolt-icon { display: inline-block; width: 20px; height: 24px; flex: 0 0 20px; background: currentColor; clip-path: polygon(58% 0, 12% 56%, 46% 56%, 38% 100%, 88% 39%, 54% 39%); }
.status-change-panel { border-color: #adc5b3; }
.payout-checklist { list-style: none; padding: 0; }
.payout-checklist li { margin: 10px 0; }
.payout-identity-summary dd { overflow-wrap: anywhere; }
#payout-details, #status-change-heading { scroll-margin-top: 84px; }
#payout-recipient[readonly] { background: #f0f4f0; }
@media (min-width: 900px) { #payout-details, #status-change-heading { scroll-margin-top: 140px; } }
@media (forced-colors: active) { select, .field select, .period-control select { appearance: auto; background-image: none; } }

[hidden] { display: none !important; }

.status-loss-disclosure { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
#payout-details form > details { margin: 18px 0 24px; }
.period-panel, .period-fields, .period-date { min-width: 0; max-width: 100%; }
.period-date { display: block; position: relative; width: 100%; contain: inline-size; }
.period-date input[type="date"] { display: block; width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; min-height: 44px; font-size: 16px; padding-right: 40px; appearance: none; -webkit-appearance: none; }
.period-date input::-webkit-date-and-time-value { min-width: 0; max-width: 100%; text-align: left; }
.period-date input::-webkit-calendar-picker-indicator { opacity: 0; }
.date-icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; pointer-events: none; background: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 24 24' fill='none' stroke='%23546b60' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M16 3v4M8 3v4M3 11h18'/%3E%3C/svg%3E") center / contain no-repeat; }
@media (max-width: 640px) { .period-fields { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 899px) {
    html, body { height: 100%; width: 100%; overflow: hidden; }
    body { min-height: 0; }
    .app-shell {
        height: 100vh;
        height: 100dvh;
        min-height: 0;
        display: grid;
        grid-template-rows: auto minmax(0, 1fr) auto;
        grid-template-columns: minmax(0, 1fr);
        overflow: hidden;
    }
    body.keyboard-open .app-shell { height: var(--partner-keyboard-height, 100dvh); }
    .app-header {
        position: static;
        top: auto;
        grid-row: 1;
        min-width: 0;
        min-height: calc(var(--mobile-header-min-height, 68px) + env(safe-area-inset-top));
        padding: calc(var(--mobile-header-padding, 12px) + env(safe-area-inset-top)) max(var(--mobile-header-inline, 18px), env(safe-area-inset-right)) var(--mobile-header-padding, 12px) max(var(--mobile-header-inline, 18px), env(safe-area-inset-left));
    }
    .app-main {
        grid-row: 2;
        min-height: 0;
        min-width: 0;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 28px;
    }
    .app-nav { position: static; grid-row: 3; min-width: 0; }
    body.keyboard-open .app-nav { display: none; }
    .field input, .field select, .field textarea { font-size: 16px; }
}

.creative-filters { display: flex; gap: 8px; flex-wrap: wrap; min-width: 0; }
.creative-filters button { min-height: 44px; }
.creative-filters button[aria-pressed="true"] { border-color: var(--accent); background: #eaf5ed; }
.creative-preview { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 12em; overflow: auto; }
.creative-card .muted { overflow-wrap: anywhere; }
.creative-placement { margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; overflow-wrap: anywhere; }
.creative-placement a { overflow-wrap: anywhere; }
.creative-placement-form { display: grid; gap: 12px; margin-top: 14px; min-width: 0; }
.creative-placement-form input { max-width: 100%; }
.creative-correction-form { display: grid; gap: 12px; margin-top: 14px; min-width: 0; }
.creative-correction-form input, .creative-correction-form textarea { max-width: 100%; }
.creative-restore-label { display: flex; align-items: center; gap: 8px; }
.creative-card-head .status { flex-shrink: 0; }
.creative-form { min-width: 0; }
.creative-form textarea, .creative-form input, .creative-form select { max-width: 100%; }
@media (max-width: 480px) {
    .creative-card-head { flex-direction: column; }
    .creative-filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
    .creative-filters button { flex: 0 0 auto; }
}

.placement-platforms { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin: 16px 0 24px; }
.placement-platform[aria-pressed="true"] { border-color: var(--accent, #ffd375); background: var(--brand); color: #fff; }
.placement-components { border: 0; padding: 0; margin: 24px 0; min-width: 0; }
.placement-component { display: flex; gap: 12px; align-items: flex-start; margin: 14px 0; }
.placement-component input { flex: 0 0 auto; width: 20px; height: 20px; }
.placement-component .field-hint { display: block; margin-top: 6px; }
.placement-summary { font-weight: 600; overflow-wrap: anywhere; }
.placement-picker select { width: 100%; min-width: 0; }
@media (max-width: 480px) { .placement-platforms { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.manual-metrics { margin-block: 1rem; border-top: 1px solid var(--border, #ddd); padding-top: .75rem; }
.manual-metric-form { display: grid; gap: .75rem; margin-block: 1rem; max-width: 42rem; }
.manual-metric-form .field { display: grid; gap: .4rem; }
.manual-metric-form input, .manual-metric-form textarea { width: 100%; min-width: 0; box-sizing: border-box; }
.manual-metric-observation { padding-block: .75rem; border-bottom: 1px solid var(--border, #ddd); overflow-wrap: anywhere; }

.first-steps-list { padding-left: 1.4rem; margin: 0; display: grid; gap: .45rem; }
.first-steps-list li { overflow-wrap: anywhere; }
.first-steps-list p { margin: .35rem 0; }
.first-steps .button-secondary { margin-bottom: .35rem; }

.partner-task { padding: 14px 0; border-top: 1px solid var(--border-color, #e2e8f0); overflow-wrap: anywhere; }
.partner-task h3 { margin: 0 0 8px; }
.video-slot { min-width: 0; }
[id^="creative-"], [id^="placement-"] { scroll-margin-top: 90px; }

.quick-start-link { display: block; margin-top: 12px; }
.cooperation-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.contract-body + .contract-body { margin-top: 20px; }
details:not(.clipper-rules-card):not(.contract-technical) { margin-block: 14px; padding: 0 14px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
details:not(.clipper-rules-card):not(.contract-technical):not([open]) { padding-bottom: 0; }
details:not(.clipper-rules-card):not(.contract-technical) > summary { display: flex; align-items: center; gap: 12px; min-height: 48px; padding-block: 12px; list-style: none; cursor: pointer; font-weight: 700; transition: color .16s, background .16s; }
details:not(.clipper-rules-card):not(.contract-technical) > summary::-webkit-details-marker { display: none; }
details:not(.clipper-rules-card):not(.contract-technical) > summary::after { content: "›"; margin-left: auto; font-size: 24px; line-height: 1; transition: transform .16s; }
details[open]:not(.clipper-rules-card):not(.contract-technical) > summary::after { transform: rotate(90deg); }
details:not(.clipper-rules-card):not(.contract-technical) > summary:hover { color: var(--brand); background: #f5f9f5; }
details:not(.clipper-rules-card):not(.contract-technical) > summary:active { background: var(--accent); }
details[open]:not(.clipper-rules-card):not(.contract-technical) > :not(summary) { animation: disclosure-reveal .16s ease-out; }
@keyframes disclosure-reveal { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 899px) {
    html:has(body.auth-page), body.auth-page, html:has(.preview-document), body:has(.preview-document) { height: auto; min-height: 100svh; overflow: visible; }
    body.auth-page .app-shell { display: block; height: auto; min-height: 100svh; overflow: visible; }
    .app-main.preview-document { overflow: visible; }
    body.auth-page .app-main { overflow: visible; padding-bottom: max(32px, env(safe-area-inset-bottom)); }
    body.auth-page .auth-card { margin-top: 16px; }
}

.creative-marking-text { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; user-select: all; }
.creative-marking-link { overflow-wrap: anywhere; user-select: all; }
.creative-instructions { margin: 16px 0; }
.creative-publication-form { display: grid; gap: 12px; margin-top: 16px; }

.creative-marking-group { display: grid; gap: 8px; margin: 18px 0; min-width: 0; }
.creative-marking-group h4, .creative-marking-group pre { margin: 0; }
.creative-erid-box .button-row { margin-top: 20px; gap: 12px; }
.creative-marking-group .creative-erid { margin: 0; }
.creative-publication-form input { width: 100%; min-width: 0; box-sizing: border-box; }
.creative-publication-form a { overflow-wrap: anywhere; }

.bot-card { margin-top: 16px; }
.bot-card .bot-title { display: flex; align-items: center; gap: 12px; }
.bot-icon { flex: 0 0 24px; color: var(--brand-dark); }

.app-nav { scroll-padding-inline: 42px; }
.nav-scroll { position: sticky; left: 0; z-index: 1; display: grid; place-items: center; width: 28px; min-height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--brand-dark); font-size: 24px; cursor: pointer; }
.nav-scroll-forward { left: auto; right: 0; }

.country-picker input[aria-invalid="true"] { border: 2px solid #b42318; }
.npd-choice { min-width: 0; }
.npd-legend { display: block; max-width: 100%; padding: 0 6px; line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }
.wizard-form input, .country-picker input { scroll-margin-block: 100px; }
@media (max-width: 600px) {
    .wizard-actions { position: static; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
    .wizard-card { padding-bottom: max(20px, env(safe-area-inset-bottom)); }
}

.commission-explanation > summary { cursor: pointer; font-weight: 700; min-height: 44px; }
.monthly-acts { margin-block: 20px; }
.cooperation-next { margin-block: 12px; }
.partner-tasks .cooperation-next { padding: 0; border: 0; box-shadow: none; }

.statement-publication { overflow-wrap: anywhere; word-break: break-word; }
.contract-card .data-table td { white-space: normal; overflow-wrap: anywhere; }

@media (max-width: 760px) {
    .contract-card .data-table td { grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 9px 0; }
}

#advertising-resources article,
#advertising-resources h3 {
    min-width: 0;
    overflow-wrap: anywhere;
}

.creative-url, .draft-recovery { overflow-wrap: anywhere; min-width: 0; }

.payout-screen > .section-card + .section-card { margin-top: 18px; }
.bot-status-actions { margin: 18px 0; }
.bot-card .button + .button-secondary { margin-left: 10px; }
.bot-card [role="status"] > .button { margin: 8px 0; }
.resource-empty { margin: 14px 0; }
#advertising-resources > details { margin-top: 14px; }
.creative-empty { margin: 16px 0 0; }
.video-slot { overflow-wrap: anywhere; }
.payout-screen a, #advertising-resources a, .bot-card a { overflow-wrap: anywhere; }

.creative-list { align-items: start; }
.creative-card { align-self: start; min-width: 0; overflow-wrap: anywhere; }
.creative-tabs { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.creative-success::backdrop { background: rgba(0,0,0,.6); }
.creative-success { max-width: min(440px,90vw); border: 0; border-radius: 16px; padding: 28px; }
.creative-success-mark { color: #167844; font-size: 44px; }

.creative-tabs [aria-selected="true"]{background:var(--accent,#146b48);color:#fff;border-color:var(--accent,#146b48)}

.finance-empty { display: grid; min-height: 140px; place-items: center; text-align: center; padding: 24px; }
.creative-tabs [aria-selected="true"], .creative-filters [aria-pressed="true"], .placement-platform[aria-pressed="true"] { color: #142f23; background: #d8ebde; border: 2px solid #315c43; box-shadow: inset 0 -3px 0 #315c43; font-weight: 700; }
.creative-tabs button:hover, .creative-filters button:hover, .placement-platform:not(:disabled):hover { border-color: #315c43; color: #142f23; }
.creative-tabs button:focus-visible, .creative-filters button:focus-visible, .placement-platform:focus-visible { outline: 3px solid #315c43; outline-offset: 3px; }
.placement-platform:disabled { opacity: .55; cursor: not-allowed; border-style: dashed; }
.help-contact-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; margin-bottom: 20px; }
.help-contact-actions > div { min-width: 0; }
.help-contact-actions .button, .help-contact-actions .button-secondary { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 56px; white-space: normal; text-align: center; }
.help-email-dialog { width: min(480px, calc(100% - 32px)); max-height: calc(100dvh - 40px); overflow-y: auto; border: 1px solid #315c43; border-radius: 18px; padding: 24px; color: #142f23; background: #fff; }
.help-email-dialog::backdrop { background: rgb(12 27 20 / .5); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.help-email-address { overflow-wrap: anywhere; font-size: 1.15rem; }
.back-to-top { position: fixed; z-index: 11; right: max(18px, env(safe-area-inset-right)); bottom: calc(96px + env(safe-area-inset-bottom)); display: inline-flex; gap: 7px; align-items: center; min-height: 44px; padding: 10px 14px; border: 1px solid #315c43; border-radius: 24px; color: #142f23; background: #fff; box-shadow: 0 2px 10px rgb(0 0 0 / .12); }
.back-to-top[hidden] { display: none; }
.legal-refresh { margin-block: 18px; }
@media (max-width: 480px) { .help-contact-actions { grid-template-columns: minmax(0, 1fr); } .help-email-dialog { padding: 20px; } }

.partner-name:hover { color: #fff; }
.partner-name:focus-visible { outline: 2px solid #fff; outline-offset: 4px; border-radius: 4px; }
