/* Ask Fasto — ported 1:1 from Hello World Project (src/components/admin/fasto/fasto.css). */
.af-root {
  --bg: #f7f3ee;
  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #94a3b8;
  --ink-4: #64748b;
  --line: #ebe4da;
  --line-2: #f1ebe0;
  --admin2-primary: #1d3a5a;
  --admin2-primary-hover: #14253a;
  --display-font: 'Instrument Serif', Georgia, serif;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  height: 100%;
}
.af-root button { font-family: inherit; cursor: pointer; border: none; background: transparent; }

.af-content { flex: 1; min-height: 0; overflow: hidden; background: var(--bg); display: flex; }

.af-history {
  width: 240px; flex-shrink: 0;
  border-right: 1px solid var(--line);
  background: #fff; display: flex; flex-direction: column;
}
.af-history-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.af-history-head h3 { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink); }
.af-new-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 7px;
  background: var(--admin2-primary); color: #fff;
  font-size: 11.5px; font-weight: 600;
}
.af-new-btn:hover { background: var(--admin2-primary-hover); }

.af-history-list { flex: 1; overflow-y: auto; padding: 8px; }
.af-history-section { font-size: 10.5px; font-weight: 600; color: var(--ink-3); letter-spacing: .1em; text-transform: uppercase; padding: 10px 8px 4px; }
.af-history-item {
  padding: 8px 10px; border-radius: 7px;
  font-size: 12.5px; color: var(--ink-2);
  cursor: pointer; transition: background .12s, color .12s;
  width: 100%; text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border: none; background: transparent; font-family: inherit;
  display: flex; align-items: center; gap: 8px;
}
.af-history-item:hover { background: var(--bg); color: var(--ink); }
.af-history-item.active { background: rgba(29,58,90,.07); color: var(--ink); font-weight: 600; }
.af-history-item-ic { color: var(--ink-3); flex-shrink: 0; }
.af-history-item.active .af-history-item-ic { color: var(--admin2-primary); }
.af-history-item-txt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.af-main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }

.af-empty { flex: 1; display: flex; flex-direction: column; overflow-y: auto; padding: 24px 32px 32px; }
.af-empty-inner { max-width: 880px; margin: 0 auto; width: 100%; display: flex; flex-direction: column; gap: 24px; }

