/* Wenheng - Premium UI System */

:root {
    --brand-ink: #111827;
    --brand-ink-2: #202938;
    --brand-blue: #245b7a;
    --brand-blue-hover: #1d4962;
    --brand-cyan: #277c86;
    --brand-gold: #9d7a2d;
    --brand-gold-strong: #c9a24d;
    --brand-gold-soft: #fbf6e7;
    --surface: #ffffff;
    --surface-muted: #f6f8fb;
    --surface-strong: #edf2f7;
    --text-primary: #111827;
    --text-secondary: #5b6678;
    --text-muted: #7b8494;
    --border-color: #d9e1ec;
    --success-color: #12805c;
    --error-color: #c2413a;
    --warning-color: #a66a00;
    --shadow: 0 18px 45px rgba(17, 24, 39, 0.08);
    --shadow-panel: 0 22px 54px rgba(17, 24, 39, 0.07);
    --shadow-card: 0 10px 28px rgba(17, 24, 39, 0.045);
    --shadow-soft: 0 8px 22px rgba(17, 24, 39, 0.06);
    --radius: 8px;
    --radius-lg: 8px;
    --primary-color: var(--brand-blue);
    --primary-hover: var(--brand-blue-hover);
    --secondary-color: var(--brand-ink-2);
    --background: var(--surface-muted);
    --card-bg: var(--surface);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    min-width: 320px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    background:
        linear-gradient(180deg, #f4f7fb 0%, #fafbfc 46%, #ffffff 100%);
    color: var(--text-primary);
    line-height: 1.6;
}

a {
    color: var(--brand-blue);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.muted {
    color: var(--text-muted);
}

/* Navigation */
.navbar {
    position: sticky;
    top: 0;
    z-index: 900;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(217, 225, 236, 0.86);
    backdrop-filter: blur(16px);
    padding: 0.85rem max(1.25rem, calc((100vw - 1180px) / 2));
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.nav-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--brand-ink);
}

.nav-brand:hover {
    text-decoration: none;
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(145deg, var(--brand-gold-strong), #a98535);
    color: var(--brand-ink);
    border: 2px solid rgba(17, 24, 39, 0.92);
    font-size: 1.08rem;
    font-weight: 900;
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.16);
}

.nav-brand strong,
.nav-brand em {
    display: block;
    font-style: normal;
}

.nav-brand strong {
    font-size: 1.08rem;
    line-height: 1.2;
    letter-spacing: 0.03em;
}

.nav-brand em {
    margin-top: 0.1rem;
    font-size: 0.76rem;
    color: var(--text-muted);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.nav-links a {
    padding: 0.55rem 0.8rem;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.94rem;
    font-weight: 600;
}

.nav-links a:hover {
    color: var(--brand-ink);
    background: var(--surface-muted);
    text-decoration: none;
}

.nav-links a.active {
    color: var(--brand-blue);
    background: #eef6f7;
}

/* Legacy container/card support */
.container,
.page-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 2rem 1.25rem 3rem;
}

.card,
.compose-card,
.delivery-card,
.trust-panel,
.status-workspace,
.order-number-guide {
    background: var(--surface);
    border: 1px solid rgba(217, 225, 236, 0.92);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.card {
    padding: 1.6rem;
    margin-bottom: 1.5rem;
}

.elevated-card {
    box-shadow: var(--shadow);
}

.card h1,
.card h2,
.card h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* Hero */
.hero-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(310px, 0.76fr);
    gap: 1.1rem;
    align-items: stretch;
    margin-bottom: 1.3rem;
}

.hero-copy {
    min-height: 296px;
    border-radius: var(--radius-lg);
    padding: clamp(1.45rem, 3.55vw, 2.65rem);
    background:
        radial-gradient(circle at 88% 14%, rgba(201, 162, 77, 0.16), transparent 32%),
        linear-gradient(142deg, rgba(17, 24, 39, 0.99), rgba(30, 46, 56, 0.96));
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    box-shadow: var(--shadow-panel);
}

.compact-hero .hero-copy {
    min-height: 250px;
}

.eyebrow,
.section-label,
.panel-kicker {
    color: var(--brand-gold);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-copy .eyebrow {
    color: var(--brand-gold-strong);
}

.hero-copy h1 {
    margin-top: 0.7rem;
    font-size: clamp(2.15rem, 4.1vw, 4.05rem);
    line-height: 1.08;
    font-weight: 850;
    max-width: 820px;
}

.hero-lede {
    margin-top: 1.1rem;
    max-width: 800px;
    color: rgba(255, 255, 255, 0.82);
    font-size: clamp(1rem, 1.4vw, 1.16rem);
    line-height: 1.85;
}

.hero-capability-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 1.35rem;
}

.hero-capability-strip span {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0.34rem 0.66rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.86rem;
    font-weight: 750;
}

.hero-proof-list {
    display: grid;
    gap: 0.45rem;
    margin-top: 1.1rem;
    padding-left: 1.2rem;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.92rem;
    line-height: 1.65;
}

.trust-panel {
    padding: 1.35rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.trust-list {
    list-style: none;
    margin-top: 1rem;
}

.trust-list li {
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 0.75rem;
    padding: 0.9rem 0;
    border-top: 1px solid var(--border-color);
}

.trust-list li:first-child {
    border-top: none;
    padding-top: 0;
}

.trust-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-gold-soft);
    color: var(--brand-gold);
    font-size: 0.78rem;
    font-weight: 800;
}

