/* Elysian Minds portal — brand layer over Filament. Palette: cream, peach, orange, brown ink. No green UI. */
:root {
  --em-cream: #FEFBF1; --em-white: #FFFFFF; --em-peach: #FBE9D5; --em-orange: #E48C3C; --em-orange-deep: #C96F22;
  --em-ink: #3D1E08; --em-body: #221C11; --em-muted: #7A6A58; --em-border: #EFE3D0;
  --em-radius: 14px;
}
html:not(.dark) body.fi-body, html:not(.dark) .fi-layout { background: var(--em-cream); color: var(--em-body); }
.fi-header-heading, .fi-section-header-heading, .fi-modal-heading, .em-serif, .fi-simple-header-heading { font-family: 'Fraunces', Georgia, serif !important; color: var(--em-ink); letter-spacing: -0.01em; }
.dark .fi-header-heading, .dark .em-serif { color: #FBE9D5; }
html:not(.dark) .fi-sidebar { background: #fff; border-right: 1px solid var(--em-border); }
html:not(.dark) .fi-topbar > nav { background: #fff; border-bottom: 1px solid var(--em-border); }
.fi-sidebar-item-active a { background: var(--em-peach) !important; }
.fi-sidebar-group-label { letter-spacing: .12em; text-transform: uppercase; font-size: 11px; }

.em-logo { display: inline-flex; align-items: center; gap: .6rem; }
.em-logo-mark { width: 2.25rem; height: 2.25rem; border-radius: 10px; background: var(--em-peach); color: var(--em-orange); display: grid; place-items: center; font-size: 1.25rem; }
.em-logo-text { display: flex; flex-direction: column; line-height: 1.05; }
.em-logo-text b { font-family: 'Fraunces', Georgia, serif; font-size: 1.1rem; color: var(--em-ink); }
.dark .em-logo-text b { color: #FBE9D5; }
.em-logo-text small { font-size: .6rem; letter-spacing: .2em; color: var(--em-muted); }
.em-footer { text-align: center; padding: 1.25rem 1rem 2rem; font-size: .8rem; color: var(--em-muted); }
.em-login-cover { margin-bottom: .5rem; text-align: center; }
.em-eyebrow { font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: var(--em-orange-deep); font-weight: 700; }
.em-login-sub { color: var(--em-muted); font-size: .85rem; margin-top: .25rem; }

/* generic */
.em-card { background: #fff; border: 1px solid var(--em-border); border-radius: var(--em-radius); padding: 1rem 1.1rem; }
.dark .em-card { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.1); }
.em-muted { color: var(--em-muted); }
.em-grid { display: grid; gap: 1rem; }
.em-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.em-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.em-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1100px) { .em-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .em-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .em-grid-4, .em-grid-3, .em-grid-2 { grid-template-columns: minmax(0, 1fr); } }
.em-kpi { font-family: 'Fraunces', Georgia, serif; font-size: 2rem; color: var(--em-ink); line-height: 1; }
.dark .em-kpi { color: #FBE9D5; }
.em-label { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--em-muted); font-weight: 700; }
.em-pill { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 600; background: var(--em-peach); color: var(--em-ink); white-space: nowrap; }
.em-pill.warn { background: #FDE2D2; color: #9A3412; }
.em-pill.muted { background: #F3EEE6; color: var(--em-muted); }
.em-pill.dark { background: var(--em-ink); color: #fff; }
.em-list { list-style: none; margin: 0; padding: 0; }
.em-list li { padding: .55rem 0; border-bottom: 1px solid var(--em-border); display: flex; gap: .6rem; justify-content: space-between; align-items: flex-start; }
.em-list li:last-child { border-bottom: 0; }
.em-list a { color: var(--em-ink); font-weight: 600; }
.dark .em-list a { color: #FBE9D5; }
.em-empty { color: var(--em-muted); font-size: .85rem; padding: .5rem 0; font-style: italic; }
.em-bar { height: 8px; background: #F3EEE6; border-radius: 999px; overflow: hidden; }
.em-bar span { display: block; height: 100%; background: var(--em-orange); }

/* calendar */
.em-cal-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1rem; }
@media (max-width: 1100px) { .em-cal-wrap { grid-template-columns: minmax(0, 1fr); } }
.em-toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.em-toolbar .em-btn { border: 1px solid var(--em-border); background: #fff; border-radius: 10px; padding: .35rem .7rem; font-weight: 600; font-size: .85rem; color: var(--em-ink); }
.em-toolbar .em-btn.on { background: var(--em-ink); color: #fff; border-color: var(--em-ink); }
.em-toolbar h2 { font-family: 'Fraunces', Georgia, serif; font-size: 1.35rem; color: var(--em-ink); margin: 0 .5rem; }
.dark .em-toolbar h2 { color: #FBE9D5; }
.em-seg { display: inline-flex; border: 1px solid var(--em-border); border-radius: 10px; overflow: hidden; }
.em-seg button { padding: .35rem .75rem; font-size: .85rem; font-weight: 600; background: #fff; color: var(--em-ink); }
.em-seg button.on { background: var(--em-orange); color: #fff; }
.em-legend { display: flex; flex-wrap: wrap; gap: .4rem .9rem; font-size: .75rem; color: var(--em-muted); margin: .25rem 0 .75rem; }
.em-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .3rem; vertical-align: -1px; }
.em-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--em-border); border-radius: var(--em-radius); overflow: hidden; background: #fff; }
.dark .em-month { background: transparent; }
.em-dow { background: var(--em-peach); padding: .4rem; font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--em-ink); text-align: center; }
.em-day { min-height: 118px; border-top: 1px solid var(--em-border); border-left: 1px solid var(--em-border); padding: .35rem; font-size: .75rem; position: relative; }
.em-day:nth-child(7n+1) { border-left: 0; }
.em-day.out { background: #FBF8F1; color: #B7A994; }
.dark .em-day.out { background: rgba(255,255,255,.02); }
.em-day.today { box-shadow: inset 0 0 0 2px var(--em-orange); }
.em-daynum { display: flex; justify-content: space-between; font-weight: 700; color: var(--em-ink); margin-bottom: .2rem; }
.dark .em-daynum { color: #FBE9D5; }
.em-daynum small { font-weight: 500; color: var(--em-muted); }
.em-chip { display: block; border-radius: 6px; padding: .12rem .35rem; margin-bottom: .2rem; font-size: .7rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; text-decoration: none; }
.em-chip.campaign { background: var(--em-ink); }
.em-chip.opp { background: #fff; color: var(--em-ink); border: 1px dashed var(--em-orange); }
.em-chip.warn { outline: 2px solid #DC2626; outline-offset: -2px; }
.em-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .5rem; }
.em-week .em-day { min-height: 320px; border: 1px solid var(--em-border); border-radius: 12px; background: #fff; }
.dark .em-week .em-day { background: transparent; }
.em-week .em-chip { white-space: normal; }
.em-quarter { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.em-quarter .em-day { min-height: 54px; }
.em-quarter .em-chip { width: 9px; height: 9px; padding: 0; border-radius: 50%; display: inline-block; margin: 0 1px; }
.em-quarter .em-chip span { display: none; }
@media (max-width: 900px) {
  .em-quarter { grid-template-columns: minmax(0, 1fr); }
  .em-week { grid-template-columns: minmax(0, 1fr); }
  .em-week .em-day { min-height: 0; }
}
@media (max-width: 640px) {
  .em-day { min-height: 64px; padding: .2rem; }
  .em-month .em-chip { width: 8px; height: 8px; padding: 0; border-radius: 50%; display: inline-block; margin: 0 1px; }
  .em-month .em-chip span { display: none; }
  .em-dow { font-size: .6rem; letter-spacing: 0; padding: .3rem 0; }
}

/* feed preview */
.em-feed { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; max-width: 720px; }
.em-tile { aspect-ratio: 4/5; position: relative; overflow: hidden; border-radius: 4px; background: var(--em-peach); display: flex; align-items: flex-end; text-decoration: none; }
.em-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.em-tile .em-tile-txt { position: relative; padding: .5rem; font-family: 'Fraunces', Georgia, serif; font-size: .8rem; line-height: 1.2; color: var(--em-ink); }
.em-tile.solid { background: var(--em-orange); }
.em-tile.solid .em-tile-txt { color: #fff; }
.em-tile .em-tile-tag { position: absolute; top: .35rem; left: .35rem; }
@media (max-width: 640px) { .em-tile .em-tile-txt { font-size: .62rem; } }

/* markdown */
.em-prose { max-width: 860px; line-height: 1.65; color: var(--em-body); }
.dark .em-prose { color: #EDE3D4; }
.em-prose h1, .em-prose h2, .em-prose h3 { font-family: 'Fraunces', Georgia, serif; color: var(--em-ink); margin: 1.4em 0 .5em; }
.dark .em-prose h1, .dark .em-prose h2, .dark .em-prose h3 { color: #FBE9D5; }
.em-prose h1 { font-size: 1.8rem; } .em-prose h2 { font-size: 1.35rem; } .em-prose h3 { font-size: 1.1rem; }
.em-prose p, .em-prose ul, .em-prose ol { margin: .6em 0; }
.em-prose ul { list-style: disc; padding-left: 1.3rem; } .em-prose ol { list-style: decimal; padding-left: 1.3rem; }
.em-prose table { border-collapse: collapse; width: 100%; font-size: .85rem; display: block; overflow-x: auto; }
.em-prose th, .em-prose td { border: 1px solid var(--em-border); padding: .35rem .5rem; text-align: left; vertical-align: top; }
.em-prose th { background: var(--em-peach); color: var(--em-ink); }
.em-prose code { background: #F3EEE6; padding: 0 .25rem; border-radius: 4px; font-size: .85em; }
.em-prose pre { background: #F3EEE6; padding: .75rem; border-radius: 10px; overflow-x: auto; }
.em-prose a { color: var(--em-orange-deep); text-decoration: underline; }
.em-prose blockquote { border-left: 3px solid var(--em-orange); padding-left: .8rem; color: var(--em-muted); }

/* device previews (Content Controller) */
.em-devices { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: flex-start; }
.em-phone { width: 300px; max-width: 100%; border: 10px solid #221C11; border-radius: 34px; background: #fff; overflow: hidden; }
.em-tablet { width: 520px; max-width: 100%; border: 12px solid #221C11; border-radius: 26px; background: #fff; overflow: hidden; }
.em-phone .em-screen, .em-tablet .em-screen { max-height: 560px; overflow-y: auto; padding: 1rem; font-size: .82rem; color: var(--em-body); background: var(--em-cream); }
.em-screen p { margin: 0 0 .35rem; }
.em-screen img { width: 100%; border-radius: 10px; margin-bottom: .6rem; }

/* cover */
.em-cover { min-height: 100vh; background: var(--em-cream); color: var(--em-body); font-family: 'DM Sans', system-ui, sans-serif; }
.em-cover-hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 2rem; max-width: 1180px; margin: 0 auto; padding: 3rem 1.25rem 2rem; align-items: center; }
@media (max-width: 900px) { .em-cover-hero { grid-template-columns: minmax(0, 1fr); padding-top: 1.5rem; } }
.em-cover h1 { font-family: 'Fraunces', Georgia, serif; font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.05; color: var(--em-ink); margin: .4rem 0 1rem; }
.em-cover .em-lead { font-size: 1.05rem; color: var(--em-muted); max-width: 36rem; }
.em-cta { display: inline-block; padding: .75rem 1.2rem; border-radius: 12px; background: var(--em-orange); color: #fff; font-weight: 700; text-decoration: none; margin: 1.2rem .5rem 0 0; }
.em-cta.ghost { background: #fff; color: var(--em-ink); border: 1px solid var(--em-border); }
.em-cover-art { background: linear-gradient(135deg, #3D1E08 0%, #C96F22 65%, #E48C3C 100%); border-radius: 28px; padding: 1.5rem; color: #FEFBF1; min-height: 340px; display: flex; flex-direction: column; justify-content: space-between; }
.em-cover-art h3 { font-family: 'Fraunces', Georgia, serif; font-size: 1.5rem; margin: 0; }
.em-modules { max-width: 1180px; margin: 0 auto; padding: 0 1.25rem 2rem; }
.em-modules a.em-card { display: block; text-decoration: none; color: inherit; }
.em-modules a.em-card:hover { border-color: var(--em-orange); }
.em-topbar { display: flex; justify-content: space-between; align-items: center; max-width: 1180px; margin: 0 auto; padding: 1rem 1.25rem; }

/* live Instagram grid (desktop profile layout: 5 columns of 3:4 tiles; 3 columns on phones) */
.em-ig-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px 4px; max-width: 1180px; }
@media (max-width: 1000px) { .em-ig-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.em-ig-item { margin: 0; display: flex; flex-direction: column; min-width: 0; }
.em-ig-tile { position: relative; display: flex; align-items: flex-end; aspect-ratio: 3 / 4; overflow: hidden; background: var(--em-peach); border-radius: 2px; text-decoration: none; }
.em-ig-tile.solid { background: var(--em-orange); }
.em-ig-tile.solid .em-tile-txt { color: #fff; }
.em-ig-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.em-ig-flag { position: absolute; top: .3rem; left: .3rem; background: rgba(61,30,8,.82); color: #fff; font-size: .62rem; font-weight: 700; padding: .1rem .4rem; border-radius: 999px; }
.em-ig-rate { background: #fff; border: 1px solid var(--em-border); border-top: 0; padding: .35rem .45rem .45rem; font-size: .7rem; color: var(--em-body); flex: 1; }
.dark .em-ig-rate { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.1); color: #EDE3D4; }
.em-ig-row { display: flex; justify-content: space-between; align-items: center; gap: .3rem; }
.em-ig-metrics { display: grid; grid-template-columns: 1fr; gap: .1rem .4rem; margin-top: .25rem; }
.em-ig-metrics span { color: var(--em-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.em-ig-metrics b { color: var(--em-ink); }
.dark .em-ig-metrics b { color: #FBE9D5; }
.em-ig-caption { margin-top: .3rem; color: var(--em-muted); line-height: 1.3; }
.em-ig-note { margin-top: .25rem; color: #B7A994; font-style: italic; }
.em-ig-edit { display: inline-block; margin-top: .3rem; color: var(--em-orange-deep); font-weight: 700; }
@media (max-width: 640px) { .em-ig-metrics { grid-template-columns: 1fr; } .em-ig-rate { font-size: .62rem; } }
