/* AnisminOS Demo — Standalone */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a1929; color: #e3f2fd; overflow: hidden;
    width: 100%; height: 100vh; display: flex; flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* Top Bar */
.d-topbar {
    height: 28px; display: flex; align-items: center; justify-content: space-between;
    padding: 0 12px; font-size: 11px; flex-shrink: 0;
    background: rgba(5, 12, 24, 0.65);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.d-topbar-left { display: flex; align-items: center; position: relative; }
.d-brand { font-weight: 600; display: flex; align-items: center; gap: 4px; cursor: pointer; padding: 2px 6px; border-radius: 4px; transition: background 0.2s; }
.d-brand:hover { background: rgba(255,255,255,0.1); }
.d-brand span { color: #e3f2fd; }
.d-topbar-center { opacity: 0.9; }
.d-topbar-right { display: flex; gap: 8px; }
.d-topbar-icon { cursor: default; }

/* Brand dropdown */
.d-dropdown {
    position: absolute; top: 30px; left: 0; z-index: 10000;
    background: rgba(15,20,30,0.95); border-radius: 8px; min-width: 180px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}
.d-dropdown.active { opacity: 1; visibility: visible; transform: translateY(0); }
.d-dropdown-item { padding: 8px 14px; font-size: 11px; cursor: pointer; transition: background 0.15s; }
.d-dropdown-item:hover { background: rgba(255,255,255,0.1); }
.d-dropdown-divider { height: 1px; background: rgba(255,255,255,0.1); margin: 3px 0; }

/* Desktop grid */
.d-desktop {
    flex: 1; position: relative; min-height: 0; overflow: hidden;
    display: grid; grid-template-columns: 1.3fr 1fr; grid-template-rows: 1.2fr 1fr;
    gap: 8px; padding: 8px;
    background:
        radial-gradient(ellipse at 30% 40%, rgba(26,110,99,0.15), transparent 60%),
        radial-gradient(ellipse at 70% 60%, rgba(42,138,122,0.08), transparent 50%),
        linear-gradient(180deg, #071320 0%, #0a1929 50%, #1a6e63 100%);
}

/* Windows */
.d-window {
    display: flex; flex-direction: column; overflow: hidden; min-height: 0;
    background: rgba(19, 47, 76, 0.97); border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    opacity: 0; transform: scale(0.8);
    animation: dWinOpen 0.4s cubic-bezier(0.22,1,0.36,1) forwards;
}
#win-dispatch { animation-delay: 0.2s; }
#win-boardroom { animation-delay: 0.5s; }
#win-memory { animation-delay: 0.8s; }
@keyframes dWinOpen { to { opacity: 1; transform: scale(1); } }

.d-titlebar {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 10px; flex-shrink: 0;
    background: rgba(10, 25, 41, 0.95);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    cursor: default; user-select: none;
}
.d-win-controls { display: flex; gap: 5px; margin-left: auto; order: 99; }
.d-btn-close, .d-btn-min, .d-btn-max { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.d-btn-close { background: #ff5f57; cursor: pointer; }
.d-btn-min { background: #ffbd2e; cursor: pointer; }
.d-btn-max { background: #28c840; }
.d-win-name { font-size: 11px; font-weight: 500; display: flex; align-items: center; gap: 5px; }
.d-win-content { flex: 1; overflow: hidden; min-height: 0; }

/* ═══ DISPATCH ═══ */
.d-dispatch-content { display: flex; flex-direction: column; height: 100%; }
.d-disp-topbar { padding: 6px 8px; border-bottom: 1px solid rgba(255,255,255,0.06); display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }
.d-disp-stats { display: flex; gap: 10px; font-size: 8px; color: #90caf9; }
.d-disp-stat b { color: #e3f2fd; }
.d-disp-filters { display: flex; gap: 4px; align-items: center; }
.d-filter { font-size: 8px; padding: 2px 6px; border-radius: 4px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); color: #90caf9; cursor: default; }
.d-btn-add { font-size: 8px; padding: 2px 8px; border-radius: 4px; margin-left: auto; background: #29b6f6; color: #fff; font-weight: 600; cursor: default; }
.d-kanban { display: flex; gap: 6px; padding: 6px; flex: 1; overflow: hidden; min-height: 0; }
.d-col { flex: 1; display: flex; flex-direction: column; background: rgba(0,0,0,0.18); border: 1px solid rgba(255,255,255,0.06); border-radius: 10px; overflow: hidden; min-width: 0; min-height: 0; }
.d-col-head { display: flex; align-items: center; gap: 5px; padding: 7px 8px 5px; font-size: 8px; border-bottom: 1px solid rgba(255,255,255,0.06); flex-shrink: 0; }
.d-col-name { font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; color: #90caf9; }
.d-col-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.d-col-count { margin-left: auto; font-size: 8px; font-weight: 700; padding: 1px 5px; border-radius: 10px; background: rgba(255,255,255,0.08); color: #90caf9; }
.d-cards { padding: 5px; display: flex; flex-direction: column; gap: 5px; overflow-y: auto; scrollbar-width: none; flex: 1; min-height: 0; }
.d-cards::-webkit-scrollbar { display: none; }
.d-card { position: relative; overflow: hidden; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); border-radius: 8px; transition: all 0.18s; flex-shrink: 0; }
.d-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; border-radius: 8px 0 0 8px; }
.d-card[data-priority="critical"]::before { background: #ef5350; }
.d-card[data-priority="high"]::before { background: #ff7043; }
.d-card[data-priority="medium"]::before { background: #ffca28; }
.d-card[data-priority="low"]::before { background: #66bb6a; }
.d-card:hover { background: rgba(255,255,255,0.09); border-color: rgba(255,255,255,0.18); transform: translateY(-1px); }
.d-card-done { opacity: 0.55; }
.d-card-body { padding: 6px 8px 6px 10px; }
.d-card-top { display: flex; align-items: flex-start; gap: 4px; }
.d-card-title { font-size: 9px; font-weight: 600; color: #dce9f5; line-height: 1.3; flex: 1; }
.d-card-title.d-dim { color: rgba(255,255,255,0.35); }
.d-overdue-dot { width: 6px; height: 6px; border-radius: 50%; background: #ef5350; box-shadow: 0 0 6px #ef5350; animation: dBlink 1.4s ease infinite; margin-top: 2px; flex-shrink: 0; }
@keyframes dBlink { 50% { opacity: 0.3; } }
.d-card-badges { display: flex; gap: 3px; margin-top: 4px; flex-wrap: wrap; }
.d-exec-badge { font-size: 8px; padding: 1px 5px; border-radius: 6px; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.1); color: #90caf9; font-weight: 600; }
.d-pri-badge { font-size: 7px; padding: 1px 4px; border-radius: 4px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; }
.d-pri-critical { background: rgba(239,83,80,0.2); color: #ef9a9a; border: 1px solid rgba(239,83,80,0.35); }
.d-pri-high { background: rgba(255,112,67,0.2); color: #ffab91; border: 1px solid rgba(255,112,67,0.35); }
.d-pri-medium { background: rgba(255,202,40,0.15); color: #ffe082; border: 1px solid rgba(255,202,40,0.3); }
.d-pri-low { background: rgba(102,187,106,0.15); color: #a5d6a7; border: 1px solid rgba(102,187,106,0.3); }
.d-card-foot { margin-top: 4px; padding-top: 4px; border-top: 1px solid rgba(255,255,255,0.04); }
.d-checkin { font-size: 7px; color: rgba(255,255,255,0.35); }
.d-checkin.d-fresh { color: #81c784; }
.d-checkin.d-done { color: #78909c; }
.d-card-new { opacity: 0; animation: dCardIn 0.3s ease 2s forwards; }
@keyframes dCardIn { from { opacity: 0; transform: translateY(8px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* ═══ BOARDROOM ═══ */
.d-boardroom-layout { display: flex; height: 100%; min-height: 0; overflow: hidden; }
.d-br-sidebar { width: 35%; min-width: 0; background: rgba(0,0,0,0.2); border-right: 1px solid rgba(255,255,255,0.08); display: flex; flex-direction: column; overflow-y: auto; scrollbar-width: none; }
.d-br-sidebar::-webkit-scrollbar { display: none; }
.d-br-sidebar-head { padding: 6px; border-bottom: 1px solid rgba(255,255,255,0.08); flex-shrink: 0; }
.d-br-btn { display: block; text-align: center; font-size: 9px; font-weight: 600; padding: 5px; border-radius: 4px; background: #29b6f6; color: #fff; cursor: default; }
.d-br-meeting { padding: 7px 8px; margin: 3px 4px; border-radius: 6px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); cursor: pointer; transition: all 0.2s; }
.d-br-meeting:hover { background: rgba(255,255,255,0.08); }
.d-br-meeting.active { background: rgba(41,182,246,0.15); border-color: rgba(41,182,246,0.4); }
.d-br-topic { font-size: 9px; font-weight: 600; color: #e3f2fd; margin-bottom: 2px; }
.d-br-meta { display: flex; align-items: center; gap: 4px; font-size: 8px; color: #90caf9; }
.d-br-status-badge { font-size: 7px; padding: 1px 4px; border-radius: 3px; font-weight: 600; }
.d-br-active { background: rgba(40,200,64,0.2); color: #28c840; }
.d-br-closed { background: rgba(144,202,249,0.15); color: rgba(144,202,249,0.6); }
.d-br-main { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; min-height: 0; }
.d-br-header { padding: 6px 8px; border-bottom: 1px solid rgba(255,255,255,0.06); flex-shrink: 0; }
.d-br-title { font-size: 10px; font-weight: 600; color: #e3f2fd; margin-bottom: 4px; }
.d-br-outcome {
    display: none; padding: 6px 8px; font-size: 8px; line-height: 1.5;
    background: rgba(40,200,64,0.08); border-top: 1px solid rgba(40,200,64,0.2);
    color: #a5d6a7; flex-shrink: 0;
}
.d-participant-bar { display: flex; gap: 3px; flex-wrap: wrap; }
.d-chip { display: flex; align-items: center; gap: 2px; font-size: 7px; padding: 1px 5px; border-radius: 8px; background: rgba(255,255,255,0.05); color: #90caf9; }
.d-chip-dot { width: 4px; height: 4px; border-radius: 50%; background: #52525b; }
.d-chip-dot.d-speaking { background: #4ade80; box-shadow: 0 0 4px rgba(74,222,128,0.6); animation: dPulse 1.5s ease infinite; }
@keyframes dPulse { 50% { opacity: 0.5; } }
.d-chip-anismin { border: 1px solid rgba(6,182,212,0.2); }
.d-chip-seraph { border: 1px solid rgba(249,115,22,0.2); }
.d-chip-halcyon { border: 1px solid rgba(34,197,94,0.2); }
.d-chip-raziel { border: 1px solid rgba(239,68,68,0.2); }
.d-chip-cassiel { border: 1px solid rgba(168,85,247,0.2); }
.d-thread { flex: 1; min-height: 0; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; scrollbar-width: none; scroll-behavior: smooth; }
.d-thread::-webkit-scrollbar { display: none; }
.d-message { display: flex; gap: 6px; max-width: 80%; margin-bottom: 4px; }
.d-msg-left { align-self: flex-start; }
.d-msg-right { align-self: flex-end; flex-direction: row-reverse; }
.d-msg-right .d-msg-header { flex-direction: row-reverse; }
.d-msg-right .d-msg-body { border-top-left-radius: 8px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 8px; }
@keyframes dMsgIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.d-avatar { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; border: 1.5px solid rgba(255,255,255,0.15); }
.d-av-anismin { background: rgba(6,182,212,0.3); border-color: rgba(6,182,212,0.5); }
.d-av-seraph { background: rgba(249,115,22,0.3); border-color: rgba(249,115,22,0.5); }
.d-av-halcyon { background: rgba(34,197,94,0.3); border-color: rgba(34,197,94,0.5); }
.d-av-raziel { background: rgba(239,68,68,0.3); border-color: rgba(239,68,68,0.5); }
.d-av-cassiel { background: rgba(168,85,247,0.3); border-color: rgba(168,85,247,0.5); }
.d-msg-content { flex: 1; min-width: 0; }
.d-msg-header { display: flex; align-items: center; gap: 4px; margin-bottom: 2px; }
.d-msg-name { font-size: 9px; font-weight: 600; color: #e3f2fd; }
.d-msg-role { font-size: 7px; padding: 1px 4px; border-radius: 3px; font-weight: 600; }
.d-msg-time { font-size: 7px; color: rgba(255,255,255,0.35); }
.d-msg-body { font-size: 9px; line-height: 1.5; color: #e3f2fd; padding: 5px 8px; border-radius: 8px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06); border-top-left-radius: 3px; word-wrap: break-word; }

/* ═══ MEMORY ═══ */
.d-memory-layout { display: flex; height: 100%; min-height: 0; }
.d-mem-sidebar { width: 30%; min-width: 0; background: rgba(0,0,0,0.2); border-right: 1px solid rgba(255,255,255,0.06); display: flex; flex-direction: column; overflow: hidden; }
.d-mem-agents { display: flex; gap: 4px; justify-content: center; padding: 8px 6px; border-bottom: 1px solid rgba(255,255,255,0.06); flex-shrink: 0; }
.d-agent-ring { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; border: 1.5px solid; background: rgba(0,0,0,0.3); cursor: default; transition: transform 0.2s; }
.d-agent-ring:hover { transform: scale(1.15); }
.d-mem-nav { padding: 4px; overflow-y: auto; scrollbar-width: none; }
.d-mem-nav::-webkit-scrollbar { display: none; }
.d-mem-nav-item { font-size: 8px; padding: 5px 8px; border-radius: 6px; color: #90caf9; cursor: pointer; transition: background 0.15s; margin-bottom: 1px; }
.d-mem-nav-item:hover { background: rgba(255,255,255,0.05); }
.d-mem-nav-item.active { background: rgba(41,182,246,0.15); color: #e3f2fd; font-weight: 600; }
.d-mem-main { flex: 1; padding: 8px; overflow-y: auto; scrollbar-width: none; min-height: 0; }
.d-mem-main::-webkit-scrollbar { display: none; }
.d-mem-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
.d-stat-card { text-align: center; padding: 6px 4px; border-radius: 6px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); }
.d-stat-value { font-size: 16px; font-weight: 700; color: #29b6f6; }
.d-stat-label { font-size: 7px; color: #90caf9; margin-top: 1px; }
.d-dash-list { display: flex; flex-direction: column; }
.d-dash-item { display: flex; align-items: center; gap: 5px; padding: 4px 6px; border-radius: 4px; font-size: 8px; cursor: default; transition: background 0.15s; }
.d-dash-item:hover { background: rgba(255,255,255,0.05); }
.d-dash-icon { font-size: 10px; flex-shrink: 0; }
.d-dash-text { flex: 1; color: #e3f2fd; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-dash-badge { font-size: 7px; padding: 1px 4px; border-radius: 3px; font-weight: 600; flex-shrink: 0; }
.d-dash-date { font-size: 7px; color: rgba(144,202,249,0.5); flex-shrink: 0; }

/* Memory tab views */
.d-mem-tab { display: none; }
.d-mem-tab.active { display: block; }
.d-mem-entry { padding: 6px 8px; border-radius: 6px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); margin-bottom: 5px; }
.d-mem-entry-head { display: flex; align-items: center; gap: 5px; margin-bottom: 3px; }
.d-mem-entry-agent { font-size: 10px; }
.d-mem-entry-cat { font-size: 7px; padding: 1px 4px; border-radius: 3px; font-weight: 600; }
.d-mem-entry-date { font-size: 7px; color: rgba(144,202,249,0.5); margin-left: auto; }
.d-mem-entry-text { font-size: 8px; color: #e3f2fd; line-height: 1.5; }
.d-mem-core { padding: 8px; border-radius: 8px; border-left: 3px solid; margin-bottom: 6px; background: rgba(255,255,255,0.03); }
.d-mem-core-text { font-size: 9px; color: #e3f2fd; line-height: 1.5; font-weight: 500; }
.d-mem-core-meta { font-size: 7px; color: #90caf9; margin-top: 3px; }
.d-mem-person { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); margin-bottom: 4px; }
.d-mem-person-avatar { width: 24px; height: 24px; border-radius: 50%; background: rgba(41,182,246,0.15); display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }
.d-mem-person-info { flex: 1; min-width: 0; }
.d-mem-person-name { font-size: 9px; font-weight: 600; color: #e3f2fd; }
.d-mem-person-role { font-size: 7px; color: #90caf9; }
.d-mem-project { padding: 6px 8px; border-radius: 6px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); margin-bottom: 5px; }
.d-mem-project-title { font-size: 9px; font-weight: 600; color: #e3f2fd; }
.d-mem-project-desc { font-size: 8px; color: #90caf9; margin-top: 2px; }
.d-mem-project-bar { height: 3px; border-radius: 2px; background: rgba(255,255,255,0.06); margin-top: 4px; overflow: hidden; }
.d-mem-project-fill { height: 100%; border-radius: 2px; background: #29b6f6; }

/* ═══ LAUNCHPAD ═══ */
.d-launchpad { position: fixed; inset: 0; z-index: 10000; pointer-events: none; }
.d-launchpad.active { pointer-events: auto; }
.d-lp-bg { position: absolute; inset: 0; background: rgba(5,12,24,0.88); opacity: 0; transition: opacity 0.4s; }
.d-launchpad.active .d-lp-bg { opacity: 1; }
.d-lp-grid {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%) scale(1.05);
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; padding: 24px;
    opacity: 0; transition: opacity 0.35s ease, transform 0.35s ease;
}
.d-launchpad.active .d-lp-grid { opacity: 1; transform: translate(-50%,-50%) scale(1); transition-delay: 0.1s; }
.d-lp-app { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; padding: 10px; border-radius: 10px; transition: transform 0.2s; }
.d-lp-app:hover { transform: scale(1.1); background: rgba(255,255,255,0.1); }
.d-lp-icon { font-size: 36px; width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.1); border-radius: 14px; }
.d-lp-label { font-size: 10px; color: #e3f2fd; text-align: center; }

/* ═══ DOCK ═══ */
.d-dock {
    position: fixed; bottom: 6px; left: 50%; transform: translateX(-50%);
    background: rgba(15, 35, 60, 0.9); border-radius: 14px;
    padding: 6px 12px; display: flex; align-items: center; gap: 6px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 60px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1); z-index: 9998;
}
.d-dock-sep { width: 1px; height: 28px; background: rgba(255,255,255,0.1); margin: 0 2px; }
.d-dock-item {
    width: 36px; height: 36px; border-radius: 10px;
    background: rgba(19,47,76,0.8);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; cursor: pointer; position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.d-dock-item:hover { transform: translateY(-6px) scale(1.15); box-shadow: 0 8px 20px rgba(0,0,0,0.4); }
.d-dock-item.d-dock-active { box-shadow: 0 4px 12px rgba(0,0,0,0.2), 0 3px 0 -1px rgba(41,182,246,0.6); }
.d-dock-label {
    position: absolute; bottom: 42px; left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,0.85); color: #e3f2fd; padding: 2px 8px;
    border-radius: 4px; font-size: 9px; white-space: nowrap;
    opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.d-dock-item:hover .d-dock-label { opacity: 1; }

/* Toasts */
.d-toast-area { position: absolute; top: 6px; right: 6px; z-index: 10; display: flex; flex-direction: column; gap: 4px; }
.d-toast {
    display: flex; align-items: center; gap: 6px;
    background: rgba(10,25,41,0.92); border: 1px solid rgba(41,182,246,0.15);
    border-radius: 8px; padding: 5px 10px; font-size: 9px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    animation: dToastIn 0.4s ease forwards, dToastOut 0.4s ease 2.8s forwards;
}
.d-toast-icon { font-size: 12px; }
@keyframes dToastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes dToastOut { to { opacity: 0; transform: translateX(20px); } }

/* Responsive */
@media (max-width: 640px) {
    .d-desktop { grid-template-columns: 1fr; grid-template-rows: auto; }
    #win-dispatch { grid-row: auto; }
    .d-kanban { flex-direction: column; }
    .d-lp-grid { grid-template-columns: repeat(3, 1fr); }
}