.trust-list strong {
    display: block;
    margin-bottom: 0.15rem;
}

.trust-list span:last-child {
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.order-format {
    margin: 0.9rem 0 0.3rem;
    color: var(--brand-ink);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 1.2rem;
    font-weight: 800;
    word-break: break-all;
}

/* Workbench */
.workbench-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.42fr) minmax(300px, 0.78fr);
    gap: 1.1rem;
    align-items: start;
}

.order-workbench {
    margin-bottom: 1.2rem;
}

.compose-card,
.delivery-card,
.status-workspace,
.order-number-guide {
    padding: clamp(1.25rem, 2.35vw, 1.9rem);
}

.section-heading {
    margin-bottom: 1.25rem;
}

.section-heading.compact {
    margin-bottom: 1rem;
}

.section-heading h2,
.section-heading h3 {
    margin-top: 0.35rem;
    color: var(--brand-ink);
    font-size: clamp(1.3rem, 1.85vw, 1.72rem);
    line-height: 1.2;
}

.section-heading p {
    margin-top: 0.45rem;
    color: var(--text-secondary);
}

.generate-form {
    display: grid;
    gap: 1.05rem;
}

.mobile-value-strip {
    display: none;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: var(--radius);
    background: #eef6f7;
    border: 1px solid #c7dfe5;
}

.mobile-value-strip span,
.mobile-value-strip strong {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
}

.mobile-value-strip span {
    color: var(--brand-blue);
    font-size: 0.8rem;
    font-weight: 800;
}

