/* The static app SPA shell. Colours/type come from the shared /theme.css; this
   only styles structure. Mirrors the server-rendered owner app (app-styles.ts)
   closely enough to feel like one product. */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html {
    color-scheme: light;
}
body {
    font: 15px/1.5 var(--app);
    color: var(--ink);
    background: var(--paper);
    min-height: 100dvh;
}
.boot {
    padding: 80px 24px;
    text-align: center;
    color: var(--muted);
}

.wrap {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--paper);
    box-shadow: 0 0 60px rgba(20, 60, 40, 0.06);
}

header.bar {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    background: var(--card);
    position: sticky;
    top: 0;
    z-index: 5;
}
header.bar .dot {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    flex: none;
    background: var(--green);
    -webkit-mask: url(/harness-logo.svg) center / 70% no-repeat;
    mask: url(/harness-logo.svg) center / 70% no-repeat;
}
header.bar .ttl {
    flex: 1;
    min-width: 0;
}
header.bar .ttl b {
    font-size: 17px;
    letter-spacing: -0.2px;
    display: block;
}
header.bar .ttl span {
    font-size: 11.5px;
    color: var(--muted);
}
.signout {
    flex: none;
    font: inherit;
    font-size: 12px;
    color: var(--muted);
    background: none;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 11px;
    cursor: pointer;
}
.signout:hover {
    border-color: var(--green);
    color: var(--green);
}
.console-link {
    flex: none;
    font-size: 12px;
    font-weight: 600;
    color: var(--green);
    text-decoration: none;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 11px;
}
.console-link:hover {
    border-color: var(--green);
    background: var(--green-bg);
}

main {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 24px;
}
.sec-h {
    padding: 18px 18px 6px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--faint);
}
.empty {
    color: var(--muted);
    text-align: center;
    padding: 56px 28px;
    line-height: 1.6;
}
.empty .soon {
    font-size: 34px;
    margin-bottom: 8px;
}
.muted {
    color: var(--faint);
}

details.proj {
    background: var(--card);
    border-bottom: 1px solid var(--line-2);
}
details.proj > summary {
    display: flex;
    gap: 13px;
    align-items: center;
    padding: 15px 18px;
    cursor: pointer;
    list-style: none;
}
details.proj > summary::-webkit-details-marker {
    display: none;
}
.proj .av {
    flex: 0 0 44px;
    height: 44px;
    border-radius: 13px;
    background: var(--green-bg);
    color: var(--green-d);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}
.proj .mid {
    flex: 1;
    min-width: 0;
}
.proj .r1 {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}
.proj .nm {
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.proj .tm {
    color: var(--faint);
    font-size: 11.5px;
    flex: none;
}
.proj .job {
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chip {
    flex: none;
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--line-2);
    color: var(--muted);
}
.chip.needs {
    background: var(--amber-bg);
    color: var(--amber);
}
.chip.working {
    background: #eaf1ff;
    color: var(--blue);
}
.chip.done {
    background: var(--green-bg);
    color: var(--green-d);
}

.runs {
    padding: 2px 18px 16px;
}
.run {
    border-top: 1px dashed var(--line);
    padding: 13px 0;
}
.run-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
}
.subj {
    font-weight: 600;
    font-size: 14px;
}
.sbadge {
    flex: none;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--line-2);
    color: var(--muted);
}
.sbadge.needs {
    background: var(--amber-bg);
    color: var(--amber);
}
.sbadge.working {
    background: #eaf1ff;
    color: var(--blue);
}
.sbadge.done {
    background: var(--green-bg);
    color: var(--green-d);
}
.sbadge.bad {
    background: var(--bad-bg);
    color: var(--bad);
}

.msg.draft {
    margin-top: 10px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 13px 14px;
}
.msg .tag {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--green-d);
    margin-bottom: 6px;
}
.msg .dtext {
    white-space: pre-wrap;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--ink);
}
.dacts {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.draft-pre {
    margin-top: 8px;
}
.draft-pre > summary {
    color: var(--blue);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
}
.draft-pre pre {
    margin-top: 8px;
    background: var(--paper-alt);
    border: 1px dashed var(--line);
    border-radius: 11px;
    padding: 11px 13px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font: 13px/1.5 inherit;
}

.btn {
    border: 0;
    border-radius: 11px;
    padding: 10px 14px;
    font-weight: 700;
    font-size: 13.5px;
    text-decoration: none;
    cursor: pointer;
    display: inline-block;
}
.btn.primary {
    background: var(--green);
    color: #fff;
}
.btn.ghost {
    background: var(--paper-alt);
    color: var(--ink);
}
.btn.no {
    background: var(--bad-bg);
    color: var(--bad);
}

/* sign-in */
.authwrap {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 24px;
}
.card.auth {
    width: 100%;
    max-width: 360px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 26px 24px;
    box-shadow: var(--shadow);
}
.card.auth .brand {
    display: flex;
    align-items: center;
    gap: 9px;
    font-family: var(--slab);
    font-weight: 700;
    font-size: 19px;
    color: var(--green);
}
.card.auth .brand .mark {
    width: 24px;
    height: 24px;
    background: var(--green);
    -webkit-mask: url(/harness-logo.svg) center / contain no-repeat;
    mask: url(/harness-logo.svg) center / contain no-repeat;
}
.card.auth h1 {
    font-size: 22px;
    margin: 16px 0 14px;
    font-family: var(--serif);
    font-weight: 600;
}
.card.auth label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 12px;
}
.card.auth input {
    display: block;
    width: 100%;
    margin-top: 5px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--paper);
    color: var(--ink);
    font: inherit;
}
.card.auth input:focus {
    outline: none;
    border-color: var(--green);
}
.card.auth .btn.primary {
    width: 100%;
    margin-top: 6px;
    padding: 12px;
}
.card.auth .err {
    background: var(--bad-bg);
    color: var(--bad);
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 13px;
    margin-bottom: 14px;
}

