@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

/* ==========================================================
   AI Matterz theme
   Light green #77CC35 | Dark green #002619 | Ink #252522
   Page bg #F2F9ED | Font: Geist
   ========================================================== */
:root {
    --lime: #77CC35;
    --lime-dark: #5FB024;
    --lime-soft: #E4F5D3;
    --forest: #002619;
    --forest-2: #0B3A2A;
    --ink: #252522;
    --muted: #66705F;
    --paper: #F2F9ED;
    --paper-40: rgb(242 249 237 / .4);
    --white: #fff;
    --accent-ink: #3E8A14;
    --gold: #F4B740;
    --red: #C94355;
    --line: #DCE8D3;
    --shadow: 0 18px 55px rgba(0, 38, 25, .12);
    --radius: 10px;

    /* legacy aliases so existing inline styles / views keep working */
    --navy: var(--forest);
    --purple: var(--forest);
    --purple2: var(--lime);
    --green: var(--lime);
    --green2: var(--lime-dark);
}

* {
    box-sizing: border-box
}

html {
    scroll-behavior: smooth
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: 'Geist', Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased
}

h1,
h2,
h3,
h4 {
    font-weight: 700;
    letter-spacing: -.02em
}

a {
    color: inherit;
    text-decoration: none
}

button,
input,
textarea,
select {
    font: inherit
}

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

/* ---------- Topbar / brand ---------- */
.topbar {
    height: 90px;
    /* padding: 0 max(24px, calc((100vw - 1180px)/2)); */
    padding: 24px 50px 24px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, .92);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 40;
    backdrop-filter: blur(12px)
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px
}

.brand>span:last-child {
    display: flex;
    flex-direction: column;
    line-height: 1.15
}

.brand strong {
    font-size: 17px;
    letter-spacing: -.02em
}

.brand small {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: .02em;
    margin-top: 4px
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: var(--lime);
    font-weight: 800;
    font-size: 21px;
    background: var(--forest);
    box-shadow: 0 8px 22px rgba(0, 38, 25, .22)
}

nav {
    display: flex;
    gap: 6px;
    align-items: center
}

nav a {
    padding: 9px 13px;
    border-radius: 10px;
    color: #3C463A;
    font-size: 14px;
    font-weight: 500;
    transition: .2s background, .2s color
}

.signout_btn {
    color: #da0b0b !important;
     border: none !important;

}

.signout_btn:hover {
    border: 1px solid #da0b0b !important;
    background: none !important;
    color: #da0b0b !important;
    border-radius: 5px;

}

nav a:hover {
    background: var(--lime-soft);
    color: var(--forest)
}

.page-shell {
    /* max-width: 1180px; */
    margin: 0 auto;
    padding: 24px 40px;
}

.footer {
    min-height: 78px;
    padding: 22px 40px;
    background: var(--forest);
    color: rgba(255, 255, 255, .72);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px
}

.footer a:hover {
    color: var(--lime)
}


/* ---------- Logo ---------- */
.brand picture {
    display: block;
    line-height: 0
}

.brand-logo {
    display: block;
    height: auto;
    width: 150px;
}

.footer-brand {
    display: inline-flex;
    line-height: 0
}

.footer-logo {
    display: block;
    height: auto;
    width: 150px;
}

nav a.signout_btn {
    margin-left: 6px;
    border: 1px solid var(--line);
    color: var(--forest);
    font-weight: 600
}

nav a.signout_btn:hover {
    border-color: var(--lime);
    background: var(--lime-soft)
}

@media(max-width:620px) {
    .brand-logo {
        height: 38px
    }

    .footer-logo {
        height: 32px
    }
}


/* ---------- Hero (light, with dark dashboard card) ---------- */
.hero {
    min-height: 540px;
    border-radius: 10px;
    padding: 40px;
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    gap: 60px;
    align-items: center;
    background:
        radial-gradient(circle at 92% 8%, rgba(118, 204, 53, 0.842), transparent 36%),
        radial-gradient(circle at 4% 96%, rgba(119, 204, 53, .16), transparent 34%),
        #fff;
    border: 1px solid var(--line);
    color: var(--ink);
    overflow: hidden;
    position: relative
}

