/* Big Dipper HQ: dark theme with yellow highlights */
:root {
  --bg: #090b10; --bg2: #0d1017; --card: #12151e; --card2: #181c27; --card3: #1f2431;
  --line: #242a39; --line2: #313849;
  --text: #e9ebf1; --muted: #8b93a7; --dim: #5f6880;
  --gold: #f5c518; --gold2: #ffd84d; --gold-d: #c9a20f; --gold-soft: rgba(245,197,24,.12); --gold-glow: 0 0 0 3px rgba(245,197,24,.18);
  --hot: #ff5c66; --warm: #ffb020; --cold: #4c8dff; --ok: #22c55e;
  --soft: rgba(255,255,255,.035);
  --navy: #0d1017; --navy2: #181c27; --navy3: #f5c518;
  --radius: 14px; --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 10px 30px rgba(0,0,0,.35);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --display: "Space Grotesk", "Inter", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14.5px/1.5 var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; background: radial-gradient(900px 420px at 85% -10%, rgba(245,197,24,.07), transparent 60%), radial-gradient(700px 380px at -10% 110%, rgba(76,141,255,.05), transparent 60%); z-index: 0; }
a { color: var(--gold2); text-decoration: none; } a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font: 700 24px/1.2 var(--display); margin: 0; letter-spacing: -.01em; }
h2 { font: 600 16.5px/1.3 var(--display); margin: 0 0 12px; letter-spacing: -.005em; }
h3 { font-size: 14px; margin: 0 0 8px; color: var(--text); font-weight: 600; }
code { background: var(--card3); padding: 1px 6px; border-radius: 5px; font-size: 12.5px; color: var(--gold2); }
::selection { background: rgba(245,197,24,.35); }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 10px; border: 2px solid var(--bg); } ::-webkit-scrollbar-track { background: transparent; }

