/* dd.ecomma.co — app-specific styles
   Inherits from styles-base.css. Adds app components only. */

/* Override the public-website 1440px container — internal app uses full screen */
.container { max-width: 1680px; }

/* === DD Lockup (product mark beside the Ecomma logo) === */
.dd-lockup { display: inline-flex; align-items: center; gap: 14px; text-decoration: none; }
.dd-lockup .dd-bar { width: 1.5px; height: 26px; background: var(--accent-cyan); transition: height 200ms ease; }
.dd-lockup:hover .dd-bar { height: 32px; }
.dd-mark { display: inline-flex; flex-direction: column; line-height: 1; gap: 4px; }
.dd-mark .dd-letters { font-family: 'Playfair Display', Cambria, serif; font-size: 19px; font-weight: 700; color: var(--accent); letter-spacing: 0.02em; }
.dd-mark .dd-tag { font-size: 9px; font-weight: 700; color: var(--accent-cyan); letter-spacing: 0.18em; text-transform: uppercase; }

/* === App header (logged-in) === */
.app-nav { display: flex; gap: 36px; align-items: center; }
.app-nav a { color: var(--text-default); font-weight: 500; font-size: 16px; padding: 4px 0; border-bottom: 2px solid transparent; }
.app-nav a:hover { color: var(--accent-cyan); text-decoration: none; }
.app-nav a.is-active { color: var(--accent); font-weight: 700; border-bottom-color: var(--accent-cyan); }

.user-chip { display: inline-flex; align-items: center; gap: 10px; background: var(--bg-soft); border: 1px solid var(--rule); border-radius: 6px; padding: 6px 14px 6px 6px; font-size: 14px; color: var(--text-default); }
.user-chip .avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }

/* === Page hero (compact, app-style) === */
.page-hero { padding: 64px 0 32px; border-bottom: 1px solid var(--rule); }
.page-hero h1 { font-size: 48px; margin-bottom: 8px; }
.page-hero .deck { color: var(--text-muted); font-size: 18px; max-width: 720px; margin: 0; }