.hero:after {
    content: "";
    position: absolute;
    width: 240px;
    height: 240px;
    border: 1px solid rgba(119, 204, 53, .35);
    border-radius: 50%;
    left: -80px;
    bottom: -100px
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 24px;
    border-radius: 15px;
    background: var(--lime-soft);
    border: 1px solid #C9E8AE;
    color: var(--forest);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em
}

.eyebrow:before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--lime)
}

.hero h1 {
    font-size: clamp(42px, 6vw, 48px);
    line-height: 1;
    letter-spacing: -.045em;
    font-weight: 700;
    margin: 18px 0 24px;
    max-width: 720px;
    color: var(--forest)
}

.hero h1 .hl,
.hl {
    color: var(--lime)
}

.hero-copy>p {
    font-size: 16px;
    line-height: 1.65;
    color: var(--muted);
    max-width: 650px
}

.hero-actions {
    display: flex;
    gap: 12px;
    margin-top: 34px;
    flex-wrap: wrap
}

/* ---------- Buttons ---------- */
.btn {
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 12px 18px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: .2s transform, .2s box-shadow, .2s background, .2s color, .2s border-color
}

.btn:hover {
    transform: translateY(-1px)
}

.btn-primary {
    /* background: var(--forest); */
    background: #25463b;
    color: #fff;
    box-shadow: 0 10px 24px rgba(0, 38, 25, .22)
}

.btn-primary:hover {
    background: var(--forest-2)
}

/* optional: dark button with lime arrow tile, as in the reference */
.btn-arrow {
    padding-right: 8px
}

.btn-arrow:after {
    content: "\2192";
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    margin-left: 6px;
    border-radius: 7px;
    background: var(--lime);
    color: var(--forest);
    font-weight: 700
}

.btn-secondary {
    background: #fff;
    color: var(--forest);
    border-color: var(--line)
}

.btn-secondary:hover {
    border-color: var(--lime);
    background: var(--lime-soft)
}

.btn-outline {
    background: transparent;
    /* border-color: var(--line); */
    color: var(--ink)
}

.btn-outline:hover {
    border-color: var(--lime);
    background: var(--lime-soft)
}

.btn-danger {
    background: #FFF0F2;
    color: var(--red)
}

.btn-small {
    padding: 8px 20px;
    border-radius: 5px;
    font-size: 14px
}

/* ---------- Hero card (dashboard-style, dark green) ---------- */
.hero-card {
    background: linear-gradient(160deg, var(--forest), var(--forest-2));
    color: #fff;
    border: 1px solid rgba(119, 204, 53, .25);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 24px 70px rgba(0, 38, 25, .28)
}

.hero-card blockquote {
    font-size: 19px;
    line-height: 1.45;
    margin: 30px 0 38px
}

.live-dot {
    font-size: 12px;
    font-weight: 600;
    color: var(--lime);
    text-transform: uppercase;
    letter-spacing: .1em
}

.live-dot:before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--lime);
    margin-right: 9px;
    box-shadow: 0 0 0 5px rgba(119, 204, 53, .18)
}

.mini-score {
    display: flex;
    gap: 16px;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, .14);
    padding-top: 22px
}

.mini-score strong {
    font-size: 38px;
    color: var(--lime)
}

.mini-score span {
    color: rgba(255, 255, 255, .75);
    font-size: 13px
}

/* ---------- Feature grid / cards ---------- */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin: 24px 0
}

.feature-grid article,
.card {
    max-width: 960px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px;
    box-shadow: 0 8px 25px rgba(0, 38, 25, .05)
}

.feature-grid h3 {
    font-size: 22px;
    margin: 10px 0 4px
}

.feature-grid p,
.muted {
    color: var(--muted)
}

.step {
    display: inline-grid;
    place-items: center;
    min-width: 34px;
    height: 26px;
    padding: 0 9px;
    border-radius: 99px;
    background: var(--lime-soft);
    color: var(--forest);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: .06em
}


/* ---------- Feature cards with images ---------- */
.feature-grid .feature-card {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: .2s transform, .2s box-shadow, .2s border-color
}

.feature-grid .feature-card:hover {
    transform: translateY(-3px);
    border-color: var(--lime);
    box-shadow: 0 18px 42px rgba(0, 38, 25, .12)
}