/* Layout */
.shell { display: flex; min-height: 100vh; position: relative; z-index: 1; }
.side { width: 236px; background: linear-gradient(180deg, #0c0f15, #090b10); border-right: 1px solid var(--line); color: var(--muted); display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 30; transition: transform .2s; }
.brand { display: flex; align-items: center; gap: 11px; padding: 18px 18px 16px; color: var(--text); font: 700 16.5px var(--display); letter-spacing: .01em; }
.brand svg { flex: none; filter: drop-shadow(0 0 10px rgba(245,197,24,.35)); }
.brand small { display: block; font: 400 12px var(--font); color: var(--dim); }
.nav { padding: 6px 10px; flex: 1; overflow-y: auto; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8.5px 12px; border-radius: 10px; color: var(--muted); margin-bottom: 2px; font-weight: 500; text-decoration: none; transition: background .15s, color .15s; }
.nav a:hover { background: var(--card2); color: var(--text); }
.nav a.active { background: linear-gradient(90deg, rgba(245,197,24,.16), rgba(245,197,24,.03)); color: var(--gold2); box-shadow: inset 2px 0 0 var(--gold); }
.nav a span:first-child { width: 20px; text-align: center; filter: saturate(.9); }
.nav .soon { font-size: 10.5px; color: var(--dim); margin-left: auto; border: 1px solid var(--line); border-radius: 6px; padding: 0 5px; }
.nav .sec { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--dim); padding: 16px 12px 6px; }
.side-foot { padding: 14px 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text); }
.side-foot button { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; font-size: 12.5px; }
.side-foot button:hover { color: var(--gold2); }
.main { flex: 1; margin-left: 236px; min-width: 0; }
.topbar { display: none; }
.page { padding: 26px 30px 100px; max-width: 1440px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Components */
.card { background: linear-gradient(180deg, var(--card), #10131b); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat .label { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.stat .value { font: 700 30px/1.15 var(--display); margin-top: 6px; color: var(--text); letter-spacing: -.01em; }
.stat .sub { color: var(--dim); font-size: 12px; margin-top: 2px; }
.grid.g4 > .card.stat:first-child .value { color: var(--gold); }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line2); background: var(--card2); color: var(--text); padding: 8px 14px; border-radius: 10px; cursor: pointer; font-weight: 500; white-space: nowrap; text-decoration: none !important; transition: border-color .15s, background .15s, transform .1s, box-shadow .15s; }
.btn:hover { border-color: #46506a; background: var(--card3); }
.btn:active { transform: translateY(1px); }
.btn.primary, .btn.gold { background: linear-gradient(180deg, var(--gold2), var(--gold)); color: #14110a; border-color: var(--gold); font-weight: 600; box-shadow: 0 6px 20px rgba(245,197,24,.18); }
.btn.primary:hover, .btn.gold:hover { background: linear-gradient(180deg, #ffe066, var(--gold2)); box-shadow: 0 8px 26px rgba(245,197,24,.28); }
.btn.danger { color: var(--hot); } .btn.danger:hover { border-color: rgba(255,92,102,.5); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=search], input[type=tel], input[type=url], select, textarea {
  width: 100%; border: 1px solid var(--line2); background: #0c0f16; color: var(--text); border-radius: 10px; padding: 9px 11px; outline: none; transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: var(--dim); }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: var(--gold-glow); }
input[type=checkbox], input[type=radio] { accent-color: var(--gold); }
input[type=range] { accent-color: var(--gold); }
select option { background: var(--card); }
textarea { resize: vertical; min-height: 80px; }
label.f { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
label.f > span { display: block; margin-bottom: 5px; font-weight: 500; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > .grow, .grow { flex: 1; min-width: 160px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; }
.opt { display: flex; gap: 8px; align-items: center; }
.tag { display: inline-flex; align-items: center; gap: 4px; background: var(--card3); color: #cfd5e4; border: 1px solid var(--line2); border-radius: 99px; padding: 1px 9px; font-size: 12px; margin: 2px 3px 2px 0; }
.tag button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0; font-size: 14px; line-height: 1; }
.score { display: inline-block; border-radius: 99px; padding: 2px 9px; font-size: 11.5px; font-weight: 600; color: #fff; text-transform: capitalize; }
.score.hot { background: rgba(255,92,102,.18); color: #ff8a92; } .score.warm { background: rgba(255,176,32,.18); color: #ffc65c; } .score.cold { background: rgba(76,141,255,.18); color: #8ab4ff; } .score.none { background: var(--card3); color: var(--muted); }
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty .big { font-size: 36px; margin-bottom: 10px; }
.empty h2 { color: var(--text); }

/* Table */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); font-weight: 600; padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; } table.t tr.click:hover td { background: rgba(245,197,24,.04); }
.bulkbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--gold-soft); border: 1px solid rgba(245,197,24,.35); color: var(--text); padding: 10px 14px; border-radius: 12px; margin-bottom: 12px; }
.bulkbar select, .bulkbar input { width: auto; padding: 6px 9px; }

/* Bars */
.bar-row { display: grid; grid-template-columns: 130px 1fr 60px; gap: 10px; align-items: center; margin: 8px 0; font-size: 13px; }
.bar-row .bar { height: 8px; border-radius: 6px; background: var(--card3); overflow: hidden; }
.bar-row .bar i { display: block; height: 100%; background: linear-gradient(90deg, #8a6f0a, var(--gold)); border-radius: 6px; }
.bar-row .bar i.gold { background: linear-gradient(90deg, #3a5bb8, var(--cold)); }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 96px; padding-top: 6px; }
.spark i { flex: 1; background: linear-gradient(180deg, var(--gold), rgba(245,197,24,.35)); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; }
.spark i:hover { opacity: 1; }

/* Contact profile */
.profile { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
.avatar { width: 54px; height: 54px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #2a2f3f, #151923); border: 1px solid rgba(245,197,24,.4); color: var(--gold); display: grid; place-items: center; font: 700 19px var(--display); flex: none; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.timeline .dot { width: 30px; height: 30px; border-radius: 50%; background: var(--card3); display: grid; place-items: center; flex: none; font-size: 14px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 500; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--gold2); border-color: var(--gold); }
.task { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.task.done .ttl { text-decoration: line-through; color: var(--muted); }
.overdue { color: var(--hot); }

/* Kanban */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.col { background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; width: 280px; flex: none; display: flex; flex-direction: column; max-height: calc(100vh - 210px); }
.col-head { padding: 12px 12px 8px; border-bottom: 1px solid var(--line); }
.col-head b { display: block; font-family: var(--display); } .col-head .small { color: var(--muted); }
.col-body { padding: 8px; overflow-y: auto; min-height: 80px; flex: 1; }
.col-body.over { background: var(--gold-soft); border-radius: 0 0 14px 14px; }
.deal { background: var(--card); border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; margin-bottom: 8px; cursor: grab; transition: border-color .15s, transform .1s; }
.deal:hover { border-color: rgba(245,197,24,.45); }
.deal.dragging { opacity: .5; }
.deal .val { font-weight: 700; color: var(--gold); }
.deal .who { font-size: 12.5px; color: var(--muted); }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(3,4,8,.72); backdrop-filter: blur(4px); z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto; animation: fade .15s; }
.modal { background: linear-gradient(180deg, #151925, #10131b); border: 1px solid var(--line2); border-radius: 16px; width: 100%; max-width: 560px; padding: 22px; box-shadow: 0 30px 80px rgba(0,0,0,.6); animation: pop .18s ease; }
.modal.wide { max-width: 920px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-head button { border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--muted); }
.modal-head button:hover { color: var(--text); }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
@keyframes fade { from { opacity: 0; } } @keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } }

#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #1b2030; border: 1px solid rgba(245,197,24,.45); color: var(--text); padding: 11px 18px; border-radius: 12px; z-index: 90; display: none; box-shadow: 0 16px 40px rgba(0,0,0,.5); max-width: 90vw; }
#toast.err { border-color: rgba(255,92,102,.6); color: #ffb3b8; }

/* Auth */
.auth { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(900px 500px at 50% -10%, rgba(245,197,24,.18), transparent 60%), var(--bg); padding: 20px; position: relative; z-index: 1; }
.auth .card { width: 100%; max-width: 410px; padding: 30px; }
.auth .logo { display: flex; align-items: center; gap: 11px; font: 700 21px var(--display); margin-bottom: 6px; }
.auth .btn { width: 100%; justify-content: center; padding: 11px; margin-top: 6px; }
.err-msg { color: var(--hot); font-size: 13.5px; min-height: 20px; margin: 6px 0; }

/* AI assistant panel */
.ai-fab { position: fixed; right: 22px; bottom: 22px; z-index: 40; background: linear-gradient(180deg, var(--gold2), var(--gold)); color: #14110a; border: 0; border-radius: 99px; padding: 12px 19px; font-weight: 700; cursor: pointer; box-shadow: 0 10px 30px rgba(245,197,24,.35); display: flex; gap: 8px; align-items: center; transition: transform .15s; }
.ai-fab:hover { transform: translateY(-2px); }
.ai-panel { position: fixed; right: 0; top: 0; bottom: 0; width: 410px; max-width: 100vw; background: #0f121a; border-left: 1px solid var(--line2); z-index: 50; box-shadow: -20px 0 60px rgba(0,0,0,.5); display: flex; flex-direction: column; transform: translateX(105%); transition: transform .22s; }
.ai-panel.open { transform: none; }
.ai-head { background: linear-gradient(90deg, rgba(245,197,24,.14), transparent); border-bottom: 1px solid var(--line); color: var(--text); padding: 15px 16px; display: flex; align-items: center; justify-content: space-between; }
.ai-head b { color: var(--gold2); font-family: var(--display); }
.ai-head button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 13px; }
.ai-head button:hover { color: var(--text); }
.ai-msgs { flex: 1; overflow-y: auto; padding: 16px; }
.msg { margin-bottom: 12px; display: flex; }
.msg .b { padding: 10px 13px; border-radius: 14px; max-width: 88%; white-space: pre-wrap; word-wrap: break-word; line-height: 1.5; }
.msg.user { justify-content: flex-end; } .msg.user .b { background: linear-gradient(180deg, var(--gold2), var(--gold)); color: #14110a; border-bottom-right-radius: 4px; font-weight: 500; }
.msg.assistant .b { background: var(--card2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg .b.typing { color: var(--muted); font-style: italic; }
.ai-sugg { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ai-sugg button { border: 1px solid var(--line2); background: var(--card2); color: var(--text); border-radius: 99px; padding: 6px 11px; font-size: 12.5px; cursor: pointer; text-align: left; transition: border-color .15s; }
.ai-sugg button:hover { border-color: var(--gold); color: var(--gold2); }
.ai-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.ai-input textarea { min-height: 44px; max-height: 140px; resize: none; }

/* ===== Builder ===== */
.badge { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--card3); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; border: 1px solid var(--line2); }
.badge.live { background: rgba(34,197,94,.12); color: #5ee08f; border-color: rgba(34,197,94,.3); } .badge.draft { background: rgba(255,176,32,.12); color: #ffc65c; border-color: rgba(255,176,32,.3); } .badge.funnel { background: rgba(167,139,250,.12); color: #c4b5fd; border-color: rgba(167,139,250,.3); }
.site-card { display: flex; flex-direction: column; gap: 9px; cursor: pointer; transition: border-color .15s, transform .15s; padding: 14px; }
.site-card:hover { border-color: rgba(245,197,24,.5); transform: translateY(-2px); }
.site-thumb { height: 170px; border-radius: 10px; overflow: hidden; position: relative; background: #000; border: 1px solid var(--line); }
.thumb-frame { position: absolute; top: 0; left: 0; width: 1280px; height: 900px; border: 0; transform-origin: 0 0; pointer-events: none; background: #fff; }
.ai-hero { display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 22px 24px; margin-bottom: 18px; background: radial-gradient(600px 200px at 0% 0%, rgba(245,197,24,.18), transparent 70%), linear-gradient(180deg, var(--card), #10131b); border-color: rgba(245,197,24,.28); }
.ai-hero h2 { font-size: 20px; margin: 0 0 4px; }
.tpl-cats { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tpl-cats button { border: 1px solid var(--line2); background: var(--card2); color: var(--muted); border-radius: 99px; padding: 6px 12px; cursor: pointer; font-size: 12.5px; }
.tpl-cats button.on { background: var(--gold-soft); border-color: var(--gold); color: var(--gold2); }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.tpl-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; max-height: 58vh; overflow-y: auto; padding: 2px; }
.tpl { border: 1px solid var(--line2); border-radius: 12px; padding: 12px; cursor: pointer; background: var(--card2); transition: border-color .15s, box-shadow .15s; }
.tpl:hover { border-color: #46506a; }
.tpl.on { border-color: var(--gold); box-shadow: var(--gold-glow); }
.tpl b { display: block; margin-bottom: 4px; }
.tpl .site-thumb { height: 150px; margin-bottom: 10px; }
.style-dots { display: flex; gap: 4px; margin-top: 6px; } .style-dots i { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(255,255,255,.2); display: inline-block; }
.code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; background: #06080c; border: 1px solid var(--line); color: #d7dbe6; padding: 12px; border-radius: 10px; white-space: pre-wrap; word-break: break-all; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.media-item { border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: var(--card2); cursor: pointer; position: relative; transition: border-color .15s; }
.media-item img, .media-item video { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; background: #0b0d12; }
.media-item .cap { padding: 6px 8px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.media-item:hover { border-color: var(--gold); }
.dropzone { border: 1.5px dashed var(--line2); border-radius: 14px; padding: 22px; text-align: center; color: var(--muted); margin-bottom: 14px; background: var(--soft); }
.dropzone.over { border-color: var(--gold); background: var(--gold-soft); }
.split { display: grid; grid-template-columns: 360px 1fr; gap: 16px; align-items: start; }
.field-card { border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; margin-bottom: 6px; display: flex; gap: 8px; align-items: center; cursor: pointer; background: var(--card2); }
.field-card:hover { border-color: var(--line2); }
.field-card.on { border-color: var(--gold); box-shadow: var(--gold-glow); }
.field-card.step { background: transparent; border-style: dashed; }
.rte-bar { display: flex; gap: 4px; flex-wrap: wrap; padding: 6px; border: 1px solid var(--line2); border-bottom: 0; border-radius: 10px 10px 0 0; background: var(--card2); }
.rte-bar button { border: 1px solid var(--line2); background: var(--card); color: var(--text); border-radius: 7px; padding: 4px 9px; cursor: pointer; font-size: 12.5px; }
.rte-bar button:hover { border-color: var(--gold); }
.rte { border: 1px solid var(--line2); border-radius: 0 0 10px 10px; min-height: 380px; padding: 16px 18px; background: #0c0f16; outline: none; line-height: 1.7; }
.rte:focus { border-color: var(--gold); }
.rte img { max-width: 100%; border-radius: 8px; }
.rte h2, .rte h3 { font-family: var(--display); }
.rte blockquote { border-left: 3px solid var(--gold); margin: 0; padding-left: 14px; color: var(--muted); }
.ai-progress { list-style: none; padding: 0; margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }
.ai-progress li { padding: 2px 0; } .ai-progress li::before { content: "✓ "; color: var(--ok); } .ai-progress li:last-child::before { content: "◌ "; color: var(--gold); animation: spin 1s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.swatches button { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line2); cursor: pointer; padding: 0; position: relative; }
.swatches button:hover { box-shadow: var(--gold-glow); border-color: var(--gold); }
.swatches button.on { outline: 2px solid var(--gold); outline-offset: 2px; }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } }

/* ===== Editor (full screen) ===== */
.ed { position: fixed; inset: 0; z-index: 35; background: #06080c; display: flex; flex-direction: column; }
.ed-top { height: 56px; background: #0c0f15; border-bottom: 1px solid var(--line); color: var(--text); display: flex; align-items: center; gap: 8px; padding: 0 12px; flex: none; overflow-x: auto; }
.ed-top .btn { padding: 6px 12px; font-size: 13px; }
.ed-top .ttl { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; font-family: var(--display); }
.ed-top .ttl small { color: var(--muted); font-family: var(--font); font-weight: 400; }
.ed-top .grp { display: flex; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.ed-top .grp button { background: none; border: 0; color: var(--muted); padding: 5px 10px; border-radius: 7px; cursor: pointer; font-size: 13px; white-space: nowrap; }
.ed-top .grp button:hover { color: var(--text); }
.ed-top .grp button.on { background: var(--card3); color: var(--gold2); }
.ed-top .sp { flex: 1; }
.ed-dirty { font-size: 12px; color: var(--gold); white-space: nowrap; }
.ed-main { flex: 1; display: flex; min-height: 0; }
.ed-left { width: 320px; background: #0c0f15; border-right: 1px solid var(--line); overflow: hidden; flex: none; display: flex; flex-direction: column; }
#ed-lp { flex: 1; overflow-y: auto; display: flex; flex-direction: column; min-height: 0; }
.ed-right { width: 310px; background: #0c0f15; border-left: 1px solid var(--line); overflow-y: auto; flex: none; padding: 16px; }
.ed-tabs { display: flex; border-bottom: 1px solid var(--line); background: #0c0f15; flex: none; }
.ed-tabs button { flex: 1; border: 0; background: none; padding: 12px 4px; cursor: pointer; color: var(--muted); font-size: 13px; border-bottom: 2px solid transparent; font-weight: 500; }
.ed-tabs button:hover { color: var(--text); }
.ed-tabs button.on { color: var(--gold2); border-color: var(--gold); }
.ed-tabs button.ai-tab { color: var(--gold); font-weight: 700; }
.pal-group { padding: 12px 12px 0; font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--dim); }
.palette { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 7px; padding: 8px 12px 4px; }
.pal { border: 1px solid var(--line); border-radius: 10px; padding: 10px 4px 8px; text-align: center; font-size: 11.5px; cursor: grab; background: var(--card); color: var(--muted); user-select: none; transition: border-color .15s, color .15s, background .15s; }
.pal:hover { border-color: var(--gold); color: var(--text); background: var(--card2); }
.pal .i { font-size: 19px; display: block; margin-bottom: 4px; }
.sec-lib { padding: 4px 12px 12px; display: grid; gap: 6px; }
.sec-lib button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.sec-lib button:hover { border-color: var(--gold); }
.ed-canvas-wrap { flex: 1; overflow: auto; display: flex; justify-content: center; padding: 18px; background: radial-gradient(circle at 1px 1px, rgba(255,255,255,.05) 1px, transparent 0) 0 0/22px 22px, #06080c; }
.ed-canvas-wrap iframe { background: #fff; border: 0; box-shadow: 0 0 0 1px var(--line), 0 20px 60px rgba(0,0,0,.6); height: 100%; min-height: 400px; transition: width .25s; border-radius: 10px; }
.ed-right h3 { margin-top: 16px; font-family: var(--display); } .ed-right h3:first-child { margin-top: 0; }
.ed-right label.f { margin-bottom: 10px; }
.ed-right .row { gap: 6px; }
.ed-list-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 8px; background: var(--soft); }
.color-row { display: flex; gap: 6px; align-items: center; } .color-row input[type=color] { width: 38px; height: 36px; padding: 2px; border: 1px solid var(--line2); border-radius: 8px; background: #0c0f16; flex: none; cursor: pointer; }
.ed-tip { border: 1px solid rgba(245,197,24,.3); background: var(--gold-soft); border-radius: 12px; padding: 12px; font-size: 13px; margin-bottom: 14px; }
/* Editor AI chat */
.ed-ai { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.ed-ai-msgs { flex: 1; overflow-y: auto; padding: 14px; }
.ed-ai-msgs .msg .b { font-size: 13.5px; }
.ed-ai-hello { text-align: center; padding: 10px 6px 4px; }
.ed-ai-hello .orb { width: 52px; height: 52px; margin: 6px auto 10px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3b0, var(--gold) 45%, #8a6f0a); box-shadow: 0 0 40px rgba(245,197,24,.45); }
.ed-ai-hello h3 { font-size: 16px; margin-bottom: 4px; }
.ed-ai-chips { display: grid; gap: 6px; margin-top: 12px; text-align: left; }
.ed-ai-chips button { border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 10px; padding: 9px 11px; font-size: 12.5px; cursor: pointer; text-align: left; transition: border-color .15s; }
.ed-ai-chips button:hover { border-color: var(--gold); }
.ed-ai-input { padding: 10px 12px 12px; border-top: 1px solid var(--line); flex: none; }
.ed-ai-input .ctx { font-size: 11.5px; color: var(--gold2); margin-bottom: 6px; display: flex; justify-content: space-between; gap: 6px; }
.ed-ai-input .ctx button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 11.5px; }
.ed-ai-input form { display: flex; gap: 6px; align-items: flex-end; }
.ed-ai-input textarea { min-height: 46px; max-height: 160px; resize: none; font-size: 13.5px; }
@media (max-width: 1100px) { .ed-left { width: 270px; } .ed-right { width: 270px; } }
@media (max-width: 760px) {
  .ed-main { flex-direction: column; } .ed-left { width: auto; height: 38vh; border-right: 0; border-bottom: 1px solid var(--line); } .ed-right { width: auto; max-height: 30vh; border-left: 0; border-top: 1px solid var(--line); order: 3; }
  .ed-canvas-wrap { padding: 6px; } .ed-top .ttl { display: none; }
}

/* Mobile */
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .profile { grid-template-columns: 1fr; } .g3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 780px) {
  .side { transform: translateX(-100%); } .side.open { transform: none; box-shadow: 0 0 60px rgba(0,0,0,.7); }
  .main { margin-left: 0; }
  .topbar { display: flex; align-items: center; gap: 12px; background: rgba(12,15,21,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); color: var(--text); padding: 12px 16px; position: sticky; top: 0; z-index: 20; font: 700 15px var(--display); }
  .topbar button { background: none; border: 0; color: var(--text); font-size: 22px; cursor: pointer; padding: 0 4px; }
  .page { padding: 16px 16px 100px; }
  .g2, .g4, .g3 { grid-template-columns: 1fr 1fr; }
  .hide-m { display: none !important; }
  .bar-row { grid-template-columns: 95px 1fr 44px; }
  .col { width: 82vw; }
  .ai-fab span { display: none; }
  .ai-hero { padding: 18px; }
}
@media (max-width: 460px) { .g2, .g4, .g3 { grid-template-columns: 1fr; } }

/* ---------- Phase 3-7 ---------- */
.grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.wday { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; min-height: 260px; padding: 6px; }
.wday.today { border-color: rgba(245,197,24,.55); box-shadow: inset 0 0 0 1px rgba(245,197,24,.25); }
.wh { font-size: 12px; color: var(--muted); padding: 4px 4px 8px; border-bottom: 1px solid var(--line); margin-bottom: 6px; } .wh b { color: var(--text); font-size: 15px; }
.wap { background: var(--card2); border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 8px; padding: 6px 8px; margin-bottom: 6px; font-size: 12.5px; cursor: pointer; }
.wap:hover { border-color: rgba(245,197,24,.45); } .wap.cancelled { opacity: .45; text-decoration: line-through; } .wap.noshow { opacity: .6; }
.inbox { display: grid; grid-template-columns: 330px 1fr; gap: 14px; height: calc(100vh - 150px); min-height: 480px; }
.ib-list { overflow-y: auto; padding: 12px; } .ib-thread { display: flex; flex-direction: column; padding: 14px; min-height: 0; }
.ib-item { display: block; position: relative; padding: 10px; border-radius: 10px; color: var(--text) !important; text-decoration: none !important; border: 1px solid transparent; margin-bottom: 2px; }
.ib-item:hover { background: var(--soft); } .ib-item.on { background: var(--gold-soft); border-color: rgba(245,197,24,.35); }
.ib-item.unread b { color: var(--gold2); } .ib-prev { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 22px; }
.ib-dot { position: absolute; right: 10px; bottom: 10px; background: var(--gold); color: #111; border-radius: 99px; font-size: 11px; font-weight: 700; padding: 0 6px; }
.ib-msgs { flex: 1; overflow-y: auto; padding: 6px 2px; min-height: 0; }
.bub { display: flex; flex-direction: column; margin: 8px 0; max-width: 78%; } .bub .bb { padding: 9px 12px; border-radius: 14px; white-space: pre-wrap; word-wrap: break-word; }
.bub.in { align-items: flex-start; } .bub.in .bb { background: var(--card3); border: 1px solid var(--line2); border-bottom-left-radius: 4px; }
.bub.out { margin-left: auto; align-items: flex-end; } .bub.out .bb { background: linear-gradient(180deg, var(--gold2), var(--gold)); color: #14110a; border-bottom-right-radius: 4px; }
.bub.note .bb { background: rgba(120,140,255,.12) !important; color: var(--text) !important; border: 1px dashed rgba(120,140,255,.45); }
.bub .small { margin-top: 3px; font-size: 11px; }
.ib-compose { border-top: 1px solid var(--line); padding-top: 10px; } .ib-compose textarea { min-height: 52px; }
.flow { max-width: 720px; } .fstep { position: relative; } .fstep.trig { border-color: rgba(245,197,24,.45); } .fstep.add { padding: 12px; border-style: dashed; }
.fline { width: 2px; height: 22px; background: var(--line2); margin: 0 auto; }
.recipe { display: flex; flex-direction: column; } .recipe p { flex: 1; } .recipe .btn { align-self: flex-start; }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.mh { font-size: 11px; color: var(--dim); text-transform: uppercase; text-align: center; padding: 4px; }
.md { background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; min-height: 86px; padding: 4px; } .md.empty { background: transparent; border: 0; } .md.today { border-color: rgba(245,197,24,.55); }
.mp { font-size: 11px; background: var(--card3); border-left: 3px solid var(--gold); border-radius: 5px; padding: 2px 5px; margin-top: 3px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp.published { border-left-color: #22c55e; opacity: .75; } .mp.draft { border-left-color: var(--dim); } .mp.due { border-left-color: #ff8a92; }
.cp-res { max-height: 220px; overflow-y: auto; }
@media (max-width: 1000px) { .grid.g3 { grid-template-columns: 1fr 1fr; } .week { grid-template-columns: 1fr; } .wday { min-height: 0; } .inbox { grid-template-columns: 1fr; height: auto; } .ib-list { max-height: 300px; } .ib-thread { min-height: 70vh; } }
@media (max-width: 640px) { .grid.g3 { grid-template-columns: 1fr; } .md { min-height: 56px; } .mp { font-size: 0; height: 6px; padding: 0; } }
@media (max-width: 1100px) { .profile[style] { grid-template-columns: 1fr !important; } }