/* === Dashboard === */
.dash-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 32px; }
.dash-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin: 24px 0 48px; }
.stat { padding: 24px; border: 1px solid var(--rule); border-radius: 8px; background: #fff; box-shadow: 0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04); }
.stat .number { font-size: 36px; font-weight: 700; color: var(--accent); font-family: 'Playfair Display', Cambria, serif; line-height: 1; }
.stat .label { color: var(--text-muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 8px; }

/* === Run cards === */
.runs-list { display: flex; flex-direction: column; gap: 12px; margin: 24px 0; }
.run-card { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 24px; padding: 20px 24px; border: 1px solid var(--rule); border-radius: 8px; background: #fff; box-shadow: 0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04); transition: border-color 120ms ease, box-shadow 120ms ease; }
.run-card:hover { border-color: var(--accent-cyan); box-shadow: 0 2px 8px rgba(7,56,119,0.08), 0 1px 3px rgba(15,23,42,0.05); }
.run-card .name { font-weight: 700; color: var(--text-headline); font-size: 16px; margin-bottom: 4px; }
.run-card .meta { color: var(--text-muted); font-size: 13px; }
.status-pill { display: inline-block; padding: 4px 12px; border-radius: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.status-pill.queued { background: #FEF3C7; color: #92400E; }
.status-pill.running { background: #DBEAFE; color: #1E40AF; }
.status-pill.done { background: #D1FAE5; color: #065F46; }
.status-pill.failed { background: #FEE2E2; color: #991B1B; }

.verdict-mini { font-weight: 700; font-size: 13px; padding: 4px 10px; border-radius: 4px; }
.verdict-mini.hardpass { background: #FEE2E2; color: var(--c-critical); }
.verdict-mini.pass { background: #D1FAE5; color: #065F46; }
.verdict-mini.cond { background: #FEF3C7; color: #92400E; }

/* === Forms === */
.form-section { padding: 28px 36px; background: #fff; border: 1px solid var(--rule); border-radius: 10px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04); }
.form-section h2 { font-size: 20px; font-family: 'Inter', system-ui, sans-serif; font-weight: 700; display: flex; align-items: center; gap: 14px; margin: 0 0 6px; color: var(--text-headline); }
.form-section h2 .num { display: inline-flex; width: 32px; height: 32px; background: var(--c-accent-soft); color: var(--accent); border-radius: 50%; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; flex-shrink: 0; font-family: 'Inter', system-ui, sans-serif; }

/* Page wrapper for form pages — soft bg so cards float */
.form-page-bg { background: var(--bg-soft); }
.form-row { margin: 20px 0; }
.form-row label { display: block; font-weight: 600; color: var(--text-headline); font-size: 14px; margin-bottom: 8px; }
.form-row .help { color: var(--text-muted); font-size: 13px; margin-top: 6px; font-style: italic; }
.form-row input[type=url], .form-row input[type=text], .form-row textarea { width: 100%; max-width: 760px; padding: 12px 16px; border: 1px solid var(--rule); border-radius: 6px; background: #fff; font-size: 15px; font-family: 'Inter', system-ui, sans-serif; color: var(--text-default); transition: border-color 120ms ease; }

/* Two-column form-row grid */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 32px; }
.form-grid-2 .form-row { margin: 0; }
@media (max-width: 1100px) { .form-grid-2 { grid-template-columns: 1fr; } }
.form-row input:focus, .form-row textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--c-accent-soft); }

/* === Category accordion (collapsible form blocks) === */
.cat-acc { border: 1px solid var(--rule); border-radius: 8px; background: #fff; margin-bottom: 10px; overflow: hidden; box-shadow: 0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04); }
.cat-acc > summary { list-style: none; cursor: pointer; padding: 16px 22px; display: flex; align-items: center; gap: 16px; transition: background 120ms ease; }
.cat-acc > summary::-webkit-details-marker { display: none; }
.cat-acc > summary::marker { display: none; }
.cat-acc > summary:hover { background: var(--bg-soft); }
.cat-acc > summary .cat-head { flex: 1; }
.cat-acc > summary .cat-name { font-weight: 700; font-size: 16px; color: var(--text-headline); }
.cat-acc > summary .cat-sub { color: var(--text-muted); font-size: 13px; margin-top: 3px; line-height: 1.5; }
.cat-acc > summary .cat-chev { transition: transform 200ms ease; flex-shrink: 0; color: var(--text-muted); }
.cat-acc[open] > summary .cat-chev { transform: rotate(180deg); }
.cat-acc[open] > summary { border-bottom: 1px solid var(--rule); }
.cat-acc .cat-body { padding: 22px; }

/* === Multiselect chips field (typeahead + chips) === */
.ms-field { position: relative; }
.ms-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 6px; background: #fff; min-height: 52px; align-items: center; transition: border-color 120ms ease; }
.ms-chips:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--c-accent-soft); }
.ms-chip { display: inline-flex; align-items: center; gap: 4px; padding: 8px 6px 8px 14px; background: var(--c-accent-soft); border: 1px solid var(--accent); border-radius: 6px; font-size: 14px; color: var(--accent); font-weight: 600; line-height: 1.4; }
.ms-chip .ms-x { background: transparent; border: 0; color: var(--accent); cursor: pointer; padding: 4px 8px; border-radius: 3px; font-size: 15px; line-height: 1; opacity: 0.6; }
.ms-chip .ms-x:hover { background: rgba(7,56,119,0.12); opacity: 1; }
.ms-input { flex: 1; min-width: 220px; border: 0; outline: 0; padding: 4px 6px; font-size: 14px; font-family: 'Inter', system-ui, sans-serif; color: var(--text-default); background: transparent; }
.ms-input::placeholder { color: var(--text-muted); }
.ms-dropdown { position: absolute; top: 100%; left: 0; right: 0; margin-top: 4px; max-height: 320px; overflow-y: auto; background: #fff; border: 1px solid var(--rule); border-radius: 6px; box-shadow: 0 6px 20px rgba(0,0,0,0.08); z-index: 10; padding: 4px 0; }
.ms-dropdown .ms-option { padding: 9px 14px; cursor: pointer; font-size: 14px; color: var(--text-default); }
.ms-dropdown .ms-option:hover { background: var(--bg-soft); color: var(--accent); }
.ms-dropdown .ms-section { padding: 10px 14px 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); background: var(--bg-soft); margin-top: 4px; }
.ms-dropdown .ms-section:first-child { margin-top: 0; }

/* Pill-style choice groups */
.choice-group { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.choice-group .choice { display: inline-flex; align-items: center; padding: 10px 18px; border: 1px solid var(--rule); border-radius: 8px; font-size: 14px; cursor: pointer; background: #fff; user-select: none; transition: all 120ms ease; }
.choice-group .choice:hover { border-color: var(--accent-cyan); }
.choice-group .choice input { display: none; }
.choice-group .choice.is-selected { background: var(--c-accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }

/* === How-it-works step list === */
.steps { margin: 32px 0; }
.step-row { display: grid; grid-template-columns: 64px 1fr; gap: 24px; padding: 24px 0; border-top: 1px solid var(--rule); }
.step-row:last-child { border-bottom: 1px solid var(--rule); }
.step-num { width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: #fff; font-family: 'Playfair Display', Cambria, serif; font-size: 22px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.step-row.done .step-num { background: #065F46; }
.step-row .step-title { font-size: 20px; font-family: 'Playfair Display', Cambria, serif; font-weight: 600; color: var(--text-headline); margin-bottom: 6px; }
.step-row .step-desc { color: var(--text-default); font-size: 15px; line-height: 1.6; }
.step-row .step-meta { color: var(--text-muted); font-size: 13px; margin-top: 8px; font-style: italic; }

/* === Methodology cards === */
.method-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin: 32px 0; }
.method-card { padding: 32px; border: 1px solid var(--rule); border-radius: 8px; background: #fff; box-shadow: 0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04); }
.method-card .icon { width: 40px; height: 40px; border-radius: 8px; background: var(--c-accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; margin-bottom: 16px; }
.method-card h3 { font-size: 20px; font-family: 'Playfair Display', Cambria, serif; font-weight: 600; color: var(--text-headline); margin-bottom: 8px; }
.method-card p { color: var(--text-default); font-size: 14px; line-height: 1.6; margin: 0; }

/* === Templates === */
.template-list { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 24px 0; }
.template-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 20px; padding: 20px 24px; border: 1px solid var(--rule); border-radius: 8px; background: #fff; align-items: center; box-shadow: 0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04); }
.template-row .name { font-weight: 700; color: var(--text-headline); font-size: 15px; margin-bottom: 4px; }
.template-row .meta { color: var(--text-muted); font-size: 13px; }
.template-row .ext { display: inline-block; padding: 4px 10px; border-radius: 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; background: var(--bg-soft); color: var(--text-muted); }

.kv-grid { display: grid; grid-template-columns: 220px 1fr; gap: 12px 32px; padding: 24px 0; }
.kv-grid dt { font-weight: 600; color: var(--text-headline); font-size: 14px; }
.kv-grid dd { color: var(--text-default); font-size: 14px; margin: 0; }
.kv-grid code { background: var(--bg-soft); padding: 2px 8px; border-radius: 3px; font-family: Consolas, Monaco, monospace; font-size: 13px; color: var(--accent); }

/* === Repository === */
.repo-filter { display: flex; gap: 8px; margin: 24px 0; flex-wrap: wrap; }
.repo-filter button { padding: 6px 14px; border: 1px solid var(--rule); border-radius: 6px; background: #fff; font-size: 13px; cursor: pointer; }
.repo-filter button.is-active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* === Section internal nav (for long pages) === */
.section-toc { position: sticky; top: 100px; align-self: start; padding: 18px; border: 1px solid var(--rule); border-radius: 8px; background: #fff; font-size: 14px; }
.section-toc .toc-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 12px; }
.section-toc ol { list-style: none; padding: 0; margin: 0; }
.section-toc li { margin: 6px 0; }
.section-toc a { color: var(--text-default); display: block; padding: 4px 0; }
.section-toc a:hover { color: var(--accent); text-decoration: none; }

.with-toc { display: grid; grid-template-columns: 240px 1fr; gap: 64px; padding: 64px 0; }

/* === Footer === */
.app-footer { padding: 48px 0; border-top: 1px solid var(--rule); color: var(--text-soft); font-size: 13px; }
.app-footer .container { display: flex; justify-content: space-between; align-items: center; }

@media (max-width: 980px) {
  .dash-stats { grid-template-columns: repeat(2, 1fr); }
  .method-grid { grid-template-columns: 1fr; }
  .with-toc { grid-template-columns: 1fr; }
  .section-toc { position: static; }
  .run-card { grid-template-columns: 1fr; }
  .template-row { grid-template-columns: 1fr; gap: 8px; }
}