.feature-media {
    aspect-ratio: 16 / 10;
    background: linear-gradient(145deg, var(--lime-soft), var(--paper));
    border-bottom: 1px solid var(--line);
    overflow: hidden
}

.feature-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease
}

.feature-card:hover .feature-media img {
    transform: scale(1.04)
}

.feature-body {
    padding: 24px 26px 28px
}

.feature-body h3 {
    margin: 14px 0 6px
}

.feature-body p {
    margin: 0
}


/* ---------- Principle (dark green CTA block) ---------- */
.principle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    padding: 56px 54px;
    margin-top: 22px;
    background:
        radial-gradient(circle at 85% 20%, rgba(119, 204, 53, .22), transparent 40%),
        linear-gradient(135deg, var(--forest), var(--forest-2));
    color: #fff;
    border-radius: 10px;
    border: 1px solid rgba(119, 204, 53, .2)
}

.principle .eyebrow {
    background: rgba(119, 204, 53, .14);
    border-color: rgba(119, 204, 53, .4);
    color: var(--lime)
}

.principle h2 {
    font-size: 32px;
    line-height: 1.15;
    margin: 14px 0
}

.principle p {
    font-size: 17px;
    color: rgba(255, 255, 255, .78)
}

/* ---------- Auth ---------- */
.img_cont
{ 
    display: flex;
    justify-content: center;
    align-items: center;

}
.auth-logo {
    display: block;
    height: auto;
    width: 150px;
    align-self: flex-start;
   
    
    
}

.auth-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 960px;
    margin: 55px auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow)
}

.auth-card {
    padding: 52px
}

.auth-card h1 {
    font-size: 38px;
    margin: 12px 0 4px;
    text-align: center;
}

.auth-card>p {
    color: var(--muted);
    margin-bottom: 28px;
    text-align: center;
}

.auth-aside {
    padding: 52px;
    background:
        radial-gradient(circle at 90% 8%, rgba(119, 204, 53, .24), transparent 40%),
        linear-gradient(145deg, var(--forest), var(--forest-2));
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center
}

.auth-aside h2 {
    font-size: 30px;
    margin-bottom: 0;
}

/* ---------- Forms ---------- */
.stack {
    display: grid;
    gap: 18px
}

.field {
    display: flex;
    flex-direction: column;
    gap: 7px
}

.field>span {
    font-size: 13px;
    font-weight: 600;
    color: #2F392D
}

.field small {
    color: var(--muted);
    font-size: 12px
}

.field input,
.field textarea,
.field select {
    width: 100%;
    border: 1px solid #CFDCC5;
    border-radius: 10px;
    background: #fff;
    padding: 11px 13px;
    color: var(--ink);
    outline: none;
    transition: .2s border-color, .2s box-shadow
}

.field textarea {
    min-height: 105px;
    resize: vertical
}

.field input:focus,
.field textarea:focus,
.field select:focus {
    border-color: var(--lime);
    box-shadow: 0 0 0 4px rgba(119, 204, 53, .22)
}

.check-list {
    list-style: none;
    padding: 0;
    margin: 20px 0
}

.check-list li {
    padding: 10px 0 10px 30px;
    position: relative;
    color: rgba(255, 255, 255, .85)
}

.check-list li:before {
    content: "\2713";
    position: absolute;
    left: 0;
    color: var(--lime);
    font-weight: 800
}

.alert {
    padding: 13px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
    /* max-width: 960px; */
}

.alert-error {
    background: #FFF0F2;
    border: 1px solid #F3CAD0;
    color: #9C2638
}

.alert-success {
    background: var(--lime-soft);
    border: 1px solid #BFE39D;
    color: #2A5E0B
}

.alert-info {
    background: #EDF6FF;
    border: 1px solid #CFE0F5;
    color: #2D579D
}

