:root {
    --bg: #f5f6f8;
    --card: rgba(255, 255, 255, .94);
    --text: #14161a;
    --muted: #737983;
    --line: #e7e9ed;
    --dark: #15181d;
    --soft: #eef0f3;
    --danger-bg: #fff0f0;
    --danger: #a92e2e;
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

html {
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    color: var(--text);
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 80% 0%, rgba(190, 198, 210, .34), transparent 36%),
        var(--bg);
}

a {
    color: inherit;
}

.shell {
    width: min(1040px, calc(100% - 32px));
    margin: 0 auto;
    padding: 26px 0 70px;
}

.shell.narrow {
    width: min(720px, calc(100% - 32px));
}

.shell.wide {
    width: min(1380px, calc(100% - 32px));
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 54px;
}

.brand {
    text-decoration: none;
    font-weight: 800;
    letter-spacing: -.03em;
    font-size: 20px;
}

.badge,
.small-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .76);
    border-radius: 999px;
    padding: 7px 11px;
    font-size: 12px;
    font-weight: 700;
}

.small-badge {
    padding: 5px 8px;
    font-size: 10px;
    text-transform: uppercase;
}

.hero {
    padding: 72px 0 36px;
}

.hero-copy {
    max-width: 760px;
}

.eyebrow {
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .13em;
    color: var(--muted);
    margin-bottom: 14px;
}

h1 {
    margin: 0;
    font-size: clamp(42px, 7vw, 78px);
    line-height: .98;
    letter-spacing: -.055em;
}

.hero p {
    max-width: 670px;
    margin: 24px 0 0;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.6;
}

.mini-flow {
    margin-top: 34px;
    display: flex;
    gap: 13px;
    flex-wrap: wrap;
    align-items: center;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.mini-flow span {
    padding: 9px 12px;
    border-radius: 999px;
    background: white;
    border: 1px solid var(--line);
}

.mini-flow i {
    font-style: normal;
}

.form-card,
.status-card,
.table-card {
    background: var(--card);
    border: 1px solid rgba(220, 223, 228, .9);
    box-shadow: 0 18px 55px rgba(24, 29, 36, .06);
    border-radius: var(--radius);
}

.form-card {
    padding: clamp(22px, 4vw, 40px);
}

.grid-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.field {
    display: block;
    margin-bottom: 24px;
}

.field > span {
    display: block;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 9px;
}

.field small {
    display: block;
    margin-top: 7px;
    color: var(--muted);
}

input,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 14px;
    padding: 14px 15px;
    font: inherit;
    outline: none;
    transition: .18s ease;
}

input:focus,
textarea:focus {
    border-color: #959ba5;
    box-shadow: 0 0 0 4px rgba(100, 110, 125, .08);
}

textarea {
    resize: vertical;
}

.upload-box {
    border: 1px dashed #bec3ca;
    border-radius: 16px;
    min-height: 138px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    background: #fafbfc;
    transition: .18s ease;
}

.upload-box:hover {
    background: #f4f5f7;
    border-color: #858c96;
}

.upload-box input {
    display: none;
}

.file-info {
    margin-top: 10px;
    color: var(--muted);
    font-size: 13px;
}

.tariffs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.tariff-card {
    cursor: pointer;
}

.tariff-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.tariff-card > div {
    height: 100%;
    border: 1px solid var(--line);
    border-radius: 17px;
    padding: 18px;
    background: #fff;
    transition: .18s ease;
}

.tariff-card input:checked + div {
    border-color: var(--dark);
    box-shadow: inset 0 0 0 1px var(--dark);
}

.tariff-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 17px;
}

.tariff-card p {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.primary,
.secondary {
    min-height: 50px;
    border-radius: 14px;
    border: 0;
    padding: 0 20px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.primary {
    width: 100%;
    color: white;
    background: var(--dark);
}

.primary:hover {
    opacity: .92;
}

.primary:disabled {
    cursor: wait;
    opacity: .55;
}

.secondary {
    background: #fff;
    border: 1px solid var(--line);
}

.link-button {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    margin-top: 12px;
}

.error-box {
    margin-top: 16px;
    border-radius: 13px;
    padding: 14px;
    background: var(--danger-bg);
    color: var(--danger);
    line-height: 1.45;
    word-break: break-word;
}

.hidden {
    display: none !important;
}

.status-card {
    margin-top: 70px;
    padding: clamp(24px, 5vw, 44px);
}

.order-title {
    font-size: clamp(27px, 5vw, 44px);
    word-break: break-word;
}

.status-panel {
    margin: 28px 0;
    min-height: 96px;
    border-radius: 16px;
    padding: 19px;
    background: #f8f9fa;
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 16px;
}

.status-panel strong {
    font-size: 17px;
}

.status-panel p {
    color: var(--muted);
    margin: 6px 0 0;
}

.status-icon {
    font-size: 28px;
}

.loader {
    width: 26px;
    height: 26px;
    border: 3px solid #ddd;
    border-top-color: #222;
    border-radius: 999px;
    animation: spin .8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.story-list {
    margin-top: 24px;
}

.story-list h3 {
    margin: 0 0 12px;
}

.story-row {
    display: grid;
    grid-template-columns: 100px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
}

.muted {
    color: var(--muted);
}

.status-card > .muted {
    margin-top: 20px;
    line-height: 1.5;
}

.admin-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    padding: 58px 0 24px;
}

.admin-head h1 {
    font-size: 54px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.stat {
    background: white;
    border: 1px solid var(--line);
    border-radius: 15px;
    padding: 16px;
}

.stat span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 7px;
}

.stat strong {
    font-size: 20px;
}

.table-card {
    overflow: hidden;
}

.table-scroll {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th,
td {
    padding: 14px 13px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--line);
}

th {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .05em;
    background: #fafafa;
}

tbody tr:hover {
    background: #fafbfc;
}

.tiny-link {
    display: inline-block;
    margin-top: 5px;
    font-size: 11px;
}

.error-mini {
    margin-top: 7px;
    max-width: 320px;
    color: var(--danger);
    font-size: 11px;
    word-break: break-word;
}

@media (max-width: 780px) {
    .grid-two,
    .tariffs {
        grid-template-columns: 1fr;
    }

    .stats {
        grid-template-columns: 1fr 1fr;
    }

    .hero {
        padding-top: 46px;
    }

    .mini-flow i {
        display: none;
    }

    .story-row {
        grid-template-columns: 80px 1fr;
    }

    .story-row .small-badge {
        grid-column: 1 / -1;
    }
}

@media (max-width: 480px) {
    .shell {
        width: min(100% - 20px, 1040px);
        padding-top: 14px;
    }

    .badge {
        display: none;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 42px;
    }
}
