/* Alchemy Dynamics portal theme — shared by customer + admin SPAs */
:root {
  --bg: #05060a; --panel: #0a0c10; --panel2: #10131a; --line: #22252e;
  --text: #f4efe5; --muted: #a9acb8; --quiet: #737a8c;
  --gold: #d4a03c; --gold-hi: #f0d27c; --blue: #4f8ef7; --teal: #35d1b2; --violet: #9c6cff;
  --red: #e5636c; --ok: #4fc07a;
}
* { box-sizing: border-box; margin: 0; }
body {
  background: var(--bg); color: var(--text); min-height: 100vh;
  font: 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
h1, h2, h3, .serif { font-family: Georgia, "Times New Roman", serif; font-weight: normal; }
a { color: var(--gold-hi); text-decoration: none; }
a:hover { text-decoration: underline; }
button, .btn {
  font: inherit; cursor: pointer; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel2); color: var(--text); padding: 8px 16px; transition: all .15s;
}
button:hover { border-color: var(--gold); }
button.primary { background: linear-gradient(135deg, var(--gold), #b8862e); color: #14100a; border: none; font-weight: 600; }
button.primary:hover { background: linear-gradient(135deg, var(--gold-hi), var(--gold)); }
button.danger { color: var(--red); }
button.ghost { background: transparent; }
button:disabled { opacity: .45; cursor: default; }
input, textarea, select {
  font: inherit; width: 100%; background: #0d0f15; color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--gold); }
textarea { resize: vertical; min-height: 80px; }
label { display: block; font-size: 12.5px; color: var(--quiet); margin: 14px 0 5px; text-transform: uppercase; letter-spacing: .06em; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.chip {
  display: inline-block; font-size: 11.5px; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); letter-spacing: .04em; white-space: nowrap;
}
.chip.gold { color: var(--gold-hi); border-color: rgba(212,160,60,.5); background: rgba(212,160,60,.08); }
.chip.teal { color: var(--teal); border-color: rgba(53,209,178,.4); background: rgba(53,209,178,.07); }
.chip.blue { color: var(--blue); border-color: rgba(79,142,247,.4); background: rgba(79,142,247,.07); }
.chip.red  { color: var(--red);  border-color: rgba(229,99,108,.4); background: rgba(229,99,108,.07); }
.chip.violet { color: var(--violet); border-color: rgba(156,108,255,.4); background: rgba(156,108,255,.07); }

.muted { color: var(--muted); } .quiet { color: var(--quiet); font-size: 13px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--quiet); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid #171a21; vertical-align: top; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--panel2); border: 1px solid var(--gold); color: var(--text);
  padding: 12px 22px; border-radius: 10px; z-index: 99; box-shadow: 0 8px 30px rgba(0,0,0,.6);
  animation: rise .25s ease;
}
@keyframes rise { from { opacity: 0; transform: translate(-50%, 12px); } }

.modal-back { position: fixed; inset: 0; background: rgba(3,4,7,.8); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 26px; width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; }

/* wordmark */
.wordmark { font-family: Georgia, serif; letter-spacing: .02em; }
.wordmark .a { color: var(--gold-hi); }
.tagline { color: var(--quiet); font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; }

/* splash */
#splash {
  position: fixed; inset: 0; background: var(--bg); z-index: 1000;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  transition: opacity 1.1s ease;
}
#splash.fade { opacity: 0; pointer-events: none; }
#splash .sigil { width: 84px; height: 84px; animation: glow 2.6s ease-in-out infinite; }
@keyframes glow { 0%,100% { filter: drop-shadow(0 0 6px rgba(212,160,60,.25)); } 50% { filter: drop-shadow(0 0 22px rgba(240,210,124,.55)); } }
#splash h1 { font-size: 34px; }
#splash .bar { width: 180px; height: 2px; background: var(--line); overflow: hidden; border-radius: 2px; }
#splash .bar i { display: block; height: 100%; width: 40%; background: linear-gradient(90deg, transparent, var(--gold-hi), transparent); animation: slide 1.4s linear infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(450%); } }

/* milestones */
.mstone { display: flex; gap: 14px; padding: 10px 0; align-items: flex-start; }
.mstone .dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); margin-top: 3px; flex: none; }
.mstone.done .dot { background: var(--teal); border-color: var(--teal); }
.mstone.active .dot { border-color: var(--gold-hi); box-shadow: 0 0 10px rgba(240,210,124,.5); }
.mstone.blocked .dot { border-color: var(--red); }
.mstone .lbl { flex: 1; }
.mstone.done .lbl { color: var(--muted); }
.mstone.active .lbl { color: var(--gold-hi); }

/* messages */
.thread { display: flex; flex-direction: column; gap: 10px; max-height: 460px; overflow-y: auto; padding: 4px; }
.bubble { max-width: 78%; padding: 10px 14px; border-radius: 12px; font-size: 14.5px; white-space: pre-wrap; word-break: break-word; }
.bubble.mine { align-self: flex-end; background: rgba(212,160,60,.14); border: 1px solid rgba(212,160,60,.35); }
.bubble.theirs { align-self: flex-start; background: var(--panel2); border: 1px solid var(--line); }
.bubble.draft { align-self: flex-start; background: rgba(156,108,255,.1); border: 1px dashed var(--violet); }
.bubble .meta { font-size: 11px; color: var(--quiet); margin-top: 5px; }

/* dropzone */
.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 34px; text-align: center; color: var(--quiet); transition: all .2s; cursor: pointer; }
.drop.hot { border-color: var(--gold); color: var(--gold-hi); background: rgba(212,160,60,.05); }

/* markdown render */
.md h1, .md h2, .md h3 { margin: 18px 0 8px; color: var(--text); }
.md h1 { font-size: 24px; } .md h2 { font-size: 19px; color: var(--gold-hi); } .md h3 { font-size: 16px; }
.md p, .md li { color: var(--muted); margin: 6px 0; }
.md ul, .md ol { padding-left: 22px; }
.md code { background: var(--panel2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; font-size: 13px; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.md strong { color: var(--text); }
.md table { margin: 10px 0; }