/* ---------- Setup ---------- */
/* ---------- Setup ---------- */
.setup-page {
    background:
        radial-gradient(circle at 85% 8%, #77cc3538, transparent 38%),
        linear-gradient(145deg, var(--forest), #20562b);
    min-height: 100vh;
    padding: 35px;
    display: grid;
    place-items: center
}

.setup-shell {
    width: 100%;
    max-width: 1020px;
    margin: auto
}

.setup-card {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.719);
    /* border: 1px solid rgb(23 72 35); */
}

/* left panel */
.setup-aside {
    padding: 40px 34px;
    display: flex;
    flex-direction: column;
    color: #fff;
    background:
        radial-gradient(circle at 100% 0%, rgba(119, 204, 53, .22), transparent 55%),
        linear-gradient(170deg, var(--forest-2), var(--forest))
}

.setup-logo {
    height: 56px;
    width: auto;
    align-self: flex-start
}

.setup-aside h2 {
    font-size: 27px;
    line-height: 1.15;
    margin: 38px 0 10px
}

.setup-aside p {
    color: rgba(255, 255, 255, .75);
    font-size: 15px;
    margin: 0
}

.setup-aside .check-list {
    margin: 26px 0
}

.setup-aside .check-list li {
    padding: 9px 0 9px 30px;
    font-size: 14px
}

.setup-foot {
    margin-top: auto;
    padding-top: 20px;
    color: rgba(255, 255, 255, .5);
    font-size: 12px
}

/* right panel */
.setup-main {
    padding: 44px 46px
}

.setup-main h1 {
    font-size: 34px;
    margin: 0 0 6px;
    color: var(--forest)
}

.lead {
    color: var(--muted);
    margin: 0 0 22px
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 17px;
    counter-reset: step
}

.form-grid h2 {
    grid-column: 1/-1;
    counter-increment: step;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0 0;
    padding-top: 22px;
    border-top: 1px solid var(--line);
    font-size: 17px;
    color: var(--forest)
}

.form-grid h2:before {
    content: counter(step);
    flex: none;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: var(--forest);
    color: var(--lime);
    font-size: 13px;
    font-weight: 700
}

.form-grid input[type=hidden]+h2 {
    border-top: 0;
    padding-top: 0;
    margin-top: 4px
}

.form-grid .btn[type=submit] {
    margin-top: 10px;
    padding-top: 14px;
    padding-bottom: 14px
}

.span-2 {
   
    grid-column: 1/-1
}

.span-3 {
    display: flex;
    justify-content: end;
    /* grid-column: 1/-1 */
}
.success-panel {
    text-align: center;
    padding: 40px 10px
}

.success-icon {
    width: 68px;
    height: 68px;
    margin: 0 auto 18px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--lime-soft);
    border: 2px solid var(--lime);
    color: var(--forest);
    font-size: 30px;
    font-weight: 700
}

.success-panel h1 {
    margin-top: 0
}

.success-panel code {
    background: var(--paper);
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 13px
}

/* ---------- Page heading / stats / tables ---------- */
.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px
}

.page-heading h1 {
    font-size: 38px;
    letter-spacing: -.035em;
    margin: 8px 0 0;
    color: var(--forest)
}

.page-heading p {
    color: var(--muted);
    margin: 5px 0
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin: 0 0 24px
}

.stat-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 20px
}

.stat-card strong {
    font-size: 30px;
    display: block;
    color: var(--forest)
}

.stat-card span {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .07em
}

.table-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 5px;
    overflow: hidden
}

.table-toolbar {
    padding: 20px 22px;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center
}

.table-toolbar h2 {
    margin: 0;
    font-size: 19px
}

.data-table {
    width: 100%;
    border-collapse: collapse
}

.data-table th,
.data-table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid #EAF1E4;
    font-size: 14px
}

.data-table th {
    background: var(--paper);
    color: #5C6A55;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em
}

.data-table tbody tr:hover td {
    background: var(--paper-40)
}

.data-table tr:last-child td {
    border-bottom: 0
}

.badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em
}

.badge-published,
.badge-open,
.badge-evaluated {
    background: var(--lime-soft);
    color: #2A5E0B
}

.badge-draft,
.badge-active {
    background: #FFF6DF;
    color: #8A5A00
}

.badge-closed,
.badge-archived {
    background: #EEF1EC;
    color: #586155
}

.action-row {
    display: flex;
    gap: 7px;
    flex-wrap: wrap
}

.empty-state {
    text-align: center;
    padding: 55px 25px
}

.empty-state h3 {
    font-size: 24px;
    margin-bottom: 6px
}

/* ---------- Builder ---------- */
.builder-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 22px;
    align-items: start
}

