/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
@import url(https://use.typekit.net/hgq1bfb.css);
:root {
    --bg:         #0f0f0f;
    --surface:    #1a1a1a;
    --surface-2:  #242424;
    --border:     #2e2e2e;
    --text:       #e8e8e8;
    --text-muted: #888;
    --accent:     #ff5d28;
    --accent-dim: #ff5d28;
    --red:        #ff4d4d;
    --radius:     0px;
    --font:          neue-haas-grotesk-display, sans-serif;
}



html { font-size: 16px; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    line-height: 1.6;
    min-height: 100vh;
}

/* === Layout === */
.container {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 24px;
}

/* === Header === */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.site-logo {
    height: 22px;
    width: auto;
    display: block;
}

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

nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color .15s;
}

nav a:hover, nav a.active { color: var(--text); }

/* === Buttons === */
.btn-primary {
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: var(--radius);
    padding: 8px 18px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background .15s;
}

.btn-primary:hover { background: var(--accent-dim); }

.btn-primary.btn-large {
    padding: 14px 32px;
    font-size: 1rem;
    width: 100%;
    text-align: center;
}

.btn-secondary {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 16px;
    font-size: 0.875rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background .15s, border-color .15s;
}

.btn-secondary:hover { background: var(--border); }
.btn-sm { padding: 5px 12px; font-size: 0.8rem; }

/* === Cards === */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 20px;
}

/* === Typography === */
.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 32px 0 24px;
    letter-spacing: -0.03em;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.section-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.field-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 8px;
}

/* === Inputs === */
.input-text {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.95rem;
    padding: 10px 14px;
    outline: none;
    transition: border-color .15s;
}

.input-text:focus { border-color: var(--accent); }

textarea.input-text {
    resize: vertical;
    min-height: 90px;
    font-family: var(--font);
}

/* === Drop Zone === */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
}

.drop-zone.dragover {
    border-color: var(--accent);
    background: rgba(200,255,0,.04);
}

.drop-zone__icon {
    font-size: 2.5rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.drop-zone p { color: var(--text-muted); font-size: 0.9rem; }

.drop-zone__link {
    color: var(--accent);
    cursor: pointer;
    text-decoration: underline;
}

/* === File list === */
.file-list {
    list-style: none;
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.875rem;
}

.file-list li .file-remove {
    margin-left: auto;
    color: var(--red);
    cursor: pointer;
    font-size: 1rem;
    background: none;
    border: none;
    padding: 0;
}

/* === Context fields === */
.context-field {
    display: grid;
    grid-template-columns: 180px 1fr auto;
    gap: 10px;
    align-items: start;
    margin-bottom: 12px;
}

.context-field__remove {
    background: none;
    border: none;
    color: var(--red);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 10px 4px;
    align-self: center;
}

/* === Actions === */
.actions { margin-bottom: 32px; }

/* === Result === */
.result-card { border-left: 3px solid var(--accent); }

.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.result-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.result-date { font-size: 0.8rem; color: var(--text-muted); }

.insight-text {
    font-size: 1.05rem;
    line-height: 1.8;
    white-space: pre-wrap;
}

.result-meta {
    margin-top: 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.prompt-details {
    margin-top: 20px;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

.prompt-details summary {
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.prompt-pre {
    margin-top: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: pre-wrap;
    word-break: break-word;
    overflow: auto;
    max-height: 400px;
}

/* === Loading === */
.loading {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    color: var(--text-muted);
    padding: 20px 0;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    display: inline-block;
}

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

/* === Dashboard === */
.sessions-grid {
    display: grid;
    gap: 16px;
}

.session-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: border-color .15s;
}

.session-card:hover { border-color: #444; }

.session-card__meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.session-card__meta time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.session-card__title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.session-card__preview {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 16px;
}

.session-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.session-card__files { font-size: 0.8rem; color: var(--text-muted); }

/* === Badge === */
.badge {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.badge--pdf { border-color: #ff7043; color: #ff7043; }
.badge--txt { border-color: #42a5f5; color: #42a5f5; }
.badge--md  { border-color: #ab47bc; color: #ab47bc; }

/* === View page === */
.view-header { margin: 32px 0 24px; }

.back-link {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-decoration: none;
    display: inline-block;
    margin-bottom: 12px;
}

.back-link:hover { color: var(--text); }

.view-date {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.file-list-view {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-list-view li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.context-list dt {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-top: 14px;
}

.context-list dd {
    font-size: 0.95rem;
    margin-top: 2px;
}

/* === Empty state === */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state p { margin-bottom: 20px; }

/* === Generate section === */
.generate-section { margin-top: 40px; }

/* === History title === */
.history-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
    margin: 40px 0 16px;
    letter-spacing: .03em;
    text-transform: uppercase;
    font-size: 0.8rem;
}

/* === Library === */
.library-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 32px;
    line-height: 1.6;
}

.library-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.file-date {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-left: auto;
    margin-right: 8px;
}

/* === Save status === */
.save-status {
    margin-top: 10px;
    font-size: 0.85rem;
}

.save-status--ok  { color: var(--accent); }
.save-status--err { color: var(--red); }

/* === Utility === */
.hidden { display: none !important; }
