* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande", sans-serif;
    background: #f8f5ef;
    color: #1f2937;
}

.shell {
    min-height: 100vh;
}

.workspace {
    display: grid;
    grid-template-columns: 16rem 1fr;
    min-height: calc(100vh - 64px);
}

.sidebar {
    border-right: 1px solid #cbd5e1;
    background: #ffffff;
    padding: 1rem;
}

.navmenu {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.navmenu a {
    color: #1e293b;
    text-decoration: none;
    padding: 0.45rem 0.5rem;
    border-radius: 0.35rem;
}

.navmenu a.active {
    background: #dbeafe;
    color: #1d4ed8;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #d6d3d1;
    background: #fffdf8;
}

.brand {
    font-weight: 700;
    letter-spacing: 0.02em;
    font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
}

.session-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    border-radius: 999px;
    padding: 0.32rem 0.72rem;
    font-size: 0.82rem;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #0f172a;
    white-space: nowrap;
}

.session-chip-title {
    font-weight: 700;
}

.session-chip-address {
    font-family: Consolas, "Courier New", monospace;
}

.session-chip-chain {
    color: #475569;
}

.session-chip-wallet {
    border-color: #93c5fd;
    background: #eff6ff;
}

.session-chip-operator {
    border-color: #a7f3d0;
    background: #ecfdf5;
}

.content {
    padding: 1.5rem 1.25rem;
    max-width: 70rem;
    margin: 0 auto;
}

.content-public {
    max-width: 70rem;
    margin: 0 auto;
    padding: 2.4rem 1.25rem 3rem;
}

@media (max-width: 900px) {
    .topbar {
        flex-wrap: wrap;
    }

    .workspace {
        grid-template-columns: 1fr;
    }

    .sidebar {
        border-right: none;
        border-bottom: 1px solid #cbd5e1;
    }
}

form {
    display: grid;
    gap: 0.75rem;
    max-width: 22rem;
}

label {
    font-weight: 600;
}

input,
button {
    padding: 0.6rem 0.75rem;
    border-radius: 0.35rem;
    border: 1px solid #94a3b8;
}

button {
    background: #0f172a;
    color: #fff;
    border: none;
    cursor: pointer;
}

.error {
    color: #b91c1c;
    font-weight: 600;
}

.jobs-toolbar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.jobs-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.jobs-table th,
.jobs-table td {
    border: 1px solid #e2e8f0;
    text-align: left;
    padding: 0.6rem;
    font-size: 0.9rem;
}

.jobs-table th {
    background: #f1f5f9;
}

.state-pill {
    display: inline-block;
    background: #e2e8f0;
    color: #0f172a;
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    font-size: 0.8rem;
}

.state-pill.state-submitted {
    background: #fef3c7;
    color: #92400e;
}

.state-pill.state-paid {
    background: #d1fae5;
    color: #065f46;
}

.state-pill.state-in_progress {
    background: #dbeafe;
    color: #1e40af;
}

.badge-action-required {
    display: inline-block;
    background: #ef4444;
    color: #fff;
    border-radius: 999px;
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.4rem;
    vertical-align: middle;
}

.action-required-banner {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.action-required-banner a {
    margin-left: 0.5rem;
    color: #1d4ed8;
}

.row-action-required {
    background: #fffbeb;
}

.pager {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.9rem;
}

.job-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.35rem 1rem;
    margin-bottom: 1rem;
}

.job-summary p {
    word-break: break-all;
    overflow-wrap: anywhere;
    min-width: 0;
}

.tab-strip {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.active-tab {
    background: #1d4ed8;
}

.job-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
}

.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.btn-link {
    display: inline-block;
    text-decoration: none;
    background: #0f172a;
    color: #fff;
    border-radius: 0.35rem;
    padding: 0.6rem 0.75rem;
    width: fit-content;
}

.btn-outline {
    background: transparent;
    color: #1f2937;
    border: 1px solid #57534e;
}

.landing-hero {
    background: transparent;
    padding: 0 0 1rem;
}