.af-hero {
  border-radius: 18px;
  background: linear-gradient(135deg, #1d3a5a 0%, #14253a 60%, #0c1828 100%);
  color: #fff; padding: 28px 32px;
  position: relative; overflow: hidden;
  min-height: 280px;
  display: flex; gap: 24px; align-items: center;
}
.af-hero-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(380px 240px at 92% 12%, rgba(192,138,62,.32), transparent 60%),
    radial-gradient(420px 280px at 6% 100%, rgba(96,165,250,.12), transparent 60%);
}
.af-hero-text { position: relative; flex: 1; min-width: 0; max-width: 380px; }
.af-hero-kicker {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: #f5d49b; margin-bottom: 12px;
}
.af-hero-h {
  font-family: var(--display-font); font-style: italic; font-weight: 400;
  font-size: 40px; line-height: 1.05; letter-spacing: -.02em; margin: 0 0 12px;
}
.af-hero-h em { font-style: italic; color: #f5d49b; }
.af-hero-sub { font-size: 14.5px; color: rgba(255,255,255,.78); line-height: 1.55; }

.af-hero-anim {
  position: relative; flex: 1; min-width: 0; min-height: 240px;
  border-radius: 12px; overflow: hidden;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
}

.af-quick-head { display: flex; align-items: baseline; gap: 12px; }
.af-quick-head h3 { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.af-quick-head .sub { font-size: 12.5px; color: var(--ink-3); }

.af-quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 980px) { .af-quick-grid { grid-template-columns: repeat(2, 1fr); } }

.af-quick {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 18px; text-align: left;
  display: flex; flex-direction: column; gap: 8px;
  cursor: pointer; transition: transform .12s, box-shadow .12s, border-color .12s;
}
.af-quick:hover { border-color: #d6c8b3; transform: translateY(-1px); box-shadow: 0 6px 16px -8px rgba(15,30,50,.12); }
.af-quick-row { display: flex; align-items: center; gap: 10px; }
.af-quick-ic {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  display: grid; place-items: center;
}
.af-quick-ic.gold { background: linear-gradient(135deg,#f5d49b,#c08a3e); color: #2a1c08; }
.af-quick-ic.navy { background: linear-gradient(135deg,#1d3a5a,#0b1626); color: #f5d49b; }
.af-quick-ic.green { background: #dcfce7; color: #15803d; }
.af-quick-ic.blue { background: #dbeafe; color: #1d4ed8; }
.af-quick-ic.amber { background: #fef3c7; color: #92571c; }
.af-quick-ic.pink { background: #fce7f3; color: #be185d; }
.af-quick-title { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.af-quick-desc { font-size: 12.5px; color: var(--ink-4); line-height: 1.45; }

.af-composer-card {
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  padding: 20px; box-shadow: 0 4px 14px -8px rgba(15,30,50,.08);
}
.af-composer-row { display: flex; align-items: flex-start; gap: 12px; }
.af-composer-textarea {
  flex: 1; min-width: 0;
  border: none; outline: none; resize: none;
  font-family: inherit; font-size: 15px; line-height: 1.55;
  color: var(--ink); min-height: 50px; max-height: 200px;
  background: transparent; padding: 8px 4px;
}
.af-composer-textarea::placeholder { color: var(--ink-3); }
.af-composer-actions { display: flex; gap: 6px; flex-shrink: 0; align-items: center; }
.af-composer-icon {
  width: 36px; height: 36px; border-radius: 9px;
  display: grid; place-items: center; color: var(--ink-4);
  background: var(--bg); border: 1px solid var(--line);
}
.af-composer-icon:hover { background: #ebe4da; color: var(--ink); }
.af-composer-send {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--admin2-primary); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 2px 6px rgba(29,58,90,.2);
}
.af-composer-send:hover { background: var(--admin2-primary-hover); }
.af-composer-send:disabled { background: var(--line); color: var(--ink-3); box-shadow: none; }

.af-suggestions { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 4px; }
.af-sug {
  padding: 6px 12px; border-radius: 999px;
  background: var(--bg); color: var(--ink-2);
  border: 1px solid var(--line);
  font-size: 12.5px; font-weight: 500; cursor: pointer;
  transition: background .12s, color .12s;
}
.af-sug:hover { background: #ebe4da; color: var(--ink); }
.af-sug-ic { display: inline-block; margin-right: 5px; vertical-align: -1px; }

.af-active { flex: 1; display: flex; min-height: 0; }
.af-chat { flex: 1; min-width: 0; display: flex; flex-direction: column; background: #fff; }
.af-chat-thread { flex: 1; overflow-y: auto; padding: 24px 28px; }
.af-chat-thread-inner { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }

.af-msg { display: flex; gap: 12px; align-items: flex-start; }
.af-msg.user { flex-direction: row-reverse; }
.af-msg-avatar {
  width: 32px; height: 32px; border-radius: 999px; flex-shrink: 0;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 12.5px;
}
.af-msg-avatar.bot { background: linear-gradient(135deg, #1d3a5a, #0b1626); color: #f5d49b; }
.af-msg-avatar.user { background: linear-gradient(135deg,#f59e0b,#ea580c); }
.af-msg-body { flex: 1; min-width: 0; max-width: 580px; }
.af-msg-name { font-size: 11px; font-weight: 700; color: var(--ink-3); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 4px; }
.af-msg.user .af-msg-name { text-align: right; }
.af-msg-bubble {
  padding: 12px 16px; border-radius: 14px;
  font-size: 14.5px; line-height: 1.55; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line);
  white-space: pre-wrap;
}
.af-msg.user .af-msg-bubble { background: var(--admin2-primary); color: #fff; border-color: transparent; }
.af-msg-bubble.thinking {
  background: transparent; border: 1px dashed var(--line);
  font-style: italic; color: var(--ink-4); font-size: 13.5px;
}
.af-msg-bubble .cursor { display:inline-block; width:8px; height:1em; background:currentColor; vertical-align:-2px; margin-left:2px; opacity:.6; animation: cursorBlink 1s infinite; }
@keyframes cursorBlink { 50% { opacity: 0; } }

.af-trace { margin-top: 8px; }
.af-trace-row { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--ink-4); padding: 4px 0; }
.af-trace-row .check { width: 14px; height: 14px; border-radius: 999px; background: #dcfce7; color: #15803d; display: grid; place-items: center; flex-shrink: 0; }
.af-trace-row .spin { width: 14px; height: 14px; border-radius: 999px; border: 2px solid var(--line); border-top-color: var(--admin2-primary); animation: spin 0.8s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

.af-artifact-chip {
  margin-top: 12px; display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; cursor: pointer;
  transition: border-color .12s, box-shadow .12s;
}
.af-artifact-chip:hover { border-color: var(--admin2-primary); box-shadow: 0 4px 14px -8px rgba(29,58,90,.18); }
.af-artifact-chip-ic { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
.af-artifact-chip-body { flex: 1; min-width: 0; }
.af-artifact-chip-title { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.af-artifact-chip-meta { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.af-artifact-chip-cta { font-size: 12px; font-weight: 600; color: var(--admin2-primary); display: inline-flex; align-items: center; gap: 4px; }

.af-chat-input { border-top: 1px solid var(--line); padding: 14px 24px 18px; background: #fff; }
.af-chat-input-inner {
  max-width: 720px; margin: 0 auto;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 12px;
  display: flex; align-items: flex-end; gap: 10px;
  transition: border-color .12s, box-shadow .12s;
}
.af-chat-input-inner:focus-within { border-color: var(--admin2-primary); box-shadow: 0 0 0 3px rgba(29,58,90,.08); }
.af-chat-input-textarea {
  flex: 1; min-width: 0;
  border: none; outline: none; resize: none;
  font-family: inherit; font-size: 14px; line-height: 1.5;
  color: var(--ink); min-height: 24px; max-height: 160px;
  background: transparent; padding: 6px 4px;
}

.af-artifact-pane {
  width: 560px; flex-shrink: 0;
  border-left: 1px solid var(--line);
  background: var(--bg);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.af-artifact-head {
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  background: #fff;
  display: flex; align-items: center; gap: 10px;
}
.af-artifact-head .ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; }
.af-artifact-head .nm { font-size: 14px; font-weight: 600; color: var(--ink); }
.af-artifact-head .mt { font-size: 11px; color: var(--ink-3); margin-top: 1px; }
.af-artifact-actions { display: flex; gap: 6px; margin-left: auto; }
.af-artifact-actions button {
  padding: 6px 10px; border-radius: 7px; font-size: 12px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--bg); color: var(--ink-2); border: 1px solid var(--line);
}
.af-artifact-actions button:hover { background: #ebe4da; color: var(--ink); }
.af-artifact-actions button.primary { background: var(--admin2-primary); color: #fff; border-color: transparent; }
.af-artifact-actions button.primary:hover { background: var(--admin2-primary-hover); }

.af-artifact-body { flex: 1; overflow-y: auto; padding: 22px; background: #fafaf7; }
.af-doc {
  background: #fff; border-radius: 10px;
  box-shadow: 0 1px 3px rgba(15,30,50,.05);
  border: 1px solid var(--line);
  padding: 32px 36px;
  font-size: 13px; color: var(--ink); line-height: 1.55;
}
.af-doc-letterhead {
  border-bottom: 2px solid #c08a3e; padding-bottom: 14px; margin-bottom: 18px;
  display: flex; align-items: flex-start; justify-content: space-between;
}
.af-doc-letterhead .brand { font-family: var(--display-font); font-style: italic; font-size: 24px; color: var(--ink); letter-spacing: -.01em; }
.af-doc-letterhead .meta { text-align: right; font-size: 11px; color: var(--ink-3); line-height: 1.5; }
.af-doc h2 { margin: 0 0 14px; font-family: var(--display-font); font-style: italic; font-weight: 400; font-size: 26px; letter-spacing: -.01em; }
.af-doc h3 { margin: 18px 0 8px; font-size: 12px; font-weight: 700; color: var(--ink-3); letter-spacing: .1em; text-transform: uppercase; }
.af-doc p { margin: 0 0 10px; }
.af-doc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.af-doc-row { display: flex; flex-direction: column; gap: 1px; }
.af-doc-row .k { font-size: 10.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.af-doc-row .v { font-size: 13px; color: var(--ink); font-weight: 500; }
.af-doc-table { width: 100%; border-collapse: collapse; margin: 10px 0 8px; }
.af-doc-table th { text-align: left; font-size: 10.5px; font-weight: 700; color: var(--ink-3); letter-spacing: .06em; text-transform: uppercase; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.af-doc-table td { padding: 10px 6px; border-bottom: 1px solid var(--line-2); font-size: 13px; vertical-align: top; }
.af-doc-table td.right { text-align: right; font-variant-numeric: tabular-nums; }
.af-doc-table th.right { text-align: right; }
.af-doc-totals { margin-top: 10px; display: flex; justify-content: flex-end; }
.af-doc-totals-inner { width: 280px; }
.af-doc-totals-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; }
.af-doc-totals-row.total { border-top: 2px solid var(--ink); margin-top: 4px; padding-top: 10px; font-size: 16px; font-weight: 700; }
.af-doc-foot { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--ink-3); }

.af-doc-streaming-bar {
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--admin2-primary), transparent);
  background-size: 200% 100%;
  animation: streamingShine 1.5s linear infinite;
  z-index: 2;
}
@keyframes streamingShine { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.af-doc-streaming { position: relative; }
.af-doc-streaming .cursor { display:inline-block; width:8px; height:1em; background: var(--admin2-primary); vertical-align:-2px; margin-left:1px; opacity:.7; animation: cursorBlink 1s infinite; }
.af-doc-customer { background: var(--bg); border-radius: 8px; padding: 10px 12px; font-size: 12.5px; line-height: 1.5; }

.af-wizard { padding: 22px; height: 100%; overflow-y: auto; }
.af-wizard h3 { margin: 0 0 6px; font-size: 18px; font-weight: 600; color: var(--ink); }
.af-wizard .lead { font-size: 13px; color: var(--ink-4); margin-bottom: 18px; }
.af-wizard-field { margin-bottom: 14px; }
.af-wizard-label { font-size: 11px; font-weight: 600; color: var(--ink-3); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 6px; display: block; }
.af-wizard-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.af-wizard-input, .af-wizard-select, .af-wizard-textarea {
  width: 100%; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; font-size: 14px; color: var(--ink); font-family: inherit; outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.af-wizard-input:focus, .af-wizard-select:focus, .af-wizard-textarea:focus { border-color: var(--admin2-primary); box-shadow: 0 0 0 3px rgba(29,58,90,.08); }
.af-wizard-textarea { resize: vertical; min-height: 64px; line-height: 1.45; }

.af-line-rows { display: flex; flex-direction: column; gap: 6px; }
.af-line-row {
  display: grid; grid-template-columns: 1fr 80px 100px 30px; gap: 8px; align-items: center;
  padding: 6px 10px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line);
}
.af-line-row .lr-name { font-size: 13px; color: var(--ink); }
.af-line-row .lr-meta { font-size: 11px; color: var(--ink-3); margin-top: 1px; }
.af-line-row .lr-input { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font-size: 12.5px; font-family: inherit; text-align: right; outline: none; }
.af-line-row .lr-x { width: 24px; height: 24px; border-radius: 6px; color: var(--ink-3); display: grid; place-items: center; }
.af-line-row .lr-x:hover { background: #fef2f2; color: #b91c1c; }

.af-doc-cta {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-top: 28px; padding-top: 18px;
  border-top: 1px solid var(--line);
}
.af-doc-cta-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
  background: #fff; color: var(--ink);
  border: 1px solid var(--line);
  cursor: pointer; transition: all .15s ease;
}
.af-doc-cta-btn:hover { background: var(--bg); border-color: #d6c8b3; }
.af-doc-cta-btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.af-doc-cta-btn.primary:hover { background: #000; }

/* Customer picker modal (lightweight) */
.af-picker-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.5);
  display: flex; align-items: center; justify-content: center; z-index: 200;
}
.af-picker {
  background: #fff; border-radius: 12px; width: 480px; max-width: 92vw;
  max-height: 80vh; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.25);
}
.af-picker-head { padding: 18px 20px 8px; }
.af-picker-head h3 { margin: 0 0 4px; font-size: 16px; font-weight: 600; }
.af-picker-head p { margin: 0; font-size: 12.5px; color: var(--ink-4); }
.af-picker-search {
  margin: 12px 20px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; outline: none; font-family: inherit;
}
.af-picker-search:focus { border-color: var(--admin2-primary); }
.af-picker-list { flex: 1; overflow-y: auto; padding: 4px 12px 12px; }
.af-picker-item {
  display: flex; flex-direction: column; padding: 9px 12px; border-radius: 8px;
  width: 100%; text-align: left; border: none; background: transparent;
  font-family: inherit; cursor: pointer;
}
.af-picker-item:hover { background: var(--bg); }
.af-picker-item .nm { font-size: 13.5px; font-weight: 500; color: var(--ink); }
.af-picker-item .mt { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }

/* Full-bleed when used as a page inside Roof Linker shell */
.content.content-flush { padding: 0 !important; max-width: none !important; height: calc(100vh - 65px); display: flex; flex-direction: column; overflow: hidden; }
.content.content-flush .af-root { height: 100%; flex: 1; }
