:root {
    --page-bg: #ffffff;
    --text: #111111;
    --muted: #777777;
    --line: #dedede;
    --soft: #f7f7f7;
    --button: #111111;
    --button-text: #ffffff;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--page-bg);
    color: var(--text);
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
textarea {
    font: inherit;
}

.site-header {
    width: 100%;
    height: 72px;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    color: var(--text);
    text-decoration: none;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.04em;
}

.header-actions {
    display: flex;
    align-items: center;
}

.login-placeholder {
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
}

.home {
    min-height: calc(100vh - 72px);
    padding: 24px;
    display: flex;
    justify-content: center;
}

.home-intro {
    width: min(100%, 760px);
    margin-top: min(22vh, 190px);
}

.home-intro h1 {
    margin: 0 0 26px;
    text-align: center;
    font-size: clamp(34px, 5vw, 54px);
    line-height: 1.05;
    letter-spacing: -0.055em;
    font-weight: 600;
}

.composer {
    width: 100%;
    min-height: 92px;
    padding: 16px 16px 14px 20px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--page-bg);
    display: flex;
    align-items: flex-end;
    gap: 12px;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.03),
        0 7px 28px rgba(0, 0, 0, 0.045);
}

.composer:focus-within {
    border-color: #bcbcbc;
}

.composer textarea {
    display: block;
    flex: 1;
    width: 100%;
    min-height: 52px;
    max-height: 220px;
    padding: 9px 0;
    border: 0;
    outline: 0;
    resize: none;
    overflow-y: auto;
    background: transparent;
    color: var(--text);
    font-size: 18px;
    line-height: 1.45;
}

.composer textarea::placeholder {
    color: #999999;
}