.builder-section {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 26px;
    margin-bottom: 18px
}

.builder-section h2 {
    font-size: 20px;
    margin: 0 0 4px
}

.builder-section>p {
    color: var(--muted);
    font-size: 14px;
    margin: 0 0 20px
}

.fields-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 17px
}

.builder-nav {
    position: sticky;
    top: 98px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 16px
}

.builder-nav a {
    display: block;
    padding: 10px 12px;
    border-radius: 9px;
    font-size: 14px;
    color: #4F5A4B;
    transition: .2s background, .2s color
}

.builder-nav a:hover {
    background: var(--lime-soft);
    color: var(--forest)
}

.builder-nav .btn {
    margin-top: 12px;
    width: 100%
}

.rubric-row {
    display: grid;
    grid-template-columns: 1fr 90px 1.5fr 42px;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center
}

.rubric-row input {
    border: 1px solid #CFDCC5;
    border-radius: 9px;
    padding: 9px;
    outline: none
}

.rubric-row input:focus {
    border-color: var(--lime);
    box-shadow: 0 0 0 3px rgba(119, 204, 53, .2)
}

.icon-button {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 9px;
    background: #FFF0F2;
    color: var(--red);
    cursor: pointer;
    font-weight: 800
}

/* ---------- Chat ---------- */
/* ---------- Chat ---------- */
.chat-layout {
    display: grid;
    grid-template-columns: 1fr 0.6fr;
    gap: 22px;
    align-items: start
}

.chat-panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: clamp(560px, calc(100vh - 300px), 820px);
    box-shadow: 0 12px 40px rgba(0, 38, 25, .07)
}

/* header */
.chat-head {
    padding: 16px 22px;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    background: #fff
}

.chat-who {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0
}

.avatar {
    flex: none;
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--forest);
    color: var(--lime);
    font-weight: 700;
    font-size: 18px
}

.avatar:after {
    content: "";
    position: absolute;
    right: -3px;
    bottom: -3px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--lime);
    border: 2px solid #fff
}

.chat-head h2 {
    font-size: 16px;
    line-height: 1.3;
    margin: 0
}

.chat-sub {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px
}

.chat-meter {
    flex: none;
    text-align: right
}

.chat-meter small {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 500
}

.progress-track {
    height: 7px;
    background: #E3ECDC;
    border-radius: 99px;
    width: 150px;
    overflow: hidden
}

.progress-fill {
    height: 100%;
    background: var(--lime);
    border-radius: 99px;
    transition: width .4s ease
}

/* messages */
.messages {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    flex: 1;
    max-height: none;
    background: var(--paper-40);
    scroll-behavior: smooth;
    scrollbar-width: thin
}

.message {
    max-width: 76%;
    padding: 12px 16px 10px;
    border-radius: 16px;
    white-space: pre-wrap;
    font-size: 15px;
    line-height: 1.6;
    box-shadow: 0 1px 2px rgba(0, 38, 25, .05);
    animation: msgIn .25s ease both
}

.message:before {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .03em;
    margin-bottom: 4px
}

.message.assistant {
    background: #fff;
    border: 1px solid var(--line);
    border-top-left-radius: 5px
}

.message.assistant:before {
    content: "AI counterpart";
    color: var(--accent-ink)
}

.message.user {
    background: var(--forest);
    color: #fff;
    margin-left: auto;
    border-top-right-radius: 5px
}

.message.user:before {
    content: "You";
    color: var(--lime)
}

.message small {
    display: block;
    margin-top: 6px;
    text-align: right;
    font-size: 11px;
    color: var(--muted)
}

.message.user small {
    color: rgba(255, 255, 255, .6)
}

.typing {
    opacity: .7;
    font-style: italic
}

@keyframes msgIn {
    from {
        opacity: 0;
        transform: translateY(6px)
    }

    to {
        opacity: 1;
        transform: none
    }
}

/* composer */
.chat-compose {
    border-top: 1px solid var(--line);
    padding: 14px 16px;
    display: flex;
    gap: 10px;
    align-items: flex-end;
    background: #fff
}