.mobile-value-strip strong {
    padding: 0.2rem 0.45rem;
    border-radius: 6px;
    background: #ffffff;
    color: var(--brand-ink);
    font-size: 0.82rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.form-group {
    min-width: 0;
}

.form-group label {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.45rem;
    color: var(--brand-ink);
    font-size: 0.95rem;
    font-weight: 750;
}

.form-group label span {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    min-height: 48px;
    padding: 0.78rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 7px;
    background: #ffffff;
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.form-group textarea {
    min-height: 128px;
    resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #98a2b3;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 4px rgba(36, 91, 122, 0.12);
}

.form-group small {
    display: block;
    margin-top: 0.4rem;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.form-hint {
    color: var(--text-secondary);
    font-size: 0.86rem;
    line-height: 1.7;
}

.form-hint a {
    font-weight: 700;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 46px;
    padding: 0.78rem 1.1rem;
    border: 1px solid transparent;
    border-radius: 7px;
    font-size: 0.98rem;
    font-weight: 750;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s, border-color 0.2s, transform 0.1s, box-shadow 0.2s;
}

.btn:hover {
    transform: translateY(-1px);
    text-decoration: none;
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.68;
    transform: none;
}

.btn-primary {
    background: var(--brand-blue);
    color: #ffffff;
    box-shadow: 0 12px 22px rgba(36, 91, 122, 0.18);
}

.btn-primary:hover {
    background: var(--brand-blue-hover);
}

.btn-primary span {
    font-weight: 850;
}

.btn-secondary {
    background: var(--brand-ink-2);
    color: #ffffff;
}

.btn-secondary:hover {
    background: var(--brand-ink);
}

.btn-ghost {
    background: #ffffff;
    color: var(--brand-blue);
    border-color: var(--border-color);
}

.btn-ghost:hover {
    border-color: var(--brand-blue);
    background: #f3f7ff;
}

/* Delivery timeline */
.timeline-list {
    list-style: none;
    display: grid;
    gap: 0.8rem;
}

.timeline-list li {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 0.85rem;
    padding: 1rem;
    border-radius: var(--radius);
    background: var(--surface-muted);
    border: 1px solid rgba(217, 225, 236, 0.75);
}

.timeline-list li > span {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--brand-ink);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 850;
}

.timeline-list strong {
    display: block;
    color: var(--brand-ink);
}

.timeline-list p,
.assurance-box p {
    margin-top: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.assurance-box {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: var(--radius);
    background: var(--brand-gold-soft);
    border: 1px solid rgba(185, 139, 45, 0.24);
}

.assurance-box strong {
    color: #6f5119;
}

/* Deliverables and sample preview */
.deliverable-section,
.sample-preview-section {
    margin-top: 1.1rem;
    padding: clamp(1.2rem, 2.4vw, 2rem);
    background: var(--surface);
    border: 1px solid rgba(217, 225, 236, 0.92);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.deliverable-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.deliverable-grid article {
    padding: 1rem;
    border-radius: var(--radius);
    background: var(--surface-muted);
    border: 1px solid rgba(217, 225, 236, 0.7);
}

.deliverable-grid strong {
    color: var(--brand-ink);
}

.deliverable-grid p {
    margin-top: 0.45rem;
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.75;
}

.sample-preview-section {
    display: grid;
    grid-template-columns: minmax(0, 0.72fr) minmax(0, 1fr);
    gap: 1rem;
    align-items: stretch;
}

.sample-preview-copy h2 {
    margin-top: 0.35rem;
    color: var(--brand-ink);
    font-size: clamp(1.3rem, 1.85vw, 1.72rem);
    line-height: 1.2;
}

.sample-preview-copy p {
    margin-top: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.9;
}

.sample-note {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: var(--radius);
    background: var(--brand-gold-soft);
    border: 1px solid rgba(185, 139, 45, 0.24);
}

.sample-note strong,
.sample-note span {
    display: block;
}

.sample-note strong {
    color: #6f5119;
}

.sample-note span {
    margin-top: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.75;
}

.sample-paper {
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid rgba(217, 225, 236, 0.92);
    background: #ffffff;
}

.sample-paper-header {
    padding: 1rem 1.15rem;
    background:
        linear-gradient(140deg, rgba(17, 24, 39, 0.98), rgba(36, 91, 122, 0.92));
    color: #ffffff;
}

.sample-paper-header span,
.sample-paper-header strong {
    display: block;
}

.sample-paper-header span {
    color: var(--brand-gold-strong);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.sample-paper-header strong {
    margin-top: 0.3rem;
    font-size: 1.15rem;
}

.sample-paper-body {
    display: grid;
    gap: 0.8rem;
    padding: 1.1rem;
}

.sample-paper-body > div {
    padding: 0.95rem;
    border-radius: var(--radius);
    background: var(--surface-muted);
    border: 1px solid rgba(217, 225, 236, 0.8);
}

.sample-paper-body strong {
    color: var(--brand-ink);
}

.sample-outline ol {
    margin-top: 0.55rem;
    margin-left: 1.2rem;
    color: var(--text-secondary);
    line-height: 1.75;
}

.sample-excerpt p,
.sample-word p {
    margin-top: 0.55rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* Status and result */
.status-workspace {
    margin-top: 1rem;
}

.progress-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
}

.outline-box {
    background: var(--surface-muted);
    border: 1px solid rgba(217, 225, 236, 0.92);
    border-radius: var(--radius);
    padding: 1.15rem;
}

.outline-box ol {
    margin-left: 1.2rem;
    color: var(--text-secondary);
}

.outline-box li {
    margin: 0.45rem 0;
}

.progress-bar {
    padding: 1.1rem;
    border: 1px solid rgba(217, 225, 236, 0.92);
    border-radius: var(--radius);
    background: #ffffff;
}

.progress-text {
    color: var(--brand-ink);
    font-weight: 750;
    margin-bottom: 0.75rem;
}

.progress-text span {
    color: var(--brand-cyan);
}

.progress-track {
    height: 10px;
    background: var(--surface-strong);
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-cyan), var(--brand-blue));
    border-radius: 999px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-top: 0.6rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.spinner,
.spinner-small {
    border-style: solid;
    border-color: var(--border-color);
    border-top-color: var(--brand-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner {
    border-width: 3px;
    width: 42px;
    height: 42px;
    margin: 0 auto 1rem;
}

.spinner-small {
    border-width: 2px;
    width: 20px;
    height: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.result {
    margin-top: 1.2rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--border-color);
}

.paper-content {
    max-height: 620px;
    overflow-y: auto;
    padding: 1.25rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    line-height: 1.9;
    color: var(--text-primary);
}

.paper-content.streaming::after {
    content: '|';
    animation: blink 1s infinite;
    color: var(--brand-cyan);
    font-weight: 700;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.paper-content h2 {
    color: var(--brand-ink);
    margin-top: 1.7rem;
    margin-bottom: 0.8rem;
    border-bottom: 2px solid var(--brand-cyan);
    padding-bottom: 0.55rem;
}

.paper-content h2:first-child {
    margin-top: 0;
}

.paper-content p {
    margin: 0.9rem 0;
    text-align: justify;
}

.result-actions,
.content-actions {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.content-actions {
    flex-direction: column;
}

.content-actions .btn,
.result-actions .btn {
    min-width: 150px;
}

/* Guide */
.order-number-guide {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: 0.38fr 1fr;
    gap: 1rem;
    align-items: start;
}

.order-number-guide h2 {
    margin-top: 0.35rem;
    color: var(--brand-ink);
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.75rem;
}

.guide-grid article {
    padding: 1rem;
    border-radius: var(--radius);
    background: var(--surface-muted);
    border: 1px solid rgba(217, 225, 236, 0.8);
}

.guide-grid strong {
    color: var(--brand-ink);
}

.guide-grid p {
    margin-top: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.92rem;
}

/* Messages */
.message {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 7px;
    display: none;
    font-weight: 650;
}

.message.success {
    display: block;
    background: #e9f7f1;
    color: #0d684a;
    border: 1px solid #bfe6d6;
}

.message.error {
    display: block;
    background: #fff0ee;
    color: #9a2f2a;
    border: 1px solid #f4c6c2;
}

.message.info {
    display: block;
    background: #eef6f7;
    color: #1d4962;
    border: 1px solid #c7dfe5;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(14, 22, 36, 0.62);
    animation: fadeIn 0.25s;
    overflow-y: auto;
    align-items: flex-start;
    justify-content: center;
    padding: 1.25rem;
}

.modal-content {
    background: var(--surface);
    margin: 1.25rem auto;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    width: min(92vw, 640px);
    max-height: calc(100vh - 2.5rem);
    overflow-y: auto;
    box-shadow: 0 28px 80px rgba(11, 18, 32, 0.24);
    animation: slideDown 0.25s;
    position: relative;
}

.modal-header {
    margin-bottom: 1rem;
}

.modal-header h3,
.modal-content h3 {
    margin-top: 0.25rem;
    color: var(--brand-ink);
    font-size: 1.45rem;
}

.modal-header p {
    margin-top: 0.35rem;
    color: var(--text-secondary);
}

.modal-body {
    color: var(--text-primary);
}

.modal-body p {
    margin: 0.75rem 0;
}

.modal-body strong {
    color: var(--text-secondary);
}

.order-number-box {
    padding: 1.1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    text-align: center;
    position: relative;
    background:
        linear-gradient(140deg, rgba(17, 24, 39, 0.98), rgba(36, 91, 122, 0.92));
    color: #ffffff;
}

.order-number-label {
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.82rem;
    font-weight: 750;
}

.order-number-value {
    color: #ffffff;
    font-size: clamp(1rem, 3.5vw, 1.35rem);
    font-weight: 850;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    letter-spacing: 0.04em;
    margin: 0.35rem 0 0.65rem;
    word-break: break-all;
    cursor: pointer;
    user-select: all;
}

.btn-copy-order {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.28);
    padding: 0.5rem 0.9rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 750;
}

.btn-copy-order:hover,
.btn-copy-order.copied {
    background: rgba(255, 255, 255, 0.22);
}

.copy-hint {
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.78rem;
    margin-top: 0.6rem;
}

.confirmation-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.confirmation-grid p {
    margin: 0;
    padding: 0.85rem;
    background: var(--surface-muted);
    border: 1px solid rgba(217, 225, 236, 0.8);
    border-radius: 7px;
}

.confirmation-grid p.full {
    grid-column: 1 / -1;
}

.confirmation-grid strong,
.confirmation-grid span {
    display: block;
}

.confirmation-grid strong {
    margin-bottom: 0.25rem;
    font-size: 0.82rem;
}

.confirmation-grid span {
    color: var(--brand-ink);
    word-break: break-word;
}

.order-warning {
    background: var(--brand-gold-soft);
    border: 1px solid rgba(185, 139, 45, 0.3);
    color: #6f5119;
    padding: 1rem;
    border-radius: 7px;
    margin-bottom: 1rem;
    font-size: 0.92rem;
}

.payment-amount-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--radius);
    margin: 1rem 0;
    background: var(--brand-gold-soft);
    border: 1px solid rgba(185, 139, 45, 0.28);
}

.payment-label {
    color: #6f5119;
    font-weight: 750;
}

.payment-value {
    color: var(--brand-ink);
    font-size: 1.7rem;
    font-weight: 900;
}

.service-terms,
.payment-tips {
    background: var(--surface-muted);
    border: 1px solid rgba(217, 225, 236, 0.86);
    border-radius: 7px;
    padding: 1rem;
    margin-top: 1rem;
}

.service-terms p,
.payment-tips p {
    margin: 0 0 0.5rem;
}

.service-terms ul,
.payment-tips ul {
    margin: 0.5rem 0 0 1.2rem;
}

.service-terms li,
.payment-tips li {
    margin: 0.45rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    position: sticky;
    bottom: 0;
    background: var(--surface);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from {
        transform: translateY(-28px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Payment modal */
.payment-modal-content {
    max-width: 500px;
}

.payment-info-box {
    background: var(--surface-muted);
    border: 1px solid rgba(217, 225, 236, 0.86);
    border-radius: 7px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.payment-info-box p {
    margin: 0.5rem 0;
}

.payment-info-box .payment-amount {
    color: var(--brand-gold);
    font-size: 1.3rem;
    font-weight: 850;
}

.qr-code-container {
    text-align: center;
    padding: 1.35rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.qr-code-image {
    width: 200px;
    height: 200px;
    margin: 0 auto;
    display: block;
}

.qr-hint,
.success-hint,
.timeout-hint {
    margin-top: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.payment-countdown {
    text-align: center;
    padding: 0.75rem;
    background: var(--brand-gold-soft);
    border: 1px solid rgba(185, 139, 45, 0.22);
    border-radius: 7px;
    margin-bottom: 1rem;
}

.payment-countdown p {
    margin: 0;
    color: #6f5119;
    font-weight: 750;
}

.payment-countdown span {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 1.05rem;
    font-weight: 850;
}

.payment-status {
    text-align: center;
    padding: 1rem;
    min-height: 80px;
}

.payment-checking {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: var(--text-secondary);
}

.payment-success {
    color: var(--success-color);
}

.success-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--success-color);
    color: white;
    font-size: 1.8rem;
    line-height: 48px;
    margin: 0 auto 0.5rem;
}

.payment-timeout {
    color: var(--warning-color);
}

.timeout-icon {
    font-size: 2.3rem;
    margin-bottom: 0.5rem;
}

/* Order page and generated order info */
.order-info {
    background: var(--surface-muted);
    padding: 1.2rem;
    border-radius: var(--radius);
    border: 1px solid rgba(217, 225, 236, 0.86);
}

.order-detail p {
    margin: 0.75rem 0;
    line-height: 1.8;
}

.order-detail strong {
    display: inline-block;
    min-width: 96px;
    color: var(--text-secondary);
}

.status,
.order-detail .status {
    display: inline-block;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 800;
}

.status.success,
.order-detail .status.success {
    background: #e9f7f1;
    color: #0d684a;
}

.status.error,
.order-detail .status.error {
    background: #fff0ee;
    color: #9a2f2a;
}

.status.warning,
.order-detail .status.warning {
    background: var(--brand-gold-soft);
    color: #6f5119;
}

.order-detail .status.info {
    background: #eef6f7;
    color: #1d4962;
}

.generating-pulse {
    animation: pulse-opacity 1.5s ease-in-out infinite;
}

@keyframes pulse-opacity {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

.order-detail .error-text {
    color: var(--error-color);
    margin-top: 1rem;
    padding: 0.75rem;
    background: #fff0ee;
    border-radius: 7px;
}

.btn-continue-payment {
    background: var(--brand-blue);
    color: white;
    border: none;
    padding: 0.78rem 1.1rem;
    border-radius: 7px;
    font-size: 0.98rem;
    font-weight: 750;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 1rem;
    width: 100%;
}

.btn-continue-payment:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(36, 91, 122, 0.18);
}

.order-actions {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.order-action-hint {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
    margin: 0.6rem 0;
}

/* Brand landing page */
.brand-page {
    padding-bottom: 2.5rem;
}

.brand-hero .hero-copy h1 {
    font-size: clamp(2rem, 4.2vw, 4rem);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.6rem;
}

.hero-ghost {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.28);
}

.hero-ghost:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

.brand-summary {
    gap: 1rem;
}

.summary-line {
    color: var(--text-secondary);
    line-height: 1.8;
}

.brand-facts {
    display: grid;
    gap: 0.75rem;
}

.brand-facts div {
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.brand-facts dt {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 750;
}

.brand-facts dd {
    margin-top: 0.18rem;
    color: var(--brand-ink);
    font-weight: 750;
    word-break: break-word;
}

.brand-content-grid,
.audience-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.8fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.seo-copy,
.seo-side-panel,
.brand-value-section,
.brand-flow,
.brand-faq,
.audience-card,
.brand-cta,
.boundary-note {
    background: var(--surface);
    border: 1px solid rgba(217, 225, 236, 0.92);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.seo-copy,
.seo-side-panel,
.brand-value-section,
.brand-flow,
.brand-faq,
.audience-card,
.brand-cta,
.boundary-note {
    padding: clamp(1.2rem, 2.4vw, 2rem);
}

.seo-copy h2,
.seo-side-panel h2,
.brand-value-section h2,
.brand-flow h2,
.brand-faq h2,
.audience-card h2,
.brand-cta h2 {
    margin-top: 0.35rem;
    color: var(--brand-ink);
    line-height: 1.2;
}

.seo-copy p,
.brand-value-section p,
.audience-card p,
.brand-cta p,
.boundary-note span {
    margin-top: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.9;
}

.check-list {
    margin-top: 1rem;
    list-style: none;
    display: grid;
    gap: 0.7rem;
}

.check-list li {
    position: relative;
    padding-left: 1.35rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.check-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.67rem;
    width: 0.46rem;
    height: 0.46rem;
    border-radius: 50%;
    background: var(--brand-gold-strong);
}

.brand-value-section,
.brand-flow,
.brand-faq {
    margin-bottom: 1rem;
}

.value-grid,
.flow-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.value-grid article,
.flow-grid article,
.faq-list article {
    padding: 1rem;
    border-radius: var(--radius);
    background: var(--surface-muted);
    border: 1px solid rgba(217, 225, 236, 0.68);
}

.value-grid span,
.flow-grid span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--brand-ink);
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 850;
}

.value-grid h3,
.flow-grid h3,
.faq-list h3 {
    margin-top: 0.7rem;
    color: var(--brand-ink);
    font-size: 1rem;
    line-height: 1.35;
}

.value-grid p,
.flow-grid p,
.faq-list p {
    margin-top: 0.45rem;
    color: var(--text-secondary);
    font-size: 0.93rem;
    line-height: 1.75;
}

.audience-card.warning {
    background: var(--brand-gold-soft);
    border-color: rgba(185, 139, 45, 0.24);
}

.faq-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.brand-cta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
    background:
        linear-gradient(140deg, rgba(17, 24, 39, 0.98), rgba(36, 91, 122, 0.92));
    box-shadow: var(--shadow-panel);
}

.brand-cta h2 {
    color: #ffffff;
}

.brand-cta p {
    color: rgba(255, 255, 255, 0.78);
}

.brand-cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-end;
}

.boundary-note {
    display: flex;
    gap: 0.75rem;
    background: #ffffff;
}

.boundary-note strong {
    flex: 0 0 auto;
    color: #6f5119;
}

/* Terms modal */
.terms-overlay {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(14, 22, 36, 0.62);
}

.terms-dialog {
    position: relative;
    width: min(92vw, 800px);
    max-height: 84vh;
    overflow-y: auto;
    padding: 1.6rem;
    border-radius: var(--radius-lg);
    background: #ffffff;
    box-shadow: 0 28px 80px rgba(11, 18, 32, 0.24);
}

.terms-dialog h2 {
    margin-top: 0.35rem;
    color: var(--brand-ink);
}

.terms-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: #ffffff;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.3rem;
}

.terms-copy {
    margin-top: 1rem;
    color: var(--text-primary);
    line-height: 1.8;
}

.terms-copy h3 {
    margin-top: 1.25rem;
    margin-bottom: 0.35rem;
    color: var(--brand-ink);
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 1.25rem 0 1.8rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
}

.site-footer a {
    color: var(--text-muted);
}

/* Admin and legacy widgets */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.feature-card {
    display: block;
    padding: 1.2rem;
    background: var(--surface-muted);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-primary);
    transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
    text-decoration: none;
}

.history-item {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
}

.history-item .meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.download-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.download-group .btn {
    flex: 1;
    min-width: 140px;
    max-width: 200px;
}

.order-finder-hint,
.order-finder-hint-collapsible {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    background: var(--surface-muted);
    border: 1px solid var(--border-color);
}

.order-finder-hint h4 {
    margin-bottom: 0.75rem;
}

.order-finder-hint ul,
.order-finder-hint-collapsible ul {
    padding-left: 1.3rem;
}

.order-finder-hint li,
.order-finder-hint-collapsible li {
    margin: 0.45rem 0;
    color: var(--text-secondary);
}

.product-features {
    display: grid;
    gap: 0.45rem;
    margin-bottom: 1.5rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.feature-check {
    color: var(--success-color);
    font-weight: 800;
    flex-shrink: 0;
}

@media (max-width: 900px) {
    .hero-shell,
    .workbench-grid,
    .order-number-guide,
    .brand-content-grid,
    .audience-grid,
    .brand-cta {
        grid-template-columns: 1fr;
    }

    .hero-copy {
        min-height: auto;
    }

    .guide-grid,
    .value-grid,
    .flow-grid,
    .deliverable-grid,
    .faq-list {
        grid-template-columns: 1fr;
    }

    .sample-preview-section {
        grid-template-columns: 1fr;
    }

    .brand-cta-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .navbar {
        align-items: flex-start;
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
    }

    .nav-brand em {
        display: none;
    }

    .nav-links {
        width: 100%;
        flex-shrink: 0;
    }

    .nav-links a {
        flex: 1;
        padding: 0.45rem 0.55rem;
        font-size: 0.86rem;
        text-align: center;
    }

    .page-shell,
    .container {
        padding: 1rem 0.85rem 2rem;
    }

    .page-shell {
        display: flex;
        flex-direction: column;
    }

    .hero-copy,
    .compose-card,
    .delivery-card,
    .trust-panel,
    .status-workspace,
    .order-number-guide,
    .card {
        padding: 1rem;
    }

    .hero-copy {
        min-height: auto;
        justify-content: flex-start;
    }

    .hero-copy h1 {
        font-size: 1.92rem;
        line-height: 1.12;
    }

    .hero-lede {
        font-size: 0.96rem;
        line-height: 1.7;
    }

    .hero-capability-strip {
        margin-top: 1rem;
        gap: 0.45rem;
    }

    .hero-capability-strip span {
        min-height: 30px;
        padding: 0.28rem 0.56rem;
        font-size: 0.82rem;
    }

    .hero-proof-list {
        margin-top: 0.8rem;
        font-size: 0.88rem;
    }

    .mobile-value-strip {
        display: flex;
        flex-wrap: wrap;
    }

    .trust-panel {
        display: none;
    }

    .is-workbench-first .workbench-grid {
        order: -1;
    }

    .form-row,
    .confirmation-grid {
        grid-template-columns: 1fr;
    }

    .modal {
        padding: 0.75rem;
    }

    .modal-content {
        width: 100%;
        margin: 0.75rem auto;
    }

    .modal-actions,
    .result-actions,
    .content-actions,
    .hero-actions,
    .brand-cta-actions {
        flex-direction: column;
    }

    .modal-actions .btn,
    .result-actions .btn,
    .content-actions .btn,
    .hero-actions .btn,
    .brand-cta-actions .btn {
        width: 100%;
    }

    .payment-amount-box {
        align-items: flex-start;
        flex-direction: column;
    }

    .boundary-note {
        flex-direction: column;
    }
}
