/* Crello — "system console" identity.
   Light working surface, deep indigo chrome, monospace tokens as signature. */

:root {
    --ink:        #15161e;   /* chrome background */
    --ink-2:      #1f2230;   /* raised chrome     */
    --paper:      #f5f6f9;   /* working surface   */
    --surface:    #ffffff;   /* cards             */
    --line:       #e3e6ec;   /* hairlines (light) */
    --hair-dark:  rgba(255, 255, 255, .09);

    --text:       #191c25;
    --text-dim:   #5d6677;
    --text-faint: #8a93a3;
    --invert:     #eceef4;

    --iris:       #5a4fe0;   /* primary           */
    --iris-press: #463cc0;
    --teal:       #128a63;   /* creator           */
    --amber:      #b3760d;   /* client / status */
    --green:      #1f9e6f;   /* ok                */
    --red:        #cf4636;   /* danger / error    */

    --radius:     10px;
    --radius-sm:  7px;
    --shadow:     0 1px 2px rgba(20, 22, 30, .06), 0 8px 24px rgba(20, 22, 30, .05);

    --display: "Space Grotesk", system-ui, sans-serif;
    --body:    "Inter", system-ui, -apple-system, sans-serif;
    --mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
    font-family: var(--body);
    color: var(--text);
    background: var(--paper);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--iris); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- The signature: monospace tokens -------------------------------------- */

.token {
    display: inline-flex;
    align-items: center;
    font-family: var(--mono);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: .04em;
    padding: 2px 7px;
    border-radius: 5px;
    border: 1px solid currentColor;
    line-height: 1.4;
    white-space: nowrap;
    vertical-align: middle;
}
.token-role[data-role="owner"]   { color: var(--iris); }
.token-role[data-role="creator"]  { color: var(--teal); }
.token-role[data-role="client"] { color: var(--amber); }

.token-status[data-status="ok"]      { color: var(--green); }
.token-status[data-status="error"]   { color: var(--red); }
.token-status[data-status="soon"],
.token-status[data-status="pending"] { color: var(--amber); }
.token-status[data-status="not_started"]  { color: var(--text-faint); }
.token-status[data-status="in_progress"]  { color: var(--iris); }
.token-status[data-status="under_review"] { color: var(--amber); }
.token-status[data-status="completed"]    { color: var(--green); }
.token-status[data-status="in_progress"][data-revision="1"] { color: var(--amber); }
.token-priority[data-priority="low"]    { color: var(--text-faint); }
.token-priority[data-priority="normal"] { color: var(--text-dim); }
.token-priority[data-priority="high"]   { color: var(--red); }
.token-draft { color: var(--text-faint); border-style: dashed; }
.token-cluster { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.panel-draft { border-left: 3px solid var(--amber); }
.token-lg { font-size: 12px; padding: 4px 10px; }

/* --- Brand ---------------------------------------------------------------- */

.brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--invert);
    font-family: var(--display);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: -.01em;
}
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--iris); font-size: 19px; transform: translateY(1px); }

.inline { margin: 0; }

/* --- Shell + page scaffolding -------------------------------------------- */


.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
}
.eyebrow {
    font-family: var(--mono);
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: 11px;
    color: var(--text-faint);
    margin: 0 0 6px;
}
.page-title {
    font-family: var(--display);
    font-weight: 600;
    font-size: 30px;
    letter-spacing: -.02em;
    margin: 0;
}

/* --- Stats ---------------------------------------------------------------- */

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 22px; }
.stat {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
}
.stat-num { display: block; font-family: var(--display); font-weight: 700; font-size: 30px; line-height: 1; }
.stat-label { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); }

/* --- Panels --------------------------------------------------------------- */

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 18px;
    box-shadow: var(--shadow);
}
.panel-title { font-family: var(--display); font-weight: 600; font-size: 17px; margin: 0 0 14px; }
.panel-empty { border-style: dashed; box-shadow: none; background: transparent; }
.panel-empty .panel-title { margin-top: 10px; }
.panel-empty p { color: var(--text-dim); margin: 0; max-width: 60ch; }
.muted { color: var(--text-faint); margin: 0; }

/* --- Auth chrome ---------------------------------------------------------- */

.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 18px;
    background:
        radial-gradient(900px 500px at 50% -10%, rgba(90, 79, 224, .08), transparent 70%),
        var(--paper);
}
.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 34px 32px 30px;
    box-shadow: var(--shadow);
}
.brand-auth { color: var(--text); margin-bottom: 22px; }
.brand-auth .brand-name { color: var(--text); }
.auth-title { font-family: var(--display); font-weight: 600; font-size: 23px; letter-spacing: -.02em; margin: 0 0 6px; }
.auth-sub { color: var(--text-dim); margin: 0 0 22px; font-size: 14px; }
.auth-alt { margin: 20px 0 0; font-size: 14px; color: var(--text-dim); }

/* --- Forms ---------------------------------------------------------------- */

.form { display: flex; flex-direction: column; gap: 16px; }
.form-inline { flex-direction: row; flex-wrap: wrap; align-items: flex-end; }
.form-inline .field { flex: 1 1 180px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-dim); }

input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="url"], input[type="search"], select, textarea {
    font-family: var(--body);
    font-size: 15px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 11px 12px;
    width: 100%;
    transition: border-color .12s ease, box-shadow .12s ease;
}
input:focus, select:focus {
    outline: none;
    border-color: var(--iris);
    box-shadow: 0 0 0 3px rgba(90, 79, 224, .15);
}
.field-error { color: var(--red); font-size: 12.5px; }

/* --- Buttons -------------------------------------------------------------- */

.btn-primary, .btn-ghost {
    font-family: var(--body);
    font-weight: 600;
    font-size: 14px;
    border-radius: var(--radius-sm);
    padding: 11px 16px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background .12s ease, border-color .12s ease;
}
.btn-primary { background: var(--iris); color: #fff; }
.btn-primary:hover { background: var(--iris-press); text-decoration: none; color: #fff; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--paper); text-decoration: none; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn-danger { color: var(--red); border-color: transparent; padding: 6px 10px; }
.btn-danger:hover { background: rgba(207, 70, 54, .08); }

:focus-visible { outline: 2px solid var(--iris); outline-offset: 2px; }

/* --- Notices -------------------------------------------------------------- */

.notice { border-radius: var(--radius); padding: 14px 16px; margin-bottom: 18px; font-size: 14px; }
.notice-error { background: rgba(207, 70, 54, .07); border: 1px solid rgba(207, 70, 54, .25); color: #92271a; }
.notice-ok { background: rgba(31, 158, 111, .07); border: 1px solid rgba(31, 158, 111, .25); }
.notice-title { font-weight: 600; margin: 0 0 8px; }
.notice-hint { color: var(--text-dim); font-size: 13px; margin: 8px 0 0; }

.copy-row { display: flex; gap: 8px; }
.copy-input { font-family: var(--mono); font-size: 13px; }

/* --- Workspace picker ----------------------------------------------------- */

.ws-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.ws-item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 15px 16px;
    cursor: pointer;
    font-size: 15px;
    transition: border-color .12s ease, box-shadow .12s ease;
}
.ws-item:hover { border-color: var(--iris); box-shadow: var(--shadow); }
.ws-name { font-weight: 600; font-family: var(--display); }

/* --- Tables --------------------------------------------------------------- */

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
    text-align: left;
    font-family: var(--mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-faint);
    font-weight: 600;
    padding: 0 10px 10px;
    border-bottom: 1px solid var(--line);
}
.table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.mono-cell { font-family: var(--mono); font-size: 13px; color: var(--text-dim); }
.row-actions { text-align: right; }

/* --- Install -------------------------------------------------------------- */

.install-list { list-style: none; padding: 0; margin: 0 0 22px; display: flex; flex-direction: column; gap: 8px; }
.install-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--mono);
    font-size: 13px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
}
.install-stmt { color: var(--text); }
.install-detail { color: var(--red); margin-left: auto; font-size: 12px; max-width: 50%; text-align: right; }