.chat-compose textarea {
    flex: 1;
    min-height: 30px;
    max-height: 140px;
    border: 1px solid #CFDCC5;
    border-radius: 10px;
    padding: 13px 14px;
    resize: vertical;
    outline: none;
    background: #fff;
    transition: .2s border-color, .2s box-shadow
}

.chat-compose textarea:focus {
    border-color: var(--lime);
    box-shadow: 0 0 0 4px rgba(119, 204, 53, .22)
}

.chat-compose textarea:disabled {
    background: #F1F4EE;
    cursor: not-allowed
}

.chat-compose .btn {
    /* height: 52px; */
    padding: 12px 40px;
    border-radius: 5px
}

.btn:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none
}

/* mode badge */
#mode-badge {
    background: var(--lime-soft);
    color: var(--forest);
    border: 1px solid #C9E8AE;
    padding: 6px 12px;
    align-items: center;
    gap: 8px
}

#mode-badge:before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--lime);
    animation: pulse 1.8s infinite
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(119, 204, 53, .5)
    }

    70% {
        box-shadow: 0 0 0 7px rgba(119, 204, 53, 0)
    }

    100% {
        box-shadow: 0 0 0 0 rgba(119, 204, 53, 0)
    }
}

/* sidebar */
.chat-side {
    position: sticky;
    top: 96px;
    max-height: calc(100vh - 116px);
    overflow-y: auto;
    display: grid;
    gap: 16px;
    scrollbar-width: thin
}

.simulation-brief {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 22px 22px
}

.brief-head {
    padding: 14px 0 6px
}

.brief-item {
    border-bottom: 1px solid #EAF1E4
}

.brief-item summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    font-weight: 600;
    font-size: 15px
}

.brief-item summary::-webkit-details-marker {
    display: none
}

.brief-item summary:after {
    content: "+";
    flex: none;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    background: var(--lime-soft);
    color: var(--forest);
    font-weight: 700
}

.brief-item[open] summary:after {
    content: "\2013"
}

.brief-item p {
    margin: 0 0 14px;
    font-size: 14px;
    color: #4F5A4B
}

.brief-lens {
    padding: 16px 0 2px
}

.brief-lens h3 {
    font-size: 15px;
    margin: 0 0 8px
}

.lens-row {
    margin: 10px 0
}

.lens-row .bar {
    height: 6px;
    margin: 5px 0 0
}

.simulation-brief .note {
    margin-top: 14px
}

.btn-block {
    width: 100%;
    margin-top: 16px
}

.brief-hint {
    display: block;
    margin-top: 8px;
    text-align: center;
    font-size: 12px
}

.decision-drawer {
    display: none;
    margin-top: 0
}

.decision-drawer.is-open {
    display: block
}

.decision-drawer.card {
    border-top: 3px solid var(--lime)
}

.decision-drawer h3 {
    margin: 8px 0 4px
}

.decision-drawer .note {
    margin: 14px 0
}

.decision-drawer .field textarea {
    min-height: 84px
}

@media(max-width:900px) {
    .chat-layout {
        grid-template-columns: 1fr
    }

    .chat-panel {
        height: calc(100vh - 170px);
        min-height: 520px
    }

    .chat-side {
        position: static;
        max-height: none;
        overflow: visible
    }
}

@media(max-width:620px) {
    .chat-head {
        flex-wrap: wrap
    }

    .chat-meter {
        width: 100%;
        text-align: left
    }

    .progress-track {
        width: 100%
    }

    .messages {
        padding: 16px
    }

    .chat-compose .btn {
        padding: 0 16px
    }
}

/* ---------- Results ---------- */
.score-hero {
    border-radius: 24px;
    padding: 34px;
    background:
        radial-gradient(circle at 92% 10%, rgba(119, 204, 53, .24), transparent 38%),
        linear-gradient(135deg, var(--forest), var(--forest-2));
    color: #fff;
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 28px;
    align-items: center
}

.score-ring {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: conic-gradient(var(--lime) var(--scorepct), rgba(255, 255, 255, .14) 0);
    position: relative
}

.score-ring:after {
    content: "";
    position: absolute;
    width: 108px;
    height: 108px;
    border-radius: 50%;
    background: var(--forest)
}

.score-ring strong {
    position: relative;
    z-index: 1;
    font-size: 38px
}

.score-hero h1 {
    margin: 4px 0 8px;
    font-size: 32px
}

