@font-face {
    font-family: "IRANSansFaNum";
    src: url("./fonts/IRANSansFaNum-UltraLight.ttf") format("truetype");
    font-style: normal;
    font-weight: 200;
    font-display: swap;
}
@font-face {
    font-family: "IRANSansFaNum";
    src: url("./fonts/IRANSansFaNum-Light.ttf") format("truetype");
    font-style: normal;
    font-weight: 300;
    font-display: swap;
}
@font-face {
    font-family: "IRANSansFaNum";
    src: url("./fonts/IRANSansFaNum-Regular.ttf") format("truetype");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: "IRANSansFaNum";
    src: url("./fonts/IRANSansFaNum-Medium.ttf") format("truetype");
    font-style: normal;
    font-weight: 500;
    font-display: swap;
}
@font-face {
    font-family: "IRANSansFaNum";
    src: url("./fonts/IRANSansFaNum-Bold.ttf") format("truetype");
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}
@font-face {
    font-family: "IRANSansFaNum";
    src: url("./fonts/IRANSansFaNum-Black.ttf") format("truetype");
    font-style: normal;
    font-weight: 900;
    font-display: swap;
}

:root {
    --ink: #17231d;
    --ink-soft: #536058;
    --paper: #f4f3ec;
    --surface: #ffffff;
    --line: #dcded6;
    --green: #1f6b4f;
    --green-deep: #123d2e;
    --green-soft: #dcebe3;
    --gold: #c49a4a;
    --navy: #12211c;
    --danger: #a83d36;
    --warning: #8a6317;
    --shadow: 0 16px 40px rgba(28, 42, 35, 0.08);
    --radius: 18px;
    --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
html[dir="rtl"] body,
[dir="rtl"] {
    font-family: "IRANSansFaNum", var(--sans);
}
html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] .brand,
html[dir="rtl"] .step-number,
html[dir="rtl"] .workflow-number {
    font-family: "IRANSansFaNum", var(--sans);
}
html[dir="rtl"] body { text-align: right; }
html[dir="rtl"] h1,
html[dir="rtl"] h2 { letter-spacing: 0; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 {
    font-family: var(--serif);
    font-weight: 500;
    line-height: 1.08;
    letter-spacing: -0.035em;
}
h3 { line-height: 1.3; }
code {
    background: #eef0eb;
    border-radius: 5px;
    padding: 2px 6px;
    font-size: .9em;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: #fff;
    font-size: 18px;
    font-weight: 750;
    letter-spacing: -.02em;
}
.brand-dark { color: var(--ink); }
.brand-mark {
    display: inline-grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 9px;
    background: var(--gold);
    color: var(--navy);
    font-family: var(--serif);
    font-size: 21px;
    font-weight: 700;
}
.eyebrow {
    display: block;
    margin-bottom: 12px;
    color: var(--green);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .17em;
    text-transform: uppercase;
}
.eyebrow-light { color: #a9d0bc; }
[dir="rtl"] .eyebrow,
[dir="rtl"] .sidebar-kicker,
[dir="rtl"] .stage-range,
[dir="rtl"] .stats-grid span,
[dir="rtl"] .search-field,
[dir="rtl"] .compact-search,
[dir="rtl"] .member-add-form label {
    letter-spacing: 0;
    text-transform: none;
}
.button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 9px;
    cursor: pointer;
    font-weight: 750;
    line-height: 1;
    white-space: nowrap;
    transition: transform .18s ease, background .18s ease, border .18s ease;
}
.button:hover { transform: translateY(-1px); }
.button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible {
    outline: 3px solid rgba(31, 107, 79, .25);
    outline-offset: 2px;
}
.button-primary { background: var(--green); color: #fff; }
.button-primary:hover { background: #185b43; }
.button-secondary { background: var(--green-soft); color: var(--green-deep); }
.button-ghost { border-color: var(--line); background: rgba(255,255,255,.5); }
.button-danger { border-color: #e6b3af; background: #fff1f0; color: var(--danger); }
.button-large { min-height: 52px; padding: 13px 23px; }
.button-wide { width: 100%; }
.required { color: var(--danger); }
.muted, .helper-text { color: var(--ink-soft); }
.helper-text { margin: 12px 0 0; font-size: 13px; }

.alert {
    padding: 12px 15px;
    border: 1px solid;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
}
.alert-success { border-color: #a9d3bd; background: #ebf8f0; color: #1c6146; }
.alert-error { border-color: #e3aaa6; background: #fff0ef; color: #8c302a; }
.alert-warning { border-color: #dfc280; background: #fff9e9; color: #75530e; }
.floating-alert { position: fixed; z-index: 30; top: 18px; left: 50%; transform: translateX(-50%); }

/* Landing */
.landing-page { background: #f5f2e9; }
.landing-nav {
    display: flex;
    max-width: 1240px;
    margin: 0 auto;
    padding: 28px 30px;
    align-items: center;
    justify-content: space-between;
}
.landing-nav-actions { display: flex; align-items: center; gap: 12px; }
.language-switch-light {
    margin: 0;
    border-color: #cdd3cc;
    background: rgba(255,255,255,.55);
}
.language-switch-light a { color: var(--ink-soft); }
.language-switch-light a.is-active { background: var(--green); color: #fff; }
.hero {
    display: grid;
    max-width: 1240px;
    min-height: 670px;
    margin: 0 auto;
    padding: 70px 30px 90px;
    grid-template-columns: 1.04fr .96fr;
    gap: 90px;
    align-items: center;
}
.hero h1 { max-width: 720px; margin-bottom: 25px; font-size: clamp(54px, 6vw, 90px); }
.hero h1 em { color: var(--green); font-weight: inherit; }
.hero-copy > p { max-width: 630px; color: var(--ink-soft); font-size: 19px; line-height: 1.75; }
.hero-actions { display: flex; margin-top: 36px; align-items: center; gap: 24px; }
.hero-proof { display: inline-flex; align-items: center; gap: 10px; color: var(--ink-soft); }
.hero-proof strong { color: var(--green); font-family: var(--serif); font-size: 28px; }
.hero-workflow { position: relative; }
.hero-workflow::before {
    position: absolute;
    z-index: -1;
    inset: -45px -35px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(43,122,88,.13), transparent 68%);
    content: "";
}
.workflow-card {
    display: grid;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: rgba(255,255,255,.78);
    box-shadow: 0 8px 30px rgba(31,54,43,.05);
    grid-template-columns: 52px 1fr auto;
    gap: 16px;
    align-items: center;
}
.workflow-card.is-current { border-color: #85b49d; background: #fff; box-shadow: var(--shadow); }
.workflow-card small { display: block; color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.workflow-card strong { display: block; margin-top: 4px; font-family: var(--serif); font-size: 19px; line-height: 1.25; }
.workflow-number { color: var(--green); font-family: var(--serif); font-size: 29px; }
.workflow-state { color: var(--ink-soft); font-size: 12px; }
.workflow-line { height: 40px; margin-left: 47px; border-left: 1px dashed #9ab3a6; }
[dir="rtl"] .workflow-line { margin-right: 47px; margin-left: 0; border-right: 1px dashed #9ab3a6; border-left: 0; }
.value-strip {
    display: grid;
    padding: 55px max(30px, calc((100vw - 1180px) / 2));
    background: var(--navy);
    color: #fff;
    grid-template-columns: repeat(3, 1fr);
    gap: 50px;
}
.value-strip div { position: relative; padding-left: 48px; }
[dir="rtl"] .value-strip div { padding-right: 48px; padding-left: 0; }
.value-strip span { position: absolute; top: 1px; left: 0; color: var(--gold); font-family: var(--serif); font-size: 24px; }
[dir="rtl"] .value-strip span { right: 0; left: auto; }
.value-strip strong { font-family: var(--serif); font-size: 23px; }
.value-strip p { margin: 7px 0 0; color: #aebdb5; }
.workflow-overview {
    display: grid;
    max-width: 1180px;
    margin: 0 auto;
    padding: 110px 30px;
    grid-template-columns: .8fr 1.2fr;
    gap: 90px;
}
.workflow-overview h2 { font-size: 48px; }
.stage-list { margin: 0; padding: 0; list-style: none; }
.stage-list li {
    display: grid;
    padding: 23px 0;
    border-bottom: 1px solid var(--line);
    grid-template-columns: 80px 1fr 1.2fr;
    gap: 18px;
    align-items: baseline;
}
.stage-list li > span { color: var(--green); font-family: var(--serif); font-size: 18px; }
.stage-list strong { font-size: 16px; }
.stage-list p { margin: 0; color: var(--ink-soft); }
.landing-footer { display: flex; padding: 30px max(30px, calc((100vw - 1180px)/2)); border-top: 1px solid var(--line); align-items: center; justify-content: space-between; gap: 25px; color: var(--ink-soft); }
.landing-footer small, .developer-credit {
    margin: 0;
    color: #78867e;
    font-size: 9px;
    font-weight: 500;
    letter-spacing: .015em;
    line-height: 1.5;
}

/* Authentication and installer */
.auth-shell { display: grid; min-height: 100vh; grid-template-columns: .9fr 1.1fr; }
.auth-panel { padding: clamp(35px, 6vw, 90px); }
.auth-brand-panel {
    display: flex;
    background: var(--navy);
    color: #fff;
    flex-direction: column;
    justify-content: space-between;
}
.auth-brand-panel h1 { max-width: 620px; margin: 20px 0; font-size: clamp(42px, 5vw, 70px); }
.auth-brand-panel p { color: #b8c8c0; font-size: 18px; }
.auth-brand-panel blockquote { margin: 0; color: #93aa9e; font-family: var(--serif); font-size: 18px; font-style: italic; }
.auth-form-panel { display: grid; background: #f8f7f2; place-items: center; }
.auth-form-wrap { width: min(430px, 100%); }
.auth-language { display: flex; margin-bottom: 26px; justify-content: flex-end; }
[dir="rtl"] .auth-language { justify-content: flex-start; }
.auth-form-wrap h2 { margin-bottom: 12px; font-size: 40px; }
.auth-form-wrap > p { margin-bottom: 30px; color: var(--ink-soft); }
.form-note { display: block; margin-top: 18px; color: var(--ink-soft); text-align: center; }
.install-body { display: grid; min-height: 100vh; padding: 40px 20px; background: var(--navy); place-items: center; }
.install-shell { width: min(650px, 100%); }
.install-shell > .brand { margin-bottom: 28px; color: #fff; }
.install-card { padding: 42px; border-radius: 20px; background: #fff; box-shadow: var(--shadow); }
.install-card h1 { font-size: 42px; }
.install-card .lead { color: var(--ink-soft); font-size: 17px; }
.requirement-list { display: grid; margin: 20px 0 28px; gap: 9px; }
.requirement-list div { display: flex; align-items: center; gap: 10px; }
.security-note { margin: 20px 0 0; color: var(--ink-soft); font-size: 13px; }

/* App shell */
.app-shell { min-height: 100vh; }
.sidebar {
    position: fixed;
    z-index: 20;
    inset: 0 auto 0 0;
    display: flex;
    width: 250px;
    padding: 28px 22px;
    background: var(--navy);
    color: #fff;
    flex-direction: column;
}
[dir="rtl"] .sidebar { inset: 0 0 0 auto; }
.sidebar-kicker { margin: 8px 0 0; padding-inline-start: 46px; color: #738b7e; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.main-nav { display: grid; margin-top: 65px; gap: 8px; }
.main-nav a {
    display: flex;
    padding: 11px 13px;
    border-radius: 8px;
    align-items: center;
    gap: 12px;
    color: #bdcac4;
    font-weight: 650;
}
.main-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-icon { width: 20px; color: var(--gold); font-size: 18px; text-align: center; }
.sidebar-footer { margin-top: auto; }
.language-switch { display: inline-flex; margin-bottom: 18px; padding: 3px; border: 1px solid rgba(255,255,255,.12); border-radius: 7px; }
.language-switch a { padding: 3px 8px; border-radius: 4px; color: #82988d; font-size: 11px; font-weight: 800; }
.language-switch a.is-active { background: rgba(255,255,255,.12); color: #fff; }
.user-card { display: flex; padding: 14px 0; border-top: 1px solid rgba(255,255,255,.1); align-items: center; gap: 11px; }
.user-card .avatar { display: grid; width: 35px; height: 35px; border-radius: 50%; background: #365a49; place-items: center; font-family: var(--serif); }
.user-card strong, .user-card small { display: block; }
.user-card strong { font-size: 13px; }
.user-card small { color: #779083; font-size: 10px; text-transform: uppercase; }
.logout-button { display: flex; width: 100%; padding: 10px 0; border: 0; background: transparent; color: #91a49a; cursor: pointer; justify-content: space-between; }
.logout-button:hover { color: #fff; }
.sidebar-footer .developer-credit { margin-top: 12px; color: #63796e; }
.auth-credit { display: block; margin-top: 36px; text-align: center; }
.app-main { min-width: 0; margin-left: 250px; padding: 55px clamp(24px, 5vw, 76px) 80px; }
[dir="rtl"] .app-main { margin-right: 250px; margin-left: 0; }
.mobile-menu { display: none; }
.page-header, .project-header {
    display: flex;
    margin-bottom: 38px;
    align-items: flex-end;
    justify-content: space-between;
    gap: 25px;
}
.page-header h1, .project-header h1, .compact-header h1 { margin-bottom: 12px; font-size: clamp(42px, 5vw, 62px); }
.page-header p, .project-header p, .compact-header p { max-width: 760px; margin-bottom: 0; color: var(--ink-soft); font-size: 16px; }
.compact-header { max-width: 980px; margin: 0 auto 32px; }
.back-link { display: inline-block; margin-bottom: 26px; color: var(--green); font-size: 13px; font-weight: 750; }
.arrow-forward::before { content: "→"; }
.arrow-back::before { content: "←"; }
[dir="rtl"] .arrow-forward::before { content: "←"; }
[dir="rtl"] .arrow-back::before { content: "→"; }
.header-actions { align-self: flex-start; }

.stats-grid { display: grid; margin-bottom: 55px; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stats-grid article { padding: 22px 24px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.65); }
.stats-grid span, .stats-grid small { display: block; color: var(--ink-soft); }
.stats-grid span { font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.stats-grid strong { display: block; margin: 7px 0 1px; font-family: var(--serif); font-size: 38px; font-weight: 500; }
.section-heading { display: flex; margin-bottom: 20px; justify-content: space-between; }
.section-heading h2 { font-size: 34px; }
.compact-search {
    display: grid;
    width: min(300px, 100%);
    gap: 4px;
    color: var(--ink-soft);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.compact-search input { min-height: 40px; }
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.project-card {
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 8px 26px rgba(36,46,40,.035);
}
.project-card-top, .project-card-footer { display: flex; align-items: center; justify-content: space-between; }
.project-card-top > span:last-child { color: var(--green); font-family: var(--serif); font-size: 22px; }
.project-card h3 { margin: 25px 0 10px; font-family: var(--serif); font-size: 25px; font-weight: 500; }
.project-card p { min-height: 48px; color: var(--ink-soft); }
.status-pill {
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 99px;
    background: var(--green-soft);
    color: var(--green-deep);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.shared-pill, .shared-notice {
    display: inline-flex;
    margin-inline-start: 7px;
    padding: 5px 9px;
    border: 1px solid #d3c295;
    border-radius: 99px;
    background: #fff9e8;
    color: #725516;
    font-size: 10px;
    font-weight: 750;
}
.shared-notice { margin: 18px 0 0; }
.progress {
    overflow: hidden;
    width: 100%;
    height: 7px;
    border: 0;
    border-radius: 99px;
    background: #e4e7e1;
    color: var(--green);
    appearance: none;
}
.progress::-webkit-progress-bar { border-radius: 99px; background: #e4e7e1; }
.progress::-webkit-progress-value { border-radius: 99px; background: var(--green); }
.progress::-moz-progress-bar { border-radius: 99px; background: var(--green); }
.project-card-footer { margin-top: 16px; color: var(--ink-soft); font-size: 12px; }
.project-card-footer a { color: var(--green); font-weight: 800; }
.empty-state {
    padding: 70px 30px;
    border: 1px dashed #b8c4ba;
    border-radius: var(--radius);
    background: rgba(255,255,255,.4);
    text-align: center;
}
.empty-state h3, .empty-state h1 { margin: 18px 0 10px; font-family: var(--serif); font-size: 31px; font-weight: 500; }
.empty-state p { max-width: 540px; margin: 0 auto 24px; color: var(--ink-soft); }
.empty-symbol { color: var(--green); font-family: var(--serif); font-size: 33px; }
.standalone-empty { max-width: 760px; margin: 80px auto; }

/* Forms */
.form-card {
    max-width: 980px;
    margin: 0 auto;
    padding: clamp(24px, 4vw, 42px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}
.form-card-wide { max-width: 1100px; }
.stack-form { display: grid; gap: 21px; }
.stack-form label, .field-stack label, .content-card > label {
    display: grid;
    gap: 8px;
    color: #344139;
    font-size: 13px;
    font-weight: 750;
}
input, textarea, select {
    width: 100%;
    border: 1px solid #cfd4cd;
    border-radius: 9px;
    background: #fbfcfa;
    color: var(--ink);
}
input, select { min-height: 46px; padding: 10px 12px; }
textarea { min-height: 105px; padding: 13px; line-height: 1.65; resize: vertical; }
input::placeholder, textarea::placeholder { color: #95a098; }
input:focus, textarea:focus, select:focus { border-color: var(--green); background: #fff; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.form-grid-compact { grid-template-columns: 160px 1fr; }
.form-actions { display: flex; padding-top: 8px; align-items: center; justify-content: flex-end; gap: 10px; }
.field-stack { display: grid; gap: 18px; }
.code-textarea, .prompt-preview { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; tab-size: 4; }
.translation-panel { padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: #fafbf8; }
.translation-panel summary { cursor: pointer; font-weight: 750; }
.translation-panel[open] summary { margin-bottom: 20px; }
.checkbox-label { display: flex !important; grid-template-columns: auto 1fr; align-items: center; }
.checkbox-label input { width: 18px; min-height: 18px; }

/* Project workflow */
.project-progress-card {
    display: grid;
    margin-bottom: 55px;
    padding: 22px 26px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    grid-template-columns: 150px 1fr auto;
    gap: 25px;
    align-items: center;
}
.project-progress-card strong, .project-progress-card span { display: block; }
.project-progress-card strong { font-family: var(--serif); font-size: 34px; font-weight: 500; }
.project-progress-card span, .project-progress-card p { color: var(--ink-soft); font-size: 12px; }
.project-progress-card p { margin: 0; }
.progress-large { height: 9px; }
.workflow-stage { margin-bottom: 42px; }
.workflow-stage > header { display: flex; margin-bottom: 14px; align-items: flex-end; justify-content: space-between; }
.workflow-stage h2 { margin: 4px 0 0; font-size: 31px; }
.workflow-stage > header > span { color: var(--ink-soft); font-size: 12px; }
.stage-range { color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.step-list { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.step-row {
    display: grid;
    min-height: 94px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--line);
    grid-template-columns: 48px 1fr 100px 24px;
    gap: 17px;
    align-items: center;
}
.step-row:last-child { border-bottom: 0; }
.step-row:hover { background: #f8faf7; }
.step-number { color: var(--green); font-family: var(--serif); font-size: 24px; }
.step-copy strong, .step-copy small { display: block; }
.step-copy strong { margin-bottom: 4px; font-family: var(--serif); font-size: 18px; font-weight: 500; }
.step-copy small { overflow: hidden; color: var(--ink-soft); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.step-status { color: var(--ink-soft); font-size: 11px; font-weight: 750; text-transform: uppercase; }
.status-completed .step-status { color: var(--green); }
.step-arrow { color: var(--green); font-size: 18px; }
.danger-zone {
    display: flex;
    margin-top: 70px;
    padding: 22px;
    border: 1px solid #e5bfbc;
    border-radius: 12px;
    background: #fff7f6;
    align-items: center;
    justify-content: space-between;
}
.danger-zone p { margin: 3px 0 0; color: var(--ink-soft); font-size: 12px; }
.project-actions { display: flex; gap: 9px; }
.action-menu { position: relative; }
.action-menu summary { list-style: none; }
.action-menu summary::-webkit-details-marker { display: none; }
.action-menu[open] summary { background: #cae1d5; }
.action-menu > div {
    position: absolute;
    z-index: 12;
    top: calc(100% + 7px);
    right: 0;
    display: grid;
    overflow: hidden;
    width: 235px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    box-shadow: var(--shadow);
}
[dir="rtl"] .action-menu > div { right: auto; left: 0; }
.action-menu a, .action-menu button {
    display: block;
    width: 100%;
    padding: 11px 14px;
    border: 0;
    border-bottom: 1px solid #edf0eb;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    text-align: start;
}
.action-menu a:hover, .action-menu button:hover { background: #f3f7f3; color: var(--green); }
.collaboration-card {
    display: grid;
    margin-bottom: 52px;
    padding: 25px 27px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255,255,255,.65);
    grid-template-columns: minmax(220px, .75fr) minmax(300px, 1.25fr);
    gap: 32px;
}
.collaboration-card h2 { margin-bottom: 8px; font-size: 29px; }
.collaboration-card p { margin: 0; color: var(--ink-soft); font-size: 13px; }
.member-manager, .member-chips { display: grid; gap: 9px; }
.member-chip {
    position: relative;
    display: grid;
    padding: 10px 42px 10px 13px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
}
[dir="rtl"] .member-chip { padding: 10px 13px 10px 42px; }
.member-chip strong, .member-chip small { display: block; }
.member-chip strong { font-size: 12px; }
.member-chip small { color: var(--ink-soft); font-size: 10px; }
.member-chip form { position: absolute; top: 50%; right: 10px; transform: translateY(-50%); }
[dir="rtl"] .member-chip form { right: auto; left: 10px; }
.member-chip button {
    border: 0;
    background: transparent;
    color: var(--danger);
    cursor: pointer;
    font-size: 20px;
}
.member-add-form {
    display: grid;
    margin-top: 5px;
    grid-template-columns: 1fr auto;
    gap: 9px;
    align-items: end;
}
.member-add-form label { display: grid; gap: 5px; color: var(--ink-soft); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.project-management {
    display: flex;
    margin-top: 70px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
}
.project-management p { margin: 3px 0 0; color: var(--ink-soft); font-size: 12px; }
.project-management form { display: flex; align-items: center; gap: 9px; }
.project-management select { min-width: 135px; }

/* Step workspace */
.step-shell { display: grid; margin: -55px clamp(-76px, -5vw, -24px) -80px; grid-template-columns: 280px 1fr; }
.step-sidebar {
    position: sticky;
    top: 0;
    overflow-y: auto;
    height: 100vh;
    padding: 38px 18px;
    border-right: 1px solid var(--line);
    background: #ebece6;
}
.step-project-title { padding: 0 9px 18px; border-bottom: 1px solid #d4d7d0; font-family: var(--serif); font-size: 17px; }
.step-sidebar .back-link { margin-left: 9px; }
.step-sidebar nav { display: grid; gap: 3px; }
.step-sidebar nav a {
    display: grid;
    min-height: 54px;
    padding: 9px;
    border-radius: 8px;
    grid-template-columns: 28px 1fr 9px;
    gap: 8px;
    align-items: center;
}
.step-sidebar nav a:hover, .step-sidebar nav a.is-active { background: #fff; }
.step-sidebar nav a > span { color: var(--green); font-family: var(--serif); }
.step-sidebar nav strong { overflow: hidden; font-size: 11px; font-weight: 650; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.status-dot { display: inline-block; width: 8px; height: 8px; border: 1px solid #96a49c; border-radius: 50%; }
.status-dot.is-complete { border-color: var(--green); background: var(--green); }
.status-dot.is-error { border-color: var(--danger); background: var(--danger); }
.step-content { min-width: 0; padding: 55px clamp(25px, 5vw, 72px) 100px; }
.step-header { display: flex; margin-bottom: 34px; align-items: flex-start; justify-content: space-between; gap: 25px; }
.step-header h1 { max-width: 900px; margin-bottom: 14px; font-size: clamp(35px, 4vw, 52px); }
.step-header p { max-width: 850px; color: var(--ink-soft); }
.step-form { display: grid; gap: 20px; }
.content-card { padding: clamp(22px, 4vw, 36px); border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.card-heading { display: flex; margin-bottom: 25px; align-items: flex-start; justify-content: space-between; gap: 20px; }
.card-heading h2 { margin: 0; font-size: 29px; }
.card-heading .eyebrow { margin-bottom: 5px; }
.card-heading > span { color: var(--ink-soft); font-size: 12px; }
.prompt-preview { min-height: 480px; background: #f7f8f5; }
.sticky-actions {
    position: sticky;
    z-index: 8;
    bottom: 16px;
    display: flex;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 12px 30px rgba(30,45,37,.13);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: space-between;
}
.sticky-actions > div { display: flex; gap: 8px; }
.save-actions { align-items: center; }
.autosave-status {
    margin-inline-end: 7px;
    color: var(--ink-soft);
    font-size: 11px;
    white-space: nowrap;
}
.autosave-status[data-state="saved"] { color: var(--green); }
.autosave-status[data-state="error"] { color: var(--danger); }
.autosave-status[data-state="pending"], .autosave-status[data-state="saving"] { color: var(--warning); }
.context-note { display: block; margin-top: 6px; color: var(--green); font-size: 11px; font-weight: 650; }

/* Prompt library */
.library-toolbar {
    display: flex;
    margin-bottom: 18px;
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    align-items: flex-end;
    justify-content: space-between;
}
.search-field { display: grid; width: min(450px, 70%); gap: 4px; color: var(--ink-soft); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.search-field input { min-height: 40px; }
.library-toolbar > span { color: var(--ink-soft); font-size: 12px; }
.prompt-table { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.prompt-table-head, .prompt-table article {
    display: grid;
    padding: 14px 18px;
    grid-template-columns: 65px minmax(260px, 1fr) 170px 90px minmax(285px, auto);
    gap: 15px;
    align-items: center;
}
.prompt-table-head { background: #edf0ea; color: var(--ink-soft); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.prompt-table article { min-height: 88px; border-top: 1px solid var(--line); }
.prompt-table article[hidden] { display: none; }
.prompt-table article strong, .prompt-table article small { display: block; }
.prompt-table article strong { margin-bottom: 4px; font-family: var(--serif); font-size: 16px; font-weight: 500; }
.prompt-table article small { overflow: hidden; color: var(--ink-soft); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.prompt-table article > span:nth-child(3) { color: var(--ink-soft); font-size: 12px; }
.row-action {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    color: var(--ink-soft);
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}
.row-action:hover { border-color: #9cb4a7; color: var(--green); }
.row-action-primary { border-color: #99c1ab; background: var(--green-soft); color: var(--green-deep); }
.row-action-danger { border-color: #e6b3af; color: var(--danger); }
.team-layout { display: grid; grid-template-columns: 1.25fr .75fr; gap: 20px; align-items: start; }
.team-list { display: grid; }
.team-list article {
    display: grid;
    min-height: 70px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    grid-template-columns: 42px 1fr auto auto auto;
    gap: 12px;
    align-items: center;
}
.team-list article:last-child { border-bottom: 0; }
.team-list strong, .team-list small { display: block; }
.team-list small { color: var(--ink-soft); }
.avatar-light { display: grid; width: 36px; height: 36px; border-radius: 50%; background: var(--green-soft); color: var(--green); place-items: center; font-family: var(--serif); }
.text-danger { border: 0; background: transparent; color: var(--danger); cursor: pointer; font-size: 12px; }
.role-button {
    min-height: 30px;
    padding: 5px 9px;
    border: 1px solid #b8c9bf;
    border-radius: 7px;
    background: #f4f8f5;
    color: var(--green);
    cursor: pointer;
    font-size: 11px;
    font-weight: 750;
}
.account-card { max-width: 650px; }
.account-summary {
    display: flex;
    margin-bottom: 28px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
    align-items: center;
    gap: 13px;
}
.account-summary .avatar { width: 44px; height: 44px; }
.account-summary strong, .account-summary small { display: block; }
.account-summary small { color: var(--ink-soft); }
.version-list { display: grid; max-width: 980px; margin: 0 auto; gap: 13px; }
.version-list article {
    display: grid;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fff;
    grid-template-columns: minmax(240px, .8fr) minmax(280px, 1.2fr) auto;
    gap: 22px;
    align-items: center;
}
.version-list article > p { margin: 0; color: var(--ink-soft); font-size: 12px; }
.version-meta { display: flex; align-items: center; gap: 13px; }
.version-meta strong, .version-meta small { display: block; }
.version-meta small { color: var(--ink-soft); font-size: 10px; }
.table-actions { display: flex; gap: 6px; justify-content: flex-end; }
.table-actions form { margin: 0; }
[dir="rtl"] .table-actions { justify-content: flex-start; }

[dir="rtl"] .page-header,
[dir="rtl"] .project-header,
[dir="rtl"] .section-heading,
[dir="rtl"] .project-card-top,
[dir="rtl"] .project-card-footer,
[dir="rtl"] .workflow-stage > header,
[dir="rtl"] .card-heading,
[dir="rtl"] .step-header,
[dir="rtl"] .sticky-actions,
[dir="rtl"] .danger-zone,
[dir="rtl"] .project-management,
[dir="rtl"] .landing-footer {
    direction: rtl;
}
[dir="rtl"] .form-actions { justify-content: flex-start; }
[dir="rtl"] .step-sidebar { border-right: 0; border-left: 1px solid var(--line); }
[dir="rtl"] .step-sidebar .back-link { margin-right: 9px; margin-left: 0; }
[dir="rtl"] .step-sidebar nav a { grid-template-columns: 28px 1fr 9px; }
[dir="rtl"] input[type="email"],
[dir="rtl"] input[name="title_en"],
[dir="rtl"] textarea[name="objective_en"],
[dir="rtl"] textarea[name="body_en"] {
    direction: ltr;
    text-align: left;
}

@media (max-width: 1050px) {
    .hero { gap: 45px; }
    .value-strip { gap: 25px; }
    .sidebar { width: 215px; }
    .app-main { margin-left: 215px; }
    [dir="rtl"] .app-main { margin-right: 215px; margin-left: 0; }
    .step-shell { grid-template-columns: 230px 1fr; }
    .prompt-table-head, .prompt-table article { grid-template-columns: 55px 1fr 100px minmax(270px, auto); }
    .prompt-table-head span:nth-child(4), .prompt-table article > span:nth-child(4) { display: none; }
    .version-list article { grid-template-columns: minmax(220px, .8fr) 1.2fr; }
    .version-list article form { grid-column: 1 / -1; }
}

@media (max-width: 800px) {
    .hero, .workflow-overview, .auth-shell { grid-template-columns: 1fr; }
    .hero { padding-top: 40px; }
    .value-strip { grid-template-columns: 1fr; }
    .workflow-overview { gap: 35px; padding-top: 75px; }
    .auth-brand-panel { display: none; }
    .auth-form-panel { min-height: 100vh; }
    .sidebar {
        width: 250px;
        transform: translateX(-105%);
        transition: transform .2s ease;
    }
    [dir="rtl"] .sidebar { transform: translateX(105%); }
    .sidebar.is-open { transform: translateX(0); }
    .app-main { margin: 0; padding: 80px 20px 60px; }
    [dir="rtl"] .app-main { margin: 0; }
    .mobile-menu {
        position: fixed;
        z-index: 30;
        top: 17px;
        left: 18px;
        display: block;
        padding: 8px 13px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: #fff;
        color: var(--ink);
    }
    [dir="rtl"] .mobile-menu { right: 18px; left: auto; }
    .stats-grid, .project-grid, .form-grid { grid-template-columns: 1fr; }
    .team-layout { grid-template-columns: 1fr; }
    .section-heading { align-items: stretch; flex-direction: column; gap: 12px; }
    .collaboration-card { grid-template-columns: 1fr; }
    .project-actions { width: 100%; }
    .action-menu { flex: 1; }
    .action-menu summary, .project-actions > .button { width: 100%; }
    .page-header, .project-header { align-items: flex-start; flex-direction: column; }
    .step-shell { display: block; margin: -80px -20px -60px; }
    .step-sidebar { position: relative; height: auto; max-height: 330px; border-right: 0; border-bottom: 1px solid var(--line); }
    .step-content { padding: 35px 20px 85px; }
    .project-progress-card { grid-template-columns: 100px 1fr; }
    .project-progress-card p { grid-column: 1 / -1; }
    .step-row { grid-template-columns: 42px 1fr 24px; }
    .step-status { display: none; }
    .prompt-table-head { display: none; }
    .prompt-table article { display: grid; grid-template-columns: 45px 1fr; }
    .prompt-table article > span:nth-child(3), .prompt-table article > span:nth-child(4) { display: none; }
    .prompt-table .table-actions { grid-column: 1 / -1; justify-content: flex-start; flex-wrap: wrap; padding-top: 6px; }
    .sticky-actions { position: static; align-items: stretch; flex-direction: column; gap: 10px; }
    .sticky-actions > div { justify-content: space-between; }
    .save-actions { align-items: stretch; flex-wrap: wrap; }
    .autosave-status { width: 100%; margin: 0 0 3px; }
    .project-management { align-items: stretch; flex-direction: column; }
    .project-management form { align-items: stretch; flex-direction: column; }
    .version-list article { grid-template-columns: 1fr; }
    .version-list article form { grid-column: auto; }
}

@media (max-width: 520px) {
    .landing-nav { padding: 20px; }
    .landing-nav .button { min-height: 38px; padding: 8px 12px; }
    .landing-nav-actions { gap: 7px; }
    .hero { padding: 40px 20px 65px; }
    .hero h1 { font-size: 48px; }
    .hero-actions { align-items: stretch; flex-direction: column; }
    .workflow-card { grid-template-columns: 40px 1fr; }
    .workflow-state { display: none; }
    .workflow-overview { padding: 70px 20px; }
    .stage-list li { grid-template-columns: 60px 1fr; }
    .stage-list p { grid-column: 2; }
    .landing-footer { align-items: flex-start; flex-direction: column; gap: 8px; }
    .install-card { padding: 26px 20px; }
    .page-header h1, .project-header h1, .compact-header h1 { font-size: 40px; }
    .step-header { flex-direction: column; }
    .card-heading { flex-direction: column; }
    .danger-zone { align-items: stretch; flex-direction: column; gap: 15px; }
    .member-add-form { grid-template-columns: 1fr; }
    .project-actions { flex-direction: column; }
}