.composer-submit {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: var(--button);
    color: var(--button-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    transition:
        opacity 120ms ease,
        transform 120ms ease;
}

.composer-submit:hover:not(:disabled) {
    transform: translateY(-1px);
}

.composer-submit:disabled {
    cursor: default;
    opacity: 0.18;
}

.intake-status {
    min-height: 24px;
    margin: 14px 8px 0;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}

.intake-status.error {
    color: #a11d1d;
}

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

@media (max-width: 640px) {
    .site-header {
        height: 64px;
        padding: 0 20px;
    }

    .brand {
        font-size: 22px;
    }

    .home {
        min-height: calc(100vh - 64px);
        padding: 18px;
    }

    .home-intro {
        margin-top: 15vh;
    }

    .home-intro h1 {
        margin-bottom: 22px;
    }

    .composer {
        min-height: 82px;
        padding:
            13px
            13px
            12px
            17px;
        border-radius: 22px;
    }

    .composer textarea {
        font-size: 16px;
    }

    .composer-submit {
        width: 40px;
        height: 40px;
    }
}

.trending-gigs {
    margin-top: 34px;
    text-align: center;
}

.trending-title {
    margin: 0 0 13px;
    color: #888888;
    font-size: 13px;
    font-weight: 600;
}

.trending-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.trending-list button {
    padding: 9px 14px;
    border: 1px solid #e3e3e3;
    border-radius: 999px;
    background: #ffffff;
    color: #444444;
    cursor: pointer;
    font-size: 13px;
    transition:
        border-color 120ms ease,
        background 120ms ease,
        color 120ms ease;
}

.trending-list button:hover {
    border-color: #c9c9c9;
    background: #f8f8f8;
    color: #111111;
}

@media (max-width: 640px) {
    .trending-gigs {
        margin-top: 28px;
    }

    .trending-list {
        gap: 7px;
    }

    .trending-list button {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* Google-style Trending Gigs list */
.trending-gigs {
    margin-top: 54px;
    text-align: left;
}

.trending-title {
    margin: 0 0 18px;
    color: #111111;
    font-size: 22px;
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: -0.025em;
}

.trending-list {
    display: block;
    border-top: 1px solid #e6e6e6;
}

.trending-list button {
    width: 100%;
    min-height: 58px;
    padding: 0 10px;
    border: 0;
    border-bottom: 1px solid #e6e6e6;
    border-radius: 0;
    background: transparent;
    color: #111111;
    display: flex;
    align-items: center;
    gap: 18px;
    text-align: left;
    cursor: pointer;
    font-size: 16px;
    transition: background 120ms ease;
}

.trending-list button:hover {
    background: #fafafa;
}

.trend-icon {
    width: 30px;
    flex: 0 0 30px;
    color: #111111;
    font-size: 25px;
    line-height: 1;
    font-weight: 500;
}

@media (max-width: 640px) {
    .trending-gigs {
        margin-top: 40px;
    }

    .trending-title {
        font-size: 20px;
    }

    .trending-list button {
        min-height: 56px;
        padding: 0 4px;
        gap: 14px;
        font-size: 15px;
    }

    .trend-icon {
        width: 26px;
        flex-basis: 26px;
        font-size: 22px;
    }
}

/* =========================================================
   Conversation view (milestone 1)
   ========================================================= */

[hidden] {
    display: none !important;
}

.conversation {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 26px;
}

.turn {
    margin: 0;
    display: flex;
    flex-direction: column;
}

.turn-body {
    margin: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 17px;
    line-height: 1.55;
    color: var(--text);
}

/* Customer: one quiet block, right-aligned */
.turn-customer {
    align-items: flex-end;
}

.turn-customer .turn-body {
    max-width: min(85%, 560px);
    padding: 12px 16px;
    border-radius: 18px;
    background: var(--soft);
}

.turn-customer.is-sending .turn-body {
    color: var(--muted);
}

/* GO: plain text, small label, no bubble */
.turn-go {
    align-items: flex-start;
}

.turn-label {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--text);
}

.turn-meta {
    min-height: 18px;
    margin-top: 6px;
    padding: 0 4px;
    color: var(--muted);
    font-size: 12px;
}

.turn.is-failed .turn-meta {
    color: #a11d1d;
}

.turn-retry {
    margin-left: 8px;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font-size: inherit;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

/* Layout once the conversation has started */
.is-conversation .home {
    padding-bottom: 0;
}

.is-conversation .home-intro {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
}

.is-conversation .home-intro h1,
.is-conversation .trending-gigs {
    display: none;
}

.is-conversation .conversation {
    flex: 1 0 auto;
    padding: 16px 0 28px;
}

.is-conversation .composer-dock {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin: 0 -8px;
    padding: 18px 8px calc(14px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0),
        var(--page-bg) 18px
    );
}

.is-conversation .composer {
    min-height: 64px;
    padding: 10px 10px 10px 18px;
}

.is-conversation .composer textarea {
    min-height: 42px;
    max-height: 160px;
    font-size: 17px;
}

.is-conversation .intake-status {
    min-height: 0;
    margin-top: 8px;
}

.is-conversation .intake-status:empty {
    display: none;
}

@media (max-width: 640px) {
    .turn-body {
        font-size: 16px;
    }

    .turn-customer .turn-body {
        max-width: 90%;
    }

    .is-conversation .composer textarea {
        font-size: 16px;
    }
}

/* =========================================================
   Pre-Gig GO + Continue (milestone 3)
   ========================================================= */

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

@media (prefers-reduced-motion: no-preference) {
    .turn-thinking {
        animation: gigson-thinking 1.4s ease-in-out infinite;
    }
}

@keyframes gigson-thinking {
    0%,
    100% {
        opacity: 0.45;
    }

    50% {
        opacity: 1;
    }
}

.turn-go.is-failed .turn-meta {
    margin-top: 0;
}

.turn-action {
    align-items: stretch;
}

.gig-start {
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: 18px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
}

.gig-start-label {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.gig-start-title {
    margin: 2px 0 0;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.gig-start-continue {
    height: 44px;
    padding: 0 24px;
    border: 0;
    border-radius: 999px;
    background: var(--button);
    color: var(--button-text);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 120ms ease;
}

.gig-start-continue:hover {
    transform: translateY(-1px);
}

.gig-start-note {
    flex-basis: 100%;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

@media (max-width: 640px) {
    .gig-start {
        padding: 16px;
    }

    .gig-start-continue {
        width: 100%;
    }
}

/* =========================================================
   Homepage flow: account + Gig start (milestone 4)
   ========================================================= */

.header-actions {
    gap: 22px;
}

.header-link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.header-link:hover {
    text-decoration: underline;
}

.turn-divider {
    align-items: center;
}

.turn-divider p {
    margin: 0;
    padding: 6px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.is-auth .composer-dock {
    display: none;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    padding: 24px 22px;
    border: 1px solid var(--line);
    border-radius: 18px;
}

.auth-title {
    margin: 0;
    font-size: 21px;
    line-height: 1.25;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.auth-note {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}

.auth-form {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #444444;
    font-size: 13px;
    font-weight: 600;
}

.auth-field input {
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #ffffff;
    color: var(--text);
    font: inherit;
    font-size: 16px;
    font-weight: 400;
}

.auth-field input:focus {
    outline: none;
    border-color: #999999;
}

.auth-error {
    margin: 0;
    color: #a11d1d;
    font-size: 13px;
}

.auth-submit {
    height: 46px;
    margin-top: 4px;
    border: 0;
    border-radius: 999px;
    background: var(--button);
    color: var(--button-text);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.auth-submit:disabled {
    opacity: 0.5;
    cursor: default;
}

.auth-links {
    margin-top: 16px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.auth-link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--muted);
    font-size: 13px;
    text-decoration: underline;
    cursor: pointer;
}

.gig-start-continue:disabled {
    opacity: 0.6;
    cursor: default;
    transform: none;
}

/* =========================================================
   Gig status card (milestone 5)
   ========================================================= */

.gig-status-line {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.gig-status-line::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 8px;
    border-radius: 50%;
    background: #1a7f37;
    vertical-align: 1px;
}

/* C1 header link + Gig link */
a.login-placeholder { text-decoration: none; }
a.login-placeholder:hover { text-decoration: underline; }
.gig-status-link { display: inline-block; margin-top: 10px; font-size: 14px; font-weight: 600; color: var(--text); }

/* =========================================================
   GIGSON_BRAND_V1: brand pack (ink, Inter 800, GO tile)
   ========================================================= */

.home-intro h1 {
    font-weight: 800;
    letter-spacing: -0.035em;
    color: #15211B;
}

.home-explainer {
    margin: -12px 0 24px;
    text-align: center;
    color: #5B6660;
    font-size: 17px;
    line-height: 1.4;
}

.intake-status:empty {
    min-height: 0;
    margin-top: 0;
}

.home-slogan {
    margin: 16px 0 0;
    text-align: center;
    color: #15211B;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.035em;
}

.is-conversation .home-explainer,
.is-conversation .home-slogan {
    display: none;
}

.composer {
    border-color: #15211B;
    border-width: 1.5px;
}

.composer-submit {
    background: #15211B;
}

.trending-title {
    color: #15211B;
}

.trending-list button {
    color: #15211B;
    font-weight: 600;
}

/* GO speaks with the GO tile */
.turn-go .turn-label {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    margin: 0 0 8px;
    border-radius: 22%;
    background: #15211B;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.05em;
}

/* Customer messages: ink bubble */
.turn-customer .turn-body {
    background: #15211B;
    color: #fff;
    border-radius: 18px 18px 4px 18px;
}

.turn-customer.is-sending .turn-body {
    color: rgba(255, 255, 255, 0.7);
}

/* Tap-to-answer buttons: black outline, fill when tapped (no green) */
body .quick-replies button {
    border: 1.5px solid #15211B;
    background: #fff;
    color: #15211B;
    font-weight: 600;
}

body .quick-replies button:hover,
body .quick-replies button:focus-visible,
body .quick-replies button:active {
    background: #15211B;
    color: #fff;
}

@media (max-width: 640px) {
    .home-explainer {
        margin-top: -10px;
        font-size: 16px;
    }
}