/* --- Projects ------------------------------------------------------------- */

textarea { resize: vertical; font-family: var(--body); line-height: 1.5; }
.field-narrow { max-width: 220px; }
.btn-sm { padding: 8px 13px; font-size: 13px; }

.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head .panel-title { margin: 0; }

.status-tally { display: flex; flex-wrap: wrap; gap: 18px; }
.tally { display: inline-flex; align-items: center; gap: 8px; }
.tally-num { font-family: var(--display); font-weight: 700; font-size: 18px; }

.status-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.proj-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.proj-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
    color: var(--text);
    transition: border-color .12s ease, box-shadow .12s ease;
}
.proj-row:hover { border-color: var(--iris); box-shadow: var(--shadow); text-decoration: none; }
.proj-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.proj-title { font-family: var(--display); font-weight: 600; font-size: 16px; }
.proj-meta { color: var(--text-dim); font-size: 13px; }

.assign-group { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.assign-group > .field-label { margin-bottom: 2px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: auto; }

.member-list { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; }
.member-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.member-row:last-child { border-bottom: none; }
.member-id { display: flex; flex-direction: column; gap: 1px; margin-right: auto; min-width: 0; }
.member-name { font-weight: 600; }
.member-id .muted { font-size: 12.5px; }
.add-member { border-top: 1px solid var(--line); padding-top: 16px; }

.brief-text { white-space: normal; margin: 0 0 10px; }
.meta-line { color: var(--text-dim); font-size: 14px; margin: 4px 0 0; }

/* --- Project links --------------------------------------------------------- */

.link-add { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; margin-bottom: 16px; gap: 10px; }
.link-add input[type="text"] { flex: 0 1 200px; }
.link-add input[type="url"] { flex: 1 1 260px; }

.link-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.link-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}
.link-row:last-child { border-bottom: none; }
.link-id { display: flex; flex-direction: column; gap: 2px; margin-right: auto; min-width: 0; }
.link-name { font-weight: 600; word-break: break-word; }
.link-meta { color: var(--text-dim); font-size: 12.5px; }
.link-host { font-family: var(--mono); font-size: 12px; }
.link-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.link-edit { position: relative; }
.link-edit summary { list-style: none; cursor: pointer; }
.link-edit summary::-webkit-details-marker { display: none; }
.link-edit-form { display: flex; flex-direction: row; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.link-edit-form input[type="text"] { flex: 0 1 180px; }
.link-edit-form input[type="url"] { flex: 1 1 220px; }

/* --- Feedback ------------------------------------------------------------- */

.comment-form textarea,
.comment-reply-form textarea {
    width: 100%;
    resize: vertical;
    font: inherit;
    margin-bottom: 10px;
}
.comment-form { margin-bottom: 22px; }
.comment-form .form-actions { display: flex; justify-content: flex-end; }

.comment-thread { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.comment-item { display: flex; flex-direction: column; gap: 5px; }
.comment-actions { display: flex; align-items: center; gap: 8px; }
.comment-actions.actions-mine { justify-content: flex-end; }
.comment-reply-form { margin-top: 8px; max-width: 520px; }

.comment-replies {
    list-style: none;
    margin: 6px 0 0;
    padding: 0 0 0 20px;
    border-left: 2px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* --- Admin ---------------------------------------------------------------- */

.stat-link { color: var(--text); transition: border-color .12s ease, box-shadow .12s ease; }
.stat-link:hover { border-color: var(--iris); box-shadow: var(--shadow); text-decoration: none; }
.stat-quiet { display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.stat-links { display: flex; flex-wrap: wrap; gap: 12px; font-size: 14px; }

.table-admin td { vertical-align: middle; }
.table-admin .member-name { font-weight: 600; margin-right: 8px; }
.table-admin .mono-cell { margin-left: 6px; }
.table-admin .cell-when { white-space: nowrap; }
/* .row-actions is display:flex, so the browser drops it from the collapsed
   table border and the row divider stops short of the buttons. Draw it back. */
.table-admin .row-actions { border-bottom: 1px solid var(--line); }
.table-admin tr:last-child .row-actions { border-bottom: none; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.inline-menu { position: relative; }
.inline-menu summary { list-style: none; cursor: pointer; display: inline-flex; }
.inline-menu summary::-webkit-details-marker { display: none; }
.rename-form { margin-top: 8px; gap: 8px; }

/* --- Landing -------------------------------------------------------------- */

.layout-landing { background: var(--paper); }
.landing-nav {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 28px; max-width: 1100px; margin: 0 auto;
}
.landing-nav .brand { color: var(--text); }
.landing-nav .brand-name { color: var(--text); }
.landing-nav-links { display: flex; align-items: center; gap: 18px; }
.landing-nav-links > a:not(.btn-primary) { color: var(--text-dim); font-weight: 500; }

.landing { max-width: 1100px; margin: 0 auto; padding: 0 28px; }

.hero { text-align: center; padding: 64px 0 56px; max-width: 760px; margin: 0 auto; }
.hero-eyebrow {
    font-family: var(--mono); text-transform: uppercase; letter-spacing: .14em;
    font-size: 12px; color: var(--iris); margin: 0 0 18px;
}
.hero-title {
    font-family: var(--display); font-weight: 700; letter-spacing: -.03em;
    font-size: clamp(34px, 6vw, 56px); line-height: 1.04; margin: 0 0 20px;
}
.hero-sub { font-size: 18px; color: var(--text-dim); margin: 0 auto 30px; max-width: 60ch; }
.hero-cta { display: flex; gap: 12px; justify-content: center; }
.hero-cta .btn-primary, .hero-cta .btn-ghost { padding: 13px 22px; font-size: 15px; }

.pipeline {
    display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
    gap: 10px; margin: 52px 0 14px;
}
.pipeline-arrow { color: var(--text-faint); font-family: var(--mono); }
.pipeline .token { font-size: 12px; padding: 5px 11px; }
.pipeline-caption { color: var(--text-faint); font-size: 14px; margin: 0; }

.section-title {
    font-family: var(--display); font-weight: 600; font-size: 26px; letter-spacing: -.02em;
    text-align: center; margin: 0 0 32px;
}
.pain { padding: 56px 0; border-top: 1px solid var(--line); }
.pain-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; max-width: 860px; margin: 0 auto; }
.pain-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
.pain-card h3 { font-family: var(--display); font-weight: 600; font-size: 17px; margin: 0 0 8px; }
.pain-card p { color: var(--text-dim); margin: 0; font-size: 14.5px; }

.how { padding: 56px 0; border-top: 1px solid var(--line); }
.role-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.role-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.role-card .token { margin-bottom: 14px; }
.role-card p { color: var(--text-dim); margin: 0; font-size: 14.5px; }

.cta-band {
    margin: 40px 0 64px; padding: 52px 28px; border-radius: 16px;
    background: var(--ink); text-align: center;
}
.cta-title { font-family: var(--display); font-weight: 700; font-size: 28px; color: var(--invert); margin: 0 0 22px; letter-spacing: -.02em; }

.landing-foot {
    max-width: 1100px; margin: 0 auto; padding: 28px; display: flex; align-items: center;
    gap: 10px; color: var(--text-faint); font-size: 13px; border-top: 1px solid var(--line);
}
.landing-foot .brand-mark { color: var(--iris); }

/* --- Creator profile + apply + stats -------------------------------------- */

.field-hint { color: var(--text-faint); font-weight: 400; font-size: 12px; }
.form-actions { display: flex; justify-content: flex-end; }

.share-row { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.share-link { flex: 1; font-family: var(--mono); font-size: 13px; }

.viewchart { display: flex; align-items: flex-end; gap: 5px; height: 84px; margin: 18px 0 6px; }
.viewbar { flex: 1; display: flex; align-items: flex-end; height: 100%; }
.viewbar-fill { width: 100%; background: var(--iris); border-radius: 3px 3px 0 0; min-height: 3px; }
.viewchart-caption { font-size: 12.5px; }

.profile-hero { text-align: center; max-width: 680px; margin: 0 auto; padding: 64px 0 48px; }
.profile-bio { font-size: 17px; color: var(--text-dim); line-height: 1.65; margin: 0 auto 26px; max-width: 60ch; white-space: normal; }
.profile-links { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.profile-links li a, .profile-links li span {
    display: inline-block; padding: 8px 16px; border: 1px solid var(--line);
    border-radius: 999px; background: var(--surface); font-size: 14px;
}

.application-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.application-head .member-name { font-weight: 600; margin-right: 8px; }
.application-bio { color: var(--text-dim); line-height: 1.55; white-space: normal; margin-bottom: 12px; }
.application-links { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 14px; font-size: 14px; }
.application-actions { display: flex; gap: 8px; }

/* --- Creator directory ---------------------------------------------------- */

.directory-head { text-align: center; padding: 56px 0 28px; max-width: 640px; margin: 0 auto; }
.directory-search { display: flex; gap: 10px; justify-content: center; margin: 22px 0 10px; }
.directory-search input { flex: 1; max-width: 420px; }
.directory-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding-bottom: 16px; }
.creator-card {
    display: flex; flex-direction: column; gap: 10px; align-items: flex-start;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 20px; color: var(--text); transition: border-color .12s ease, box-shadow .12s ease;
}
.creator-card:hover { border-color: var(--iris); box-shadow: var(--shadow); text-decoration: none; }
.creator-card-name { font-family: var(--display); font-weight: 600; font-size: 17px; }
.creator-card-bio { color: var(--text-dim); font-size: 14px; line-height: 1.5; }
.directory-pager { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 12px 0 56px; }

/* --- Engagements / messages ----------------------------------------------- */

.reach-out { margin-top: 28px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-align: left; }
.reach-out-title { font-family: var(--display); font-size: 18px; margin: 0 0 4px; }
.reach-out textarea { width: 100%; margin: 12px 0; }

.engagement-list { list-style: none; margin: 0; padding: 0; }
.engagement-list li + li { border-top: 1px solid var(--line); }
.engagement-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 4px; color: var(--text); }
.engagement-row:hover { text-decoration: none; color: var(--iris); }
.engagement-parties { display: flex; align-items: center; gap: 10px; }
.engagement-arrow { color: var(--text-dim); }

.msg-thread { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.msg { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: var(--paper); max-width: 80%; }
.msg-mine { align-self: flex-end; background: rgba(90, 79, 224, .07); border-color: rgba(90, 79, 224, .25); }
.msg-meta { display: flex; gap: 10px; align-items: baseline; margin-bottom: 4px; }
.msg-author { font-weight: 600; font-size: 14px; }
.msg-time { font-family: var(--mono); font-size: 11px; color: var(--text-dim); }
.msg-body { font-size: 14px; line-height: 1.5; }
.msg-form textarea { width: 100%; }
.msg-form-actions { display: flex; justify-content: flex-end; margin-top: 10px; }
.form-danger { margin-top: 16px; }

/* --- Responsive ----------------------------------------------------------- */

@media (max-width: 640px) {
    .stat-row { grid-template-columns: 1fr; }
    .page-title { font-size: 25px; }
    .form-inline { flex-direction: column; align-items: stretch; }
    .pain-grid, .role-grid { grid-template-columns: 1fr; }
    .directory-grid { grid-template-columns: 1fr; }
    .landing-nav, .landing { padding-left: 18px; padding-right: 18px; }
    .row-actions { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}

/* --- Projects table + filter bar ------------------------------------------- */

.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.filter-search { flex: 1 1 220px; }
.filter-select { flex: 0 0 auto; width: auto; min-width: 150px; }

.table-wrap { overflow-x: auto; }
.project-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.project-table th {
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-dim);
    font-weight: 600;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.project-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.project-table tbody tr:last-child td { border-bottom: none; }
.project-row:hover { background: var(--surface); }
.cell-title a { font-weight: 600; word-break: break-word; }
.cell-assignees { color: var(--text-dim); }
.cell-due { font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.cell-due.due-overdue { color: var(--red); }

/* --- Project files tile extras --------------------------------------------- */

.panel-intro { margin-top: -2px; margin-bottom: 14px; }
.file-services { margin-bottom: 16px; }
.file-services > summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--iris); }
.file-services > summary::-webkit-details-marker { color: var(--iris); }
.service-list { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 12px; }
.service-row { display: flex; flex-direction: column; gap: 3px; }
.service-name { font-weight: 600; }
.service-desc { color: var(--text-dim); font-size: 13px; line-height: 1.45; }
.notice-quiet { background: var(--surface); color: var(--text-dim); border: 1px solid var(--line); }

/* --- People panel: collapsible add + inline invite ------------------------- */

.people-add { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.people-add > summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--iris); }
.people-add > summary::-webkit-details-marker { color: var(--iris); }
.add-member { margin-top: 12px; }
.check-grid { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 8px 0 12px; }
.check-grid .check { flex: 0 1 auto; }
.invite-inline { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); }
.link-add input[type="email"] { flex: 1 1 220px; }
.hint {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    border: 1px solid var(--line); color: var(--text-dim);
    font-size: 11px; font-weight: 600; cursor: help; margin-left: 5px; vertical-align: middle;
}
.hint:hover, .hint:focus { border-color: var(--iris); color: var(--iris); outline: none; }

/* --- Danger zone ----------------------------------------------------------- */

.panel-danger { border-left: 3px solid var(--red); }
.danger-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.danger-row .panel-title { margin-bottom: 4px; }
.danger-row .muted { margin: 0; }

/* --- Pricing + plans ------------------------------------------------------- */

.pricing-lead { max-width: 640px; margin-bottom: 28px; }
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; }
.price-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; background: var(--paper); position: relative; display: flex; flex-direction: column; }
.price-card-featured { border-color: var(--iris); box-shadow: 0 0 0 1px var(--iris); }
.price-badge { position: absolute; top: -10px; left: 24px; background: var(--iris); color: #fff; font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.price-name { font-size: 18px; margin-bottom: 8px; }
.price-cadence { font-weight: 400; color: var(--text-dim); font-size: 14px; }
.price-tag { font-size: 32px; font-weight: 700; font-family: var(--display); margin-bottom: 12px; }
.price-per { font-size: 15px; font-weight: 400; color: var(--text-dim); }
.price-limits { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.price-cta { display: block; text-align: center; margin-bottom: 16px; }
.price-features { list-style: none; padding: 16px 0 0; margin: 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; color: var(--text-dim); font-size: 13.5px; }
.usage-note { color: var(--text-dim); font-size: 12.5px; margin: 4px 0 0; }
.plan-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 18px; align-items: start; margin-top: 20px; }
.plan-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.plan-tile-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.plan-tile-head h2 { font-size: 16px; margin: 0; }
.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 14px; }
.plan-grid .field { min-width: 0; gap: 5px; }
.plan-grid .field input { width: 100%; }
.plan-grid .col-2 { grid-column: 1 / -1; }
.plan-set { display: inline; }
.plan-set select { width: auto; min-width: 110px; }

/* --- Landing pricing section ----------------------------------------------- */

.pricing-section { padding: 64px 24px; max-width: 1080px; margin: 0 auto; }
.pricing-section .section-title { text-align: center; }
.section-sub { text-align: center; max-width: 620px; margin: 8px auto 36px; color: var(--text-dim); }

/* --- Admin shell (dark sidebar console) ------------------------------------ */

.layout-admin { background: var(--paper); }
.console { display: flex; align-items: stretch; min-height: 100vh; }
.console-rail {
    width: 244px; flex: 0 0 244px; background: var(--ink); color: #c7ccd6;
    display: flex; flex-direction: column; padding: 18px 14px;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.console-brand { display: flex; align-items: center; gap: 8px; padding: 6px 8px 16px; }
.console-brand .brand-mark { color: var(--iris); font-size: 19px; }
.console-brand-name { font-family: var(--display); font-weight: 700; color: #fff; font-size: 16px; }
.console-brand .brand-role { margin-left: auto; }
.console-burger { display: none; }
.console-topbar { display: none; }
.console-backdrop { display: none; }
.admin-pill {
    margin-left: auto; font-family: var(--mono); font-size: 10px; font-weight: 600;
    letter-spacing: .08em; color: #fff; background: var(--iris); padding: 2px 7px; border-radius: 999px;
}
.console-nav { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.console-group {
    font-family: var(--mono); font-size: 10.5px; letter-spacing: .11em; text-transform: uppercase;
    color: #6b7383; margin: 16px 8px 6px;
}
.console-link {
    display: flex; align-items: center; gap: 11px; padding: 8px 10px;
    border-radius: var(--radius-sm); color: #c7ccd6; font-size: 14px; font-weight: 500;
}
.console-link:hover { background: var(--ink-2); color: #fff; text-decoration: none; }
.console-link.is-active { background: var(--ink-2); color: #fff; box-shadow: inset 3px 0 0 var(--iris); }
.console-ico { width: 20px; text-align: center; font-size: 15px; flex: 0 0 20px; }
.console-foot {
    border-top: 1px solid rgba(255,255,255,.08); padding-top: 14px; margin-top: 10px;
    display: flex; flex-direction: column; gap: 10px;
}
.console-back {
    display: flex; align-items: center; gap: 6px; color: #c7ccd6; font-size: 13.5px; font-weight: 600;
    padding: 6px 8px; border-radius: var(--radius-sm);
}
.console-back:hover { background: var(--ink-2); color: #fff; text-decoration: none; }
.console-who { display: flex; flex-direction: column; gap: 7px; padding: 0 8px; }
.console-email { font-size: 12px; color: #6b7383; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.cw-row { display: flex; align-items: center; gap: 8px; }
.cw-row .inline { margin-left: auto; }            /* Sign out pinned right */
.cw-row .console-email { flex: 1 1 auto; min-width: 0; }
.console-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-mode-banner {
    background: rgba(90,79,224,.09); border-bottom: 1px solid var(--line);
    color: var(--iris); font-size: 12.5px; font-weight: 600; padding: 8px 32px;
}
.admin-mode-banner a { color: var(--iris); text-decoration: underline; }
.console-content { padding: 32px; max-width: 1060px; width: 100%; }

@media (max-width: 768px) {
    .console { display: block; }

    .console-topbar {
        display: flex; align-items: center; gap: 10px;
        position: sticky; top: 0; z-index: 40;
        background: var(--ink); padding: 10px 14px;
    }
    .console-topbar-brand { display: flex; align-items: center; gap: 8px; min-width: 0; text-decoration: none; }
    .console-topbar-brand .console-brand-name { color: #fff; }
    .console-burger {
        display: inline-flex; align-items: center; justify-content: center;
        margin-left: auto; flex: 0 0 auto; width: 42px; height: 42px;
        border-radius: var(--radius-sm); background: transparent;
        border: 1px solid rgba(255, 255, 255, .25); color: #fff;
        font-size: 20px; line-height: 1; cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    /* Rail becomes a left drawer that slides in over the page. */
    .console-rail {
        position: fixed; top: 0; left: 0; bottom: 0; height: 100%;
        width: min(84vw, 300px); flex: none;
        transform: translateX(-100%); transition: transform .25s ease;
        z-index: 100; overflow-y: auto;
    }
    .console.nav-open .console-rail { transform: translateX(0); }

    .console-backdrop {
        display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .5);
        opacity: 0; visibility: hidden; transition: opacity .25s ease; z-index: 90;
    }
    .console.nav-open .console-backdrop { opacity: 1; visibility: visible; }

    .console-main { width: 100%; overflow-x: clip; }
    .console-content { padding: 20px 16px; }

    /* Data tables become stacked cards: each row a card, each cell a labelled line. */
    .console-content .table:not(.lb-table),
    .console-content .table:not(.lb-table) tbody,
    .console-content .table:not(.lb-table) tr,
    .console-content .table:not(.lb-table) td { display: block; width: auto; }
    .console-content .table:not(.lb-table) thead {
        position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
        overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
    }
    .console-content .table:not(.lb-table) tr {
        margin-bottom: 12px; padding: 4px 14px;
        border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
    }
    .console-content .table:not(.lb-table) tr[hidden] { display: none; }
    .console-content .table:not(.lb-table) td {
        display: block; text-align: left;
        padding: 7px 0; border: 0; border-bottom: 1px solid var(--line);
    }
    .console-content .table:not(.lb-table) tr td:last-child { border-bottom: 0; }
    .console-content .table:not(.lb-table) td::before {
        content: attr(data-label); display: block; margin-bottom: 2px;
        font-family: var(--mono); font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase;
        color: var(--text-faint); font-weight: 600;
    }
    .console-content .table:not(.lb-table) td:not([data-label])::before { display: none; }
    .console-content .table:not(.lb-table) td:first-child {
        font-family: var(--display); font-weight: 600; font-size: 15px; padding: 8px 0 10px;
    }
    /* Full-width cells (expandable edit forms, empty states) stay block, unlabelled. */
    .console-content .table:not(.lb-table) td[colspan] { border-bottom: 0; }
    .console-content .table:not(.lb-table) .row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
    .console-content .table:not(.lb-table) .copy-input { width: 100%; }

    /* Data-dense tables (leaderboard) scroll horizontally instead of stacking. */
    .console-content .table.lb-table {
        display: block; width: max-content; max-width: 100%;
        overflow-x: auto; -webkit-overflow-scrolling: touch;
    }
}

/* Member console extras */

/* --- Admin overview dashboard ---------------------------------------------- */

.stat-row-4 { grid-template-columns: repeat(4, 1fr); }
.dash-grid { display: flex; flex-direction: column; gap: 18px; margin-top: 20px; }
.plan-breakdown { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.pb-row { display: grid; grid-template-columns: 1fr 110px auto; align-items: center; gap: 12px; }
.pb-name { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.pb-bar { height: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.pb-fill { display: block; height: 100%; width: 0; background: var(--iris); border-radius: 999px; }
.pb-count { font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.mini-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.mini-list li { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.mini-list li:last-child { border-bottom: 0; }
.mini-main { font-weight: 500; }
.mini-meta { margin-left: auto; color: var(--text-dim); font-size: 12px; }

@media (max-width: 720px) {
    .stat-row-4 { grid-template-columns: repeat(2, 1fr); }
}

/* --- In-app table tools (search bar above a table) ------------------------- */
.table-tools { display: flex; gap: 10px; align-items: center; margin: 4px 0 18px; }
.table-tools input[type="search"] { flex: 1; max-width: 380px; }

/* Stripe connection status */
.conn-status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; }
.conn-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.conn-on .conn-dot { background: var(--green); }
.conn-off .conn-dot { background: var(--amber); }
.conn-off { color: var(--text-dim); }

/* --- Upgrade affordances --------------------------------------------------- */

/* Sidebar upsell card (free owners) */
.upsell { display: block; background: var(--iris); color: #fff; border-radius: var(--radius-sm); padding: 11px 12px; margin-bottom: 6px; }
.upsell:hover { background: var(--iris-press); color: #fff; text-decoration: none; }
.upsell-plan { display: block; font-family: var(--mono); font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; opacity: .85; margin-bottom: 2px; }
.upsell-cta { display: block; font-weight: 600; font-size: 14px; }

/* Limit banner with an inline action button */
.notice-cta { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.notice-cta > span { min-width: 0; }
.notice-cta .btn-primary { flex: 0 0 auto; }

.notice-warn { background: rgba(179, 118, 13, .08); border: 1px solid rgba(179, 118, 13, .3); color: #7a4f08; }

/* Ghost buttons on the dark sidebar need light text (e.g. Sign out) */
.console-rail .btn-ghost { color: #c7ccd6; border-color: rgba(255, 255, 255, .18); }
.console-rail .btn-ghost:hover { color: #fff; background: var(--ink-2); }

/* Inline field row (e.g. deadline + priority + save on one line) */
.field-row { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.field-row .field { flex: 1 1 180px; margin-bottom: 0; }
.field-row .field-narrow { flex: 0 0 auto; }
.field-row-action { align-self: flex-end; }

/* --- Pagination ------------------------------------------------------------ */
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 20px; }
.pager-info { font-size: 13px; color: var(--text-dim); font-family: var(--mono); }
.btn-ghost.is-disabled { opacity: .4; pointer-events: none; }

/* --- Client-side data tables (filter bar reuses .filter-bar) --------------- */
.dtable-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; flex-wrap: wrap; }
.dtable-perpage { font-size: 12.5px; color: var(--text-dim); display: inline-flex; align-items: center; gap: 7px; }
.dtable-perpage select { width: auto; min-width: 0; padding: 4px 8px; font: inherit; font-size: 12.5px; }
.dtable-pageinfo { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.dtable-foot .pager { margin-top: 0; }

/* --- Admin inline create / edit ------------------------------------------- */
.admin-create { margin-bottom: 18px; }
.admin-create > summary { display: inline-flex; align-items: center; cursor: pointer; list-style: none; }
.admin-create > summary::-webkit-details-marker { display: none; }
.admin-create > .panel { margin-top: 12px; }
.dt-detail > td { background: var(--paper); padding: 0; border-bottom: 1px solid var(--line); }
.dt-edit { padding: 18px 20px; max-width: 900px; margin: 0; }
.dt-edit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 13px 16px; align-items: end; }
.dt-edit-grid .field { margin: 0; min-width: 0; gap: 5px; }
.dt-edit-grid .field input, .dt-edit-grid .field select, .dt-edit-grid .field textarea { width: 100%; }
.dt-edit-grid .span-all { grid-column: 1 / -1; }
.dt-edit-checks { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 13px; }
.dt-edit-note { color: var(--text-dim); font-size: 13px; margin: 12px 0 0; }
.dt-edit-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); }
.check input { width: auto; margin: 0; }

/* --- Admin per-user associations (workspaces + projects) ------------------ */
.dt-assoc { padding: 16px 20px 20px; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px 28px; }
.dt-assoc-title { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-faint); font-weight: 600; margin: 0 0 10px; }
.dt-assoc-empty { font-size: 13px; margin: 0; }
.assoc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.assoc-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 8px 10px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; }
.assoc-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.assoc-name { font-weight: 600; font-size: 14px; }
.assoc-meta { font-size: 12.5px; }
.assoc-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.assoc-rename { position: relative; }
.assoc-rename > summary { list-style: none; cursor: pointer; }
.assoc-rename > summary::-webkit-details-marker { display: none; }
.assoc-rename-form { margin-top: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.assoc-rename-form input[type="text"] { width: auto; min-width: 180px; }

/* Breathing room between the plan fields and the Save button */
.plan-tile-form .form-actions { margin-top: 14px; }

/* --- Owner/creator mode toggle (sidebar) ---------------------------------- */
.console-mode-form { margin: 0 0 14px; }
.console-mode {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 9px 11px; font: inherit; font-size: 13.5px; cursor: pointer; text-align: left;
    color: #fff; background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .16); border-radius: var(--radius-sm);
    transition: background .12s ease, border-color .12s ease;
}
.console-mode:hover { background: rgba(90, 79, 224, .32); border-color: rgba(90, 79, 224, .6); }

/* --- Client share: distinct bubble + link row + public page ---------------- */
.msg-client { background: rgba(31, 158, 111, .10); border-color: rgba(31, 158, 111, .34); }
.msg-client .msg-author { color: var(--green); }

.share-link-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.share-link-input { flex: 1 1 280px; font-family: var(--mono); font-size: 12.5px; background: var(--paper); }

.share-page { max-width: 760px; margin: 0 auto; padding: 8px 20px 60px; }
.share-hero { padding: 28px 0 6px; }
.share-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.share-brief { color: var(--text); line-height: 1.6; margin: 0; }
.share-deliverables { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.share-deliverables a { font-family: var(--mono); font-size: 13px; }
.msg-replies { margin: 8px 0 0 22px; padding-left: 14px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.msg-form-actions { display: flex; justify-content: flex-end; margin-top: 8px; }
.share-foot { text-align: center; font-size: 12.5px; margin-top: 28px; }

/* --- Project offers ------------------------------------------------------- */
.nav-badge { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; border-radius: 9px; background: var(--iris); color: #fff; }
.offer-form { display: flex; align-items: center; gap: 6px; }
.offer-form .filter-select { min-width: 120px; }
.offer-card + .offer-card { margin-top: 14px; }
.offer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.offer-brief { color: var(--text); line-height: 1.55; margin: 4px 0 0; }
.offer-note { margin: 8px 0 0; }
.offer-actions { display: flex; gap: 10px; margin-top: 14px; }
.notice-info { background: rgba(90, 79, 224, .08); border: 1px solid rgba(90, 79, 224, .28); color: var(--ink); }

/* --- People hub ----------------------------------------------------------- */
.broadcast { margin-bottom: 18px; }
.broadcast-actions { display: flex; justify-content: flex-end; margin-top: 8px; }
.team-list { display: flex; flex-direction: column; }
.team-row { display: flex; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.team-row:first-child { border-top: 0; }
.team-id { display: flex; flex-direction: column; min-width: 180px; }
.team-projects { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 240px; }
.team-actions { margin-left: auto; }
.project-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; }
.project-chip a { color: var(--ink); text-decoration: none; }
.project-chip a:hover { text-decoration: underline; }
.chip-x { border: 0; background: transparent; color: var(--text-dim); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 4px; border-radius: 50%; }
.chip-x:hover { color: #fff; background: var(--amber); }
.subhead { font-size: 13px; color: var(--text-dim); margin: 18px 0 8px; }

/* --- Leaderboard ---------------------------------------------------------- */
.lb-table th, .lb-table td { white-space: nowrap; }
.lb-rank { font-family: var(--mono); color: var(--text-dim); font-weight: 600; }
.lb-score { min-width: 120px; }
.lb-score-num { font-family: var(--mono); font-weight: 600; }
.lb-bar { display: inline-block; vertical-align: middle; width: 64px; height: 6px; margin-left: 8px; background: var(--line); border-radius: 3px; overflow: hidden; }
.lb-bar-fill { display: block; height: 100%; background: var(--iris); border-radius: 3px; }
.badge-verified { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: rgba(31, 158, 111, .12); color: var(--green); border: 1px solid rgba(31, 158, 111, .3); margin-left: 4px; }
.badge-prov { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: rgba(179, 118, 13, .1); color: var(--amber); border: 1px solid rgba(179, 118, 13, .28); margin-left: 4px; }

/* --- Wide content (data-heavy pages like the leaderboard) ------------------ */
.console-content-wide { max-width: 1400px; }

/* Discipline shown as individual wrapping tags rather than one long token */
.lb-table .lb-disc { white-space: normal; }
.tag-list { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.lb-disc .tag-list { max-width: 340px; }

/* --- Brand logo image ----------------------------------------------------- */
.brand-logo { height: 26px; width: auto; max-height: 26px; max-width: 160px; display: block; }
.console-brand .brand-logo { height: 24px; max-height: 24px; width: auto; }

/* --- "My work" kanban board ----------------------------------------------- */
.kanban { display: flex; gap: 14px; align-items: flex-start; overflow-x: auto; padding-bottom: 6px; }
.kanban-col { flex: 1 1 0; min-width: 248px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.kanban-col-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.kanban-col-title { font-family: var(--mono); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--text-dim); }
.kanban-col-count { font-family: var(--mono); font-size: 11px; color: var(--text-faint); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.kanban-cards { display: flex; flex-direction: column; gap: 10px; }
.kanban-empty { font-size: 12px; color: var(--text-faint); margin: 2px 0 0; }
.kanban-card-form { margin: 0; }
.kanban-card {
    display: flex; flex-direction: column; gap: 6px; width: 100%; text-align: left; cursor: grab;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
    padding: 11px 12px; font: inherit; color: var(--ink); text-decoration: none;
    transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
}
.kanban-card:hover { border-color: var(--iris); box-shadow: var(--shadow); transform: translateY(-1px); text-decoration: none; }
.kanban-card:active { cursor: grabbing; }
.kanban-card.is-dragging { opacity: .45; }
.kanban-col.is-drop-target { border-color: var(--iris); box-shadow: inset 0 0 0 1px var(--iris); }
.kanban-card-studio { font-family: var(--mono); font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--teal); }
.kanban-card-title { font-weight: 600; font-size: 14px; line-height: 1.35; }
.kanban-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; }
.kanban-flag { font-family: var(--mono); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--amber); border: 1px solid currentColor; border-radius: 999px; padding: 1px 7px; }
.kanban-due { font-size: 11.5px; color: var(--text-dim); }
.kanban-due.is-overdue { color: var(--red); font-weight: 600; }

/* --- Notifications feed ---------------------------------------------------- */
.notif-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.notif-item { border-bottom: 1px solid var(--line); }
.notif-item:last-child { border-bottom: none; }
.notif-item.is-unread { background: color-mix(in srgb, var(--iris) 6%, var(--surface)); }
.notif-link, .notif-item > .notif-main { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 13px 16px; text-decoration: none; color: var(--ink); }
.notif-link:hover { background: var(--paper); text-decoration: none; }
.notif-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.notif-title { font-weight: 600; font-size: 14px; }
.notif-item.is-unread .notif-title::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--iris); margin-right: 8px; vertical-align: middle; }
.notif-body { font-size: 13px; color: var(--text-dim); }
.notif-time { font-size: 11.5px; color: var(--text-faint); white-space: nowrap; flex: none; }

/* --- "Start here" guide ----------------------------------------------------- */

.guide { max-width: 840px; }

.guide-hero {
    display: flex; align-items: center; justify-content: space-between;
    gap: 24px; flex-wrap: wrap;
    padding: 26px 28px; margin-bottom: 26px;
    border: 1px solid color-mix(in srgb, var(--iris) 22%, var(--line));
    border-radius: var(--radius);
    background: linear-gradient(135deg, color-mix(in srgb, var(--iris) 11%, var(--surface)), var(--surface) 62%);
    box-shadow: var(--shadow);
}
.guide-hero-text { flex: 1 1 320px; min-width: 0; }
.guide-eyebrow {
    font-family: var(--mono); font-size: 12px; letter-spacing: .08em;
    text-transform: uppercase; color: var(--iris); margin: 0 0 8px;
}
.guide-h1 { font-family: var(--display); font-weight: 600; font-size: 27px; line-height: 1.15; color: var(--ink); margin: 0 0 10px; }
.guide-lede { color: var(--text-dim); font-size: 15px; line-height: 1.6; max-width: 64ch; margin: 0; }

.guide-progress-card {
    flex: 0 0 auto; width: 150px; text-align: center;
    padding: 16px; border: 1px solid var(--line);
    border-radius: var(--radius-sm); background: var(--surface);
}
.guide-progress-num { font-family: var(--display); font-weight: 600; font-size: 34px; line-height: 1; color: var(--iris); margin: 0; }
.guide-progress-of { font-size: 18px; color: var(--text-faint); }
.guide-progress-label { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); margin: 6px 0 12px; }
.guide-progress-bar { display: block; height: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.guide-progress-fill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--iris), var(--teal)); border-radius: 999px; transition: width .35s ease; }

.guide-group { display: flex; align-items: center; gap: 13px; margin: 28px 2px 13px; }
.guide-group-badge {
    flex: 0 0 auto; width: 30px; height: 30px; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    font-family: var(--display); font-weight: 600; font-size: 15px; color: #fff; background: var(--ink);
}
.guide-group-text { min-width: 0; }
.guide-group-title { font-family: var(--display); font-weight: 600; font-size: 17px; color: var(--ink); margin: 0; }
.guide-group-sub { color: var(--text-dim); font-size: 13px; margin: 1px 0 0; }

.guide-sec {
    border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
    margin-bottom: 10px; overflow: hidden; transition: border-color .15s ease, box-shadow .15s ease;
}
.guide-sec:hover { box-shadow: var(--shadow); }
.guide-sec[open] { border-color: color-mix(in srgb, var(--iris) 38%, var(--line)); box-shadow: var(--shadow); }

.guide-sum {
    display: flex; align-items: center; gap: 14px;
    padding: 15px 16px; cursor: pointer; list-style: none;
    -webkit-tap-highlight-color: transparent;
}
.guide-sum::-webkit-details-marker { display: none; }
.guide-sum:hover { background: color-mix(in srgb, var(--iris) 4%, var(--surface)); }

.guide-num {
    flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-family: var(--display); font-weight: 600; font-size: 14px; color: var(--iris);
    background: color-mix(in srgb, var(--iris) 12%, var(--surface));
    border: 1.5px solid color-mix(in srgb, var(--iris) 30%, var(--line));
    transition: all .18s ease;
}
.guide-num-check { display: none; font-size: 15px; }
.guide-sec.is-done .guide-num { background: var(--green); border-color: var(--green); color: #fff; }
.guide-sec.is-done .guide-num-n { display: none; }
.guide-sec.is-done .guide-num-check { display: inline; }

.guide-sum-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.guide-sum-title { font-family: var(--display); font-weight: 600; font-size: 16px; color: var(--ink); }
.guide-sec.is-done .guide-sum-title { color: var(--text-dim); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--green) 55%, transparent); }

.guide-tag {
    font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: .04em;
    text-transform: uppercase; padding: 3px 8px; border-radius: 999px; white-space: nowrap; border: 1px solid;
}
.guide-tag[data-aud="all"]     { color: var(--text-dim); border-color: var(--line); background: var(--paper); }
.guide-tag[data-aud="owner"]   { color: var(--iris); border-color: color-mix(in srgb, var(--iris) 30%, var(--line)); background: color-mix(in srgb, var(--iris) 8%, var(--surface)); }
.guide-tag[data-aud="creator"] { color: var(--teal); border-color: color-mix(in srgb, var(--teal) 30%, var(--line)); background: color-mix(in srgb, var(--teal) 8%, var(--surface)); }
.guide-tag[data-aud="both"]    { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 30%, var(--line)); background: color-mix(in srgb, var(--amber) 8%, var(--surface)); }

.guide-chev { flex: 0 0 auto; color: var(--text-faint); transition: transform .2s ease; }
.guide-sec[open] .guide-chev { transform: rotate(180deg); }

.guide-body { padding: 4px 18px 18px 60px; border-top: 1px solid var(--line); }
.guide-body > :first-child { margin-top: 14px; }
.guide-body p { color: var(--text); line-height: 1.65; margin: 0 0 12px; }
.guide-body ul { margin: 0 0 12px; padding-left: 20px; color: var(--text); line-height: 1.65; }
.guide-body li { margin-bottom: 6px; }
.guide-body strong { color: var(--ink); }

.guide-done {
    appearance: none; cursor: pointer; margin-top: 4px;
    display: inline-flex; align-items: center; gap: 6px;
    border: 1px solid var(--line); background: var(--paper); color: var(--ink);
    border-radius: 999px; padding: 9px 16px; font-size: 13.5px; font-weight: 600;
    min-height: 38px; transition: all .15s ease;
}
.guide-done:hover { border-color: var(--iris); color: var(--iris); }
.guide-done-set { display: none; }
.guide-sec.is-done .guide-done { background: color-mix(in srgb, var(--green) 12%, var(--paper)); border-color: color-mix(in srgb, var(--green) 45%, var(--line)); color: var(--teal); }
.guide-sec.is-done .guide-done-idle { display: none; }
.guide-sec.is-done .guide-done-set { display: inline; }

@media (max-width: 640px) {
    .guide-hero { padding: 20px; }
    .guide-h1 { font-size: 23px; }
    .guide-progress-card { width: 100%; }
    .guide-sum { padding: 13px; gap: 11px; }
    .guide-body { padding: 2px 14px 16px; }
    .guide-done { width: 100%; justify-content: center; }
}

/* --- Workspace list (multi-workspace dashboard) ----------------------------- */

.back-link { display: inline-block; margin-bottom: 14px; color: var(--text-dim); font-size: 14px; text-decoration: none; }
.back-link:hover { color: var(--iris); }

.ws-filter { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-dim); cursor: pointer; }
.ws-filter input { cursor: pointer; }

.ws-rows { display: flex; flex-direction: column; }
.ws-row {
    display: flex; align-items: center; gap: 12px;
    padding: 15px 4px; border-top: 1px solid var(--line);
    color: var(--ink); text-decoration: none;
}
.ws-row:first-child { border-top: none; }
.ws-row:hover { background: color-mix(in srgb, var(--iris) 5%, transparent); }
.ws-name { font-family: var(--display); font-weight: 600; font-size: 16px; flex: 1; min-width: 0; }
.ws-work { font-family: var(--mono); font-size: 12.5px; color: var(--text-faint); white-space: nowrap; }
.ws-work.has-work { color: var(--teal); }
.ws-go { color: var(--text-faint); flex: 0 0 auto; }
.ws-row:hover .ws-go { color: var(--iris); }

@media (max-width: 640px) {
    .ws-row { flex-wrap: wrap; gap: 6px 10px; padding: 13px 2px; }
    .ws-name { flex: 1 0 100%; }
}

/* --- Notifications feed ----------------------------------------------------- */

.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-row {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 14px 4px; border-bottom: 1px solid var(--line);
}
.notif-row:last-child { border-bottom: 0; }
.notif-dot {
    flex: 0 0 8px; width: 8px; height: 8px; margin-top: 7px;
    border-radius: 50%; background: transparent;
}
.notif-row.is-unread .notif-dot { background: var(--iris); }
.notif-main { flex: 1; min-width: 0; }
.notif-title {
    font-family: var(--display); font-weight: 600; font-size: 15px;
    color: var(--ink); text-decoration: none;
}
a.notif-title:hover { color: var(--iris); }
.notif-body { color: var(--text-dim); font-size: 14px; line-height: 1.5; margin: 3px 0 0; }
.notif-time { flex: 0 0 auto; font-family: var(--mono); font-size: 12px; white-space: nowrap; }

@media (max-width: 640px) {
    .notif-row { flex-wrap: wrap; }
    .notif-time { flex-basis: 100%; margin-left: 20px; }
}

/* --- Account features: team remove + leave workspace ----------------------- */
.team-actions { display: flex; gap: 8px; align-items: center; }
.ws-list > li { display: flex; align-items: stretch; gap: 8px; }
.ws-list > li > form:first-child { flex: 1; min-width: 0; }
.ws-leave-form { display: flex; align-items: center; margin: 0; }
.ws-leave { white-space: nowrap; }

/* --- Admin overview: 5-up metrics + attention highlight -------------------- */
.stat-row-5 { grid-template-columns: repeat(5, 1fr); }
.stat-alert { border-color: color-mix(in srgb, var(--amber) 45%, var(--line)); background: color-mix(in srgb, var(--amber) 7%, var(--surface)); }
.stat-alert .stat-num { color: var(--amber); }
@media (max-width: 720px) {
    .stat-row-5 { grid-template-columns: repeat(2, 1fr); }
}

/* --- Workspace chat -------------------------------------------------------- */
.chat {
    display: flex; flex-direction: column;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.chat-log {
    display: flex; flex-direction: column; gap: 12px;
    padding: 20px; height: 58vh; min-height: 320px; overflow-y: auto;
}
.chat-empty { margin: auto; color: var(--text-faint); }
.chat-msg {
    max-width: 76%; align-self: flex-start;
    background: var(--paper); border: 1px solid var(--line);
    border-radius: var(--radius-sm); padding: 9px 13px;
}
.chat-msg.is-mine {
    align-self: flex-end;
    background: color-mix(in srgb, var(--iris) 10%, var(--surface));
    border-color: color-mix(in srgb, var(--iris) 28%, var(--line));
}
.chat-msg-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px; }
.chat-author { font-family: var(--display); font-weight: 600; font-size: 13px; color: var(--ink); }
.chat-msg.is-mine .chat-author { color: var(--iris); }
.chat-time { font-family: var(--mono); font-size: 11px; color: var(--text-faint); }
.chat-body { white-space: pre-wrap; word-break: break-word; line-height: 1.5; color: var(--text); }
.chat-composer {
    display: flex; align-items: flex-end; gap: 10px;
    padding: 14px 16px; border-top: 1px solid var(--line); background: var(--surface);
}
.chat-composer textarea {
    flex: 1; resize: none; min-height: 42px; max-height: 160px;
    font-family: var(--body); font-size: 14px; line-height: 1.5;
}
.chat-composer .btn-primary { flex: 0 0 auto; }

@media (max-width: 640px) {
    .chat-log { height: 62vh; padding: 14px; }
    .chat-msg { max-width: 88%; }
    .chat-composer { padding: 12px; }
}

/* --- Landing: free-trial callouts ------------------------------------------ */
.hero-trial { margin: 16px 0 0; font-size: 14.5px; color: var(--text-dim); }
.hero-trial strong { color: var(--iris); }
.price-trial {
    margin: 2px 0 14px; padding: 8px 12px;
    font-size: 13px; line-height: 1.4; color: var(--teal);
    background: color-mix(in srgb, var(--teal) 9%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--teal) 28%, var(--line));
    border-radius: var(--radius-sm);
}
.price-trial strong { color: var(--teal); }

/* --- Mobile polish: landing, headers, forms, grids ------------------------- */
@media (max-width: 640px) {
    /* Page headers: let the action button drop below the title instead of squeezing. */
    .page-head { flex-wrap: wrap; }
    .page-head > a, .page-head > .btn-primary, .page-head > .btn-ghost { flex: 0 0 auto; }

    /* Belt-and-braces: the landing page never scrolls sideways. */
    .layout-landing { overflow-x: clip; }

    /* Toolbars and filter rows wrap instead of overflowing. */
    .table-tools, .filter-bar, .dtable-foot { flex-wrap: wrap; }
    .table-tools input[type="search"] { max-width: 100%; }

    /* Admin plan editor: two-column field grid stacks. */
    .plan-grid { grid-template-columns: 1fr; }

    /* Landing nav stacks and wraps. */
    .landing-nav { flex-wrap: wrap; gap: 10px 14px; padding: 14px 18px; }
    .landing-nav-links { flex-wrap: wrap; gap: 10px 14px; font-size: 14px; }

    /* Hero: tighter spacing, full-width stacked CTAs. */
    .hero { padding: 40px 0 36px; }
    .hero-sub { font-size: 16px; }
    .hero-cta { flex-direction: column; }
    .hero-cta .btn-primary, .hero-cta .btn-ghost { width: 100%; text-align: center; }

    /* Sections + closing band breathe less on small screens. */
    .pain, .how { padding: 40px 0; }
    .pricing-section { padding: 44px 16px; }
    .cta-band { margin: 28px 0 40px; padding: 36px 20px; }
    .cta-title { font-size: 23px; }
    .section-title { font-size: 23px; }
    .landing-foot { flex-direction: column; align-items: flex-start; }
}
