/* Advisor-specific additions on top of the ported InkCMS admin.css.
   Keep admin.css untouched so it can be re-synced from InkCMS. */

/* Website page tabs */
.advisor-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    border-bottom: 1px solid var(--ink-border);
    margin: 0 0 1.25rem;
}
.advisor-tabs a {
    padding: 0.55rem 0.9rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--ink-text-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.advisor-tabs a:hover { color: var(--ink-text); }
.advisor-tabs a.is-active {
    color: var(--ink-text);
    border-bottom-color: var(--ink-accent);
}

/* Small inline forms in table rows */
.advisor-inline-form {
    display: inline-flex;
    gap: 0.35rem;
    align-items: center;
    margin: 0;
}
.advisor-inline-form .admin-input { padding: 0.3rem 0.5rem; font-size: 0.82rem; width: auto; }

/* Code block for embed snippets */
.advisor-code {
    display: block;
    white-space: pre-wrap;
    word-break: break-all;
    background: var(--ink-inverse-bg);
    color: var(--ink-inverse-text);
    border-radius: 8px;
    padding: 0.9rem 1rem;
    font-family: var(--ink-mono, ui-monospace, monospace);
    font-size: 0.82rem;
    line-height: 1.5;
}

.advisor-danger {
    border: 1px solid var(--ink-error, #dc2626);
}
.advisor-danger h3 { color: var(--ink-error, #dc2626); }

.advisor-row-actions { display: flex; gap: 0.35rem; flex-wrap: wrap; justify-content: flex-end; }

/* Revision history: field values and line diffs */
.advisor-value {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: var(--ink-mono, ui-monospace, monospace);
    font-size: 0.82rem;
    line-height: 1.5;
    background: var(--ink-surface-2, rgba(0,0,0,.03));
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    margin: 0;
    max-height: 420px;
    overflow: auto;
}
.advisor-diff { padding: 0; }
.advisor-diff > div { padding: 0 0.75rem; min-height: 1.5em; }
.advisor-diff .is-added { background: rgba(22, 163, 74, .14); }
.advisor-diff .is-added::before { content: "+ "; color: #15803d; }
.advisor-diff .is-removed { background: rgba(220, 38, 38, .12); text-decoration: line-through; text-decoration-color: rgba(220,38,38,.5); }
.advisor-diff .is-removed::before { content: "- "; color: #b91c1c; }
.advisor-diff .is-same::before { content: "  "; }
.advisor-field-row { margin-bottom: 1rem; }
.advisor-field-row h4 { margin: 0 0 0.35rem; font-size: 0.9rem; }
.advisor-field-row.is-unchanged h4 { color: var(--ink-muted, #6b7280); font-weight: 500; }

/* Question catalog: full answers rendered as visitors saw them */
.advisor-answer { max-height: 340px; overflow: auto; font-size: 0.88rem; line-height: 1.5; padding-right: 0.5rem; }
.advisor-answer p { margin: 0 0 0.5rem; }
.advisor-answer ul, .advisor-answer ol { margin: 0 0 0.5rem; padding-left: 1.2rem; }
.advisor-answer h3, .advisor-answer h4 { margin: 0.5rem 0 0.35rem; font-size: 0.92rem; }
.advisor-answer .unverified { text-decoration: line-through; text-decoration-color: rgba(220,38,38,.6); }
.advisor-answer .ink-adv-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.4rem; margin-top: 0.5rem; }
.advisor-answer .ink-adv-tile { display: block; border: 1px solid var(--ink-border, #e5e7eb); border-radius: 8px; padding: 0.4rem 0.55rem; text-decoration: none; }
.advisor-answer .ink-adv-tile__label { display: block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-muted, #6b7280); }
.advisor-answer .ink-adv-tile__title { display: block; font-weight: 600; }
.advisor-answer .ink-adv-tile__sub { display: block; font-size: 0.78rem; color: var(--ink-muted, #6b7280); }
.advisor-answer .ink-adv-note, .advisor-answer .ink-adv-tip, .advisor-answer .ink-adv-warn { padding: 0.4rem 0.6rem; border-radius: 6px; margin: 0.4rem 0; }
.advisor-answer .ink-adv-note { background: #eff6ff; } .advisor-answer .ink-adv-tip { background: #ecfdf3; } .advisor-answer .ink-adv-warn { background: #fef3f2; }

/* Widget Style: form beside a live preview of the website */
.advisor-style-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(420px, 560px); gap: 1.25rem; align-items: start; }
.advisor-style-form { max-width: none; }
.advisor-style-preview { position: sticky; top: 1rem; }
.advisor-style-preview iframe { width: 100%; height: 720px; border: 1px solid var(--ink-border, #e5e7eb); border-radius: 8px; background: #fff; }
@media (max-width: 1200px) { .advisor-style-layout { grid-template-columns: 1fr; } .advisor-style-preview { position: static; } }
.advisor-color-field { display: flex; gap: 0.4rem; align-items: center; }
.advisor-color-field .advisor-swatch { width: 2.4rem; height: 2.2rem; padding: 0.1rem; border: 1px solid var(--ink-border, #e5e7eb); border-radius: 6px; background: none; flex: none; cursor: pointer; }
.advisor-site-frame { width: 100%; height: 760px; border: 1px solid var(--ink-border, #e5e7eb); border-radius: 8px; background: #fff; }

/* Admin AI helper panel */
.advisor-helper-launch { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 40; border: 0; border-radius: 999px; padding: 0.7rem 1.1rem;
  background: var(--ink-accent, #1d4ed8); color: #fff; font-weight: 700; cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.advisor-helper-launch.is-open { display: none; }
.advisor-helper { position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100vw); z-index: 50; display: flex; flex-direction: column;
  background: var(--ink-surface, #fff); border-left: 1px solid var(--ink-border, #e5e7eb); box-shadow: -12px 0 32px rgba(0,0,0,.12); }
.advisor-helper[hidden] { display: none; }
.advisor-helper__head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--ink-border, #e5e7eb); }
.advisor-helper__log { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.75rem; font-size: 0.9rem; line-height: 1.5; }
.advisor-helper__hint { color: var(--ink-muted, #6b7280); display: flex; flex-direction: column; gap: 0.4rem; }
.advisor-helper__hint button { text-align: left; border: 1px solid var(--ink-border, #e5e7eb); background: none; border-radius: 8px; padding: 0.45rem 0.6rem; cursor: pointer; color: inherit; font: inherit; }
.advisor-helper__msg { border-radius: 10px; padding: 0.55rem 0.75rem; max-width: 100%; overflow-wrap: anywhere; }
.advisor-helper__msg.is-user { align-self: flex-end; background: var(--ink-accent-tint, #eef2ff); }
.advisor-helper__msg.is-assistant { background: var(--ink-surface-2, #f8fafc); }
.advisor-helper__msg.is-error { background: #fef2f2; color: #991b1b; }
.advisor-helper__msg p { margin: 0 0 0.45rem; } .advisor-helper__msg p:last-child { margin-bottom: 0; }
.advisor-helper__msg ul, .advisor-helper__msg ol { margin: 0 0 0.45rem; padding-left: 1.2rem; }
.advisor-helper__status { color: var(--ink-muted, #6b7280); font-style: italic; }
.advisor-helper__proposal { border: 1px solid var(--ink-accent, #1d4ed8); border-radius: 10px; padding: 0.6rem 0.75rem; display: flex; flex-direction: column; gap: 0.4rem; }
.advisor-helper__proposal-title { font-weight: 700; }
.advisor-helper__field { font-weight: 600; font-size: 0.82rem; margin-top: 0.25rem; }
.advisor-helper__proposal .advisor-value { max-height: 260px; font-size: 0.78rem; }
.advisor-helper__actions { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.advisor-helper__form { display: flex; gap: 0.5rem; padding: 0.75rem 1rem; border-top: 1px solid var(--ink-border, #e5e7eb); }
.advisor-helper__form textarea { flex: 1; resize: none; font: inherit; padding: 0.5rem 0.6rem; border: 1px solid var(--ink-border, #e5e7eb); border-radius: 8px; }