/* ── draft edit states (composer) ───────────────────────────────────────── */
.msg.draft.pending {
    border-color: var(--amber);
    background: #fffdf5;
}
.msg.draft.sent {
    border-color: #cfe7d9;
    background: #eef7f1;
}
.msg.draft.rejected {
    border-color: var(--line);
    background: var(--paper-alt);
    opacity: 0.85;
}
.msg.draft.pending .tag::after {
    content: " · edited";
}
.msg.draft.sent .tag {
    color: var(--green-d);
}
.msg.draft.rejected .tag {
    color: var(--muted);
}
.dbar {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
    align-items: center;
}
.dbar .pmark {
    font-size: 11.5px;
    color: var(--amber);
    font-weight: 700;
}
.dbar .sending {
    color: var(--blue);
}
.dbar .sending b {
    font-variant-numeric: tabular-nums;
}
.gone {
    display: none !important;
}

/* ── composer + voice bottom sheets ─────────────────────────────────────── */
.veil {
    position: fixed;
    inset: 0;
    background: rgba(8, 20, 13, 0.34);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
    z-index: 40;
}
.veil.show {
    opacity: 1;
    pointer-events: auto;
}
#composer,
#vsheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    max-width: 560px;
    margin: 0 auto;
    background: var(--card);
    border-radius: 22px 22px 0 0;
    z-index: 41;
    padding: 16px 16px max(16px, env(safe-area-inset-bottom));
    transform: translateY(115%);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.18);
}
#composer.show,
#vsheet.show {
    transform: none;
}
#composer .grab,
#vsheet .grab {
    width: 38px;
    height: 4px;
    border-radius: 2px;
    background: var(--line-2);
    margin: 2px auto 12px;
}
#composer .ch {
    font-size: 15px;
    font-weight: 800;
}
#composer .cs {
    font-size: 12.5px;
    color: var(--muted);
    margin: 2px 0 12px;
}
#composer .crow {
    display: flex;
    gap: 9px;
    align-items: flex-end;
}
#composer textarea {
    flex: 1;
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 11px 12px;
    font: inherit;
    font-size: 15px;
    resize: none;
    min-height: 48px;
    max-height: 130px;
    background: var(--paper);
    color: var(--ink);
}
#composer textarea:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(31, 77, 50, 0.14);
}
#composer .mic {
    width: 48px;
    height: 48px;
    flex: none;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--paper-alt);
    font-size: 20px;
    cursor: pointer;
}
#composer .mic.rec {
    background: #ffe3e3;
    border-color: #ffb4b4;
}
#composer .do {
    width: 100%;
    margin-top: 11px;
    padding: 14px;
    border: 0;
    border-radius: 13px;
    background: var(--green);
    color: #fff;
    font: inherit;
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
}
#composer .do:disabled {
    opacity: 0.6;
}
.cx {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 9px;
    color: var(--muted);
    font-size: 12.5px;
    background: none;
    border: 0;
    cursor: pointer;
}
#c-flash {
    position: fixed;
    left: 50%;
    bottom: 84px;
    transform: translate(-50%, 90px);
    background: var(--green-deep);
    color: #eafff3;
    padding: 11px 18px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    z-index: 50;
    transition: transform 0.3s;
    max-width: 86%;
    text-align: center;
}
#c-flash.show {
    transform: translate(-50%, 0);
}
.v-fab {
    position: fixed;
    right: 16px;
    bottom: 84px;
    z-index: 38;
    width: 56px;
    height: 56px;
    border: 0;
    border-radius: 50%;
    background: var(--green);
    color: #fff;
    font-size: 24px;
    box-shadow: 0 8px 22px rgba(31, 77, 50, 0.36);
    cursor: pointer;
}
.v-fab:active {
    transform: scale(0.94);
}
.v-head {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 8px;
}
.v-mic {
    width: 42px;
    height: 42px;
    flex: none;
    border-radius: 12px;
    background: var(--paper-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
    cursor: pointer;
}
.v-mic.live {
    background: #ffe3e3;
    animation: vpulse 1.1s ease-in-out infinite;
}
@keyframes vpulse {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(255, 90, 90, 0.5);
    }
    50% {
        box-shadow: 0 0 0 9px rgba(255, 90, 90, 0);
    }
}
.v-ttl {
    font-size: 15px;
    font-weight: 800;
}
.v-said {
    min-height: 20px;
    font-size: 15px;
    color: var(--ink);
    margin: 2px 0;
}
.v-said:empty::before {
    content: "Say a command — “approve Bob’s quote”, “what’s waiting on me?”";
    color: var(--faint);
}
.v-back {
    font-size: 14px;
    color: var(--green-d);
    font-weight: 600;
    margin: 8px 0;
}
.v-draft {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 10px 12px;
    margin: 8px 0;
    max-height: 180px;
    overflow: auto;
}
.v-acts {
    display: flex;
    gap: 9px;
    margin-top: 6px;
}
.v-acts .btn {
    flex: 1;
    text-align: center;
}