.score-hero p {
    color: rgba(255, 255, 255, .78)
}

.result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-top: 20px
}

.result-grid .card h2 {
    font-size: 19px;
    margin-top: 0
}

.rubric-result {
    margin: 14px 0
}

.rubric-top {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    font-size: 13px;
    font-weight: 600
}

.bar {
    height: 8px;
    background: #E6EEE0;
    border-radius: 99px;
    margin: 7px 0
}

.bar span {
    display: block;
    height: 100%;
    border-radius: 99px;
    background: var(--lime)
}

.plan-item {
    border-left: 3px solid var(--lime);
    padding: 4px 0 4px 15px;
    margin: 14px 0
}

.plan-item strong {
    display: block
}

.plan-item small {
    display: block;
    color: var(--muted);
    margin-top: 3px
}

.code-box {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: .17em;
    color: var(--forest);
    background: var(--lime-soft);
    border: 1px dashed var(--lime);
    padding: 14px 20px;
    border-radius: 14px;
    display: inline-block
}

/* ---------- Join ---------- */
.join-card {
    max-width: 620px;
    margin: 55px auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 40px;
    box-shadow: var(--shadow)
}

.join-card h1 {
    font-size: 36px;
    margin: 12px 0 4px
}

.join-card>p {
    color: var(--muted)
}

.join-step {
    display: none
}

.join-step.active {
    display: block
}

.note {
    font-size: 13px;
    color: #6B5A22;
    padding: 12px 14px;
    border-left: 3px solid var(--gold);
    background: #FFF9E9;
    border-radius: 0 8px 8px 0
}

.kpi-row {
    display: flex;
    gap: 18px;
    flex-wrap: wrap
}

.kpi {
    padding: 14px 18px;
    border-radius: 13px;
    background: var(--paper)
}

.kpi strong {
    display: block;
    font-size: 21px;
    color: var(--forest)
}

.kpi span {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase
}

.danger-zone {
    border-color: #F0C8CF;
    background: #FFFAFB
}

/* ---------- Responsive ---------- */
@media(max-width:900px) {
    .hero {
        grid-template-columns: 1fr;
        padding: 42px
    }

    .hero-card {
        display: none
    }

    .feature-grid,
    .stat-grid {
        grid-template-columns: 1fr 1fr
    }

    .principle,
    .auth-wrap,
    .builder-layout,
    .chat-layout,
    .result-grid {
        grid-template-columns: 1fr
    }

    .builder-nav {
        position: static
    }

    .score-hero {
        grid-template-columns: 1fr;
        text-align: center
    }

    .score-ring {
        margin: auto
    }

    .setup-card {
        grid-template-columns: 1fr
    }

    .setup-aside {
        padding: 30px 28px
    }

    .setup-aside h2 {
        margin-top: 24px
    }

    .setup-aside .check-list {
        display: none
    }
}

@media(max-width:620px) {
    .topbar {
        padding: 0 15px
    }

    .brand small {
        display: none
    }

    nav a {
        font-size: 12px;
        padding: 8px
    }

    nav a:nth-child(2) {
        display: none
    }

    .page-shell {
        padding: 24px 14px 50px
    }

    .hero {
        padding: 34px 24px;
        min-height: 470px
    }

    .hero h1 {
        font-size: 45px
    }

    .feature-grid,
    .stat-grid,
    .fields-2,
    .form-grid {
        grid-template-columns: 1fr
    }

    .span-2 {
        grid-column: auto
    }

     .span-3 {
        grid-column: auto
    }

    .principle,
    .auth-card,
    .auth-aside,
    .setup-card {
        padding: 28px
    }

    .footer {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start
    }

    .page-heading {
        align-items: flex-start;
        flex-direction: column
    }

    .rubric-row {
        grid-template-columns: 1fr 70px 42px
    }

    .rubric-row input:nth-child(3) {
        grid-column: 1/-1
    }

    .message {
        max-width: 90%
    }

    .data-table {
        display: block;
        overflow-x: auto
    }

    .principle,
    .auth-card,
    .auth-aside {
        padding: 28px
    }

    .setup-page {
        padding: 14px
    }

    .setup-main {
        padding: 28px 22px
    }
}

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