.landing-kicker {
    display: inline-block;
    margin: 0 0 0.8rem;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    border: 1px solid #f59e0b;
    color: #92400e;
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.landing-hero h1,
.journey h2,
.feature-card h2 {
    font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
}

.landing-hero h1 {
    margin: 0 0 0.8rem;
    color: #0f172a;
    max-width: 52rem;
}

.landing-hero h1:focus,
.landing-hero h1:focus-visible {
    outline: none;
    box-shadow: none;
}

.landing-hero p {
    max-width: 52rem;
    margin-top: 0;
    line-height: 1.5;
}

.landing-cta-row {
    margin-top: 1rem;
    display: flex;
    gap: 0.8rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.wallet-guidance {
    margin-top: 0.9rem;
    margin-bottom: 0.2rem;
    border: 1px solid #d6d3d1;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.72);
    padding: 0.8rem 0.9rem;
}

.wallet-guidance p {
    margin: 0;
    line-height: 1.45;
}

.wallet-guidance p + p {
    margin-top: 0.28rem;
}

.walletconnect-btn-content {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    white-space: nowrap;
}

.walletconnect-icon {
    width: 1rem;
    height: 1rem;
    border-radius: 3px;
    flex: 0 0 auto;
    display: block;
    max-width: 1rem;
    max-height: 1rem;
}

#walletconnect-connect-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.wallet-status {
    margin: 0;
    font-weight: 600;
}

.wallet-status.status-error {
    color: #b91c1c;
}

.wallet-status.status-ok {
    color: #166534;
}

.wallet-details {
    margin-top: 0.35rem;
    margin-bottom: 0;
    color: #334155;
    font-size: 0.92rem;
}

.wallet-feedback {
    margin-top: 0.9rem;
    text-align: center;
    min-height: 3.1rem;
}

.wallet-feedback-inline {
    margin-top: 0.45rem;
    text-align: left;
    min-height: 0;
}

.wallet-feedback .wallet-status,
.wallet-feedback .wallet-details {
    max-width: 54rem;
    margin-left: auto;
    margin-right: auto;
}

.wallet-feedback-inline .wallet-status,
.wallet-feedback-inline .wallet-details {
    margin-left: 0;
    margin-right: 0;
}

.wallet-feedback-inline .wallet-status {
    font-size: 0.92rem;
    font-weight: 600;
    color: #334155;
}

.wallet-feedback-inline .wallet-details {
    font-size: 0.88rem;
}

.landing-grid {
    margin-top: 1.4rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.9rem;
}

.feature-card {
    border: 1px solid #e7e5e4;
    background: #fff;
    border-radius: 12px;
    padding: 1rem;
}

.feature-card h2 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    color: #111827;
}

.feature-card p {
    margin: 0;
    color: #334155;
}

.journey {
    margin-top: 1.4rem;
    border: 1px solid #e7e5e4;
    border-radius: 12px;
    background: #fffbeb;
    padding: 1rem 1.1rem;
}

.journey h2 {
    margin-top: 0;
    margin-bottom: 0.65rem;
}

.journey ol {
    margin: 0;
    padding-left: 1.3rem;
    display: grid;
    gap: 0.25rem;
}

.log-lines {
    background: #0b1220;
    color: #dbeafe;
    border-radius: 0.35rem;
    padding: 0.75rem;
    margin: 0;
    max-height: 14rem;
    overflow: auto;
    list-style: none;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.8rem;
}

.log-lines li {
    margin-bottom: 0.35rem;
}

.create-form-grid {
    display: grid;
    grid-template-columns: minmax(170px, 240px) minmax(320px, 1fr);
    gap: 0.6rem 0.9rem;
    margin-bottom: 1rem;
    align-items: center;
}

.compact-form-fields select,
.compact-form-fields input,
.compact-form-fields textarea {
    width: 100%;
    max-width: 40rem;
    box-sizing: border-box;
    justify-self: start;
}

.compact-form-fields textarea {
    min-height: 7rem;
}

.form-actions-row {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.8rem;
}

.quote-summary-box,
.quote-summary-card {
    border: 1px solid #cbd5e1;
    border-radius: 0.75rem;
    padding: 1rem;
    background: #f8fafc;
    max-width: 30rem;
    margin-bottom: 1rem;
}

.quote-summary-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
}

.quote-summary-label {
    color: #475569;
    font-size: 0.95rem;
}

.quote-summary-total {
    font-size: 1.35rem;
    color: #0f172a;
}

.quote-summary-note {
    margin: 0.75rem 0 0;
    color: #475569;
    font-size: 0.95rem;
}

.terms-agreement {
    max-width: 48rem;
    line-height: 1.6;
    color: #334155;
}

.text-link {
    display: inline;
    margin-left: 0;
    background: transparent;
    border: none;
    color: #1d4ed8;
    text-decoration: underline;
    font: inherit;
    cursor: pointer;
    padding: 0;
}

.text-link:hover,
.text-link:focus-visible {
    color: #1e40af;
    outline: none;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    display: grid;
    place-items: center;
    padding: 1rem;
    z-index: 50;
}

.terms-text {
    white-space: pre-wrap;
    line-height: 1.6;
    color: #0f172a;
}


.modal-content {
    width: min(100%, 40rem);
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 20px 75px rgba(15, 23, 42, 0.2);
    overflow: hidden;
}

.modal-header,
.modal-footer {
    padding: 1rem 1.25rem;
    background: #f1f5f9;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 1.25rem;
    color: #0f172a;
}

.modal-close {
    border: none;
    background: transparent;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

@media (max-width: 760px) {
    .create-form-grid {
        grid-template-columns: 1fr;
    }

    .compact-form-fields select,
    .compact-form-fields input,
    .compact-form-fields textarea {
        max-width: 100%;
        width: 100%;
        justify-self: stretch;
    }

    .landing-hero {
        padding: 1.4rem;
    }
}
