:root {
  color-scheme: dark;
  --bg: #050b14;
  --glass: rgba(6, 15, 29, 0.76);
  --border: rgba(132, 190, 255, 0.2);
  --text: #f6fbff;
  --muted: #8ea6bf;
  --blue: #42a5ff;
  --purple: #9a72ff;
  --green: #55edb6;
  --orange: #ffac52;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--bg); color: var(--text); }
button, input { font: inherit; }
button { color: inherit; }
#renderCanvas { width: 100%; height: 100%; display: block; outline: none; touch-action: none; }
.glass { background: var(--glass); border: 1px solid var(--border); box-shadow: 0 18px 60px rgba(0,0,0,.28); backdrop-filter: blur(18px); }
.splash { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: #050b14 url("assets/agentworld-concept.png") center/cover no-repeat; transition: opacity .6s ease, visibility .6s ease; }
.splash.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(2,6,13,.92) 0%, rgba(2,6,13,.58) 45%, rgba(2,6,13,.2) 100%), linear-gradient(0deg, rgba(3,8,16,.86), transparent 60%); }
.splash-content { position: relative; width: min(1120px, calc(100% - 48px)); }
.eyebrow { color: #86bfff; font-size: .78rem; letter-spacing: .28em; font-weight: 800; }
.splash h1 { margin: 10px 0 6px; font-size: clamp(3.4rem, 8vw, 7.5rem); line-height: .92; letter-spacing: -.07em; }
.splash h1 span { color: transparent; background: linear-gradient(100deg, #47a9ff, #9d79ff); background-clip: text; }
.splash p { margin: 18px 0 32px; font-size: clamp(1.2rem, 2.5vw, 2rem); color: #e5f2ff; }
.primary-button { border: 0; border-radius: 14px; padding: 16px 24px; font-weight: 850; background: linear-gradient(110deg, #258ff2, #7a5be8); box-shadow: 0 10px 40px rgba(66,165,255,.35); cursor: pointer; }
.primary-button:hover { transform: translateY(-1px); filter: brightness(1.08); }
.splash-note { margin-top: 20px; color: #9eb3c7; font-size: .9rem; }
.topbar { position: fixed; z-index: 20; top: 18px; left: 18px; height: 60px; min-width: 320px; border-radius: 18px; padding: 10px 14px; display: flex; align-items: center; gap: 11px; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(145deg, #35a7ff, #7558e8); font-weight: 900; }
.topbar strong, .topbar small { display: block; }
.topbar small { color: var(--muted); margin-top: 2px; }
.connection { margin-left: auto; padding-left: 18px; color: #bcd0e2; font-size: .78rem; display: flex; gap: 7px; align-items: center; }
.connection i { width: 8px; height: 8px; border-radius: 99px; background: var(--green); box-shadow: 0 0 14px var(--green); }
.objectives { position: fixed; z-index: 20; left: 18px; bottom: 88px; width: 290px; border-radius: 18px; padding: 16px; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; font-size: .73rem; letter-spacing: .1em; color: #aac6df; }
.panel-heading b { color: var(--text); letter-spacing: normal; }
.objective { margin: 13px 0; display: flex; gap: 10px; color: #c8d7e5; font-size: .88rem; }
.objective i { width: 17px; height: 17px; border: 1px solid #59718b; border-radius: 5px; flex: 0 0 auto; display: grid; place-items: center; font-style: normal; }
.objective.complete { color: #eefcff; }
.objective.complete i { background: rgba(85,237,182,.18); border-color: var(--green); color: var(--green); }
.reward-row { border-top: 1px solid rgba(140,180,220,.15); margin-top: 13px; padding-top: 12px; display: flex; justify-content: space-between; color: #8fa8be; font-size: .7rem; }
.reward-row b { color: #ffd67d; }
.minimap { position: fixed; z-index: 20; right: 18px; top: 18px; border-radius: 50%; width: 174px; height: 174px; padding: 7px; overflow: hidden; }
#minimapCanvas { width: 100%; height: 100%; }
.district-banner { position: fixed; z-index: 18; left: 50%; top: 24px; transform: translate(-50%, -140%); border-radius: 15px; padding: 10px 22px; text-align: center; transition: transform .35s ease; }
.district-banner.show { transform: translate(-50%, 0); }
.district-banner small, .district-banner strong { display: block; }
.district-banner small { color: #8fb6d7; font-size: .62rem; letter-spacing: .2em; }
.district-banner strong { margin-top: 3px; }
.interaction-prompt { position: fixed; z-index: 25; bottom: 94px; left: 50%; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; padding: 10px 14px; border-radius: 13px; display: flex; align-items: center; gap: 10px; transition: .2s ease; }
.interaction-prompt.show { opacity: 1; transform: translate(-50%, 0); }
kbd { background: #eef7ff; color: #08101c; border-radius: 6px; padding: 5px 8px; font-weight: 900; }
.agent-panel { position: fixed; z-index: 40; right: 18px; top: 205px; bottom: 88px; width: min(410px, calc(100% - 36px)); border-radius: 22px; padding: 16px; transform: translateX(calc(100% + 36px)); transition: transform .32s cubic-bezier(.2,.8,.2,1); display: flex; flex-direction: column; }
.agent-panel.open { transform: translateX(0); }
.agent-header { display: flex; align-items: center; gap: 12px; }
.agent-avatar { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; font-weight: 900; background: linear-gradient(145deg, #2f9cf7, #7f5dea); }
.agent-header small { color: #88aac6; font-size: .66rem; letter-spacing: .13em; }
.agent-header h2 { margin: 2px 0 0; font-size: 1.2rem; }
.icon-button { margin-left: auto; border: 0; background: transparent; font-size: 2rem; cursor: pointer; color: #9cb1c4; }
.chat-log { flex: 1; overflow-y: auto; padding: 16px 4px 10px; scrollbar-width: thin; }
.message { max-width: 88%; margin: 8px 0; padding: 11px 13px; border-radius: 14px; line-height: 1.45; font-size: .88rem; white-space: pre-wrap; }
.message.agent { background: rgba(64,134,197,.15); border: 1px solid rgba(81,166,241,.18); }
.message.user { margin-left: auto; background: linear-gradient(120deg, rgba(75,152,224,.34), rgba(125,89,224,.34)); }
.message.pending { color: #93abc0; font-style: italic; }
.suggestion-row { display: flex; gap: 7px; overflow-x: auto; padding: 4px 0 10px; }
.suggestion-row button { white-space: nowrap; border: 1px solid rgba(112,176,233,.24); background: rgba(40,96,145,.13); padding: 8px 10px; border-radius: 999px; color: #c8e2f8; cursor: pointer; font-size: .76rem; }
.chat-form { display: flex; gap: 8px; }
.chat-form input { flex: 1; min-width: 0; border-radius: 12px; border: 1px solid rgba(127,174,216,.24); background: rgba(2,8,17,.72); color: white; padding: 12px; outline: none; }
.chat-form input:focus { border-color: #4ca7f6; box-shadow: 0 0 0 3px rgba(76,167,246,.1); }
.send-button { border: 0; border-radius: 12px; background: #2d91e6; padding: 0 16px; font-weight: 800; cursor: pointer; }
.approval-note { margin-top: 10px; font-size: .68rem; text-align: center; color: #7890a7; }
.commandbar { position: fixed; z-index: 20; left: 50%; bottom: 18px; transform: translateX(-50%); border-radius: 18px; display: flex; padding: 7px; }
.commandbar button { min-width: 82px; border: 0; background: transparent; padding: 7px 10px; color: #a7bed2; cursor: pointer; border-radius: 11px; font-size: .7rem; }
.commandbar button:hover { background: rgba(83,157,225,.13); color: white; }
.commandbar span { display: block; font-size: 1.15rem; margin-bottom: 3px; }
.toast-region { position: fixed; z-index: 60; top: 92px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; }
.toast { background: rgba(5,14,27,.9); border: 1px solid rgba(94,176,247,.24); border-radius: 13px; padding: 11px 15px; box-shadow: 0 14px 40px rgba(0,0,0,.3); animation: toastIn .25s ease; }
@keyframes toastIn { from { transform: translateY(-8px); opacity: 0; } }
.mobile-controls { display: none; }
@media (max-width: 760px) {
  .topbar { min-width: 0; right: 92px; }
  .connection { display: none; }
  .minimap { width: 74px; height: 74px; }
  .objectives { width: 230px; bottom: 120px; transform: scale(.88); transform-origin: bottom left; }
  .commandbar { display: none; }
  .agent-panel { top: 95px; bottom: 105px; }
  .mobile-controls { position: fixed; z-index: 30; inset: auto 14px 14px; display: flex; justify-content: space-between; pointer-events: none; }
  .mobile-controls button { pointer-events: auto; width: 54px; height: 46px; border-radius: 13px; border: 1px solid rgba(150,200,245,.22); background: rgba(4,13,26,.7); backdrop-filter: blur(10px); color: white; font-weight: 800; }
  .dpad { width: 166px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
  .dpad button:nth-child(1) { grid-column: 2; }
  .dpad button:nth-child(2) { grid-column: 1; }
  .dpad button:nth-child(3) { grid-column: 2; }
  .dpad button:nth-child(4) { grid-column: 3; }
  .action-pad { display: grid; grid-template-columns: repeat(2, 1fr); align-content: end; gap: 5px; }
  .action-pad button:last-child { grid-column: 2; }
}

/* v0.2 Agent Workbench */
.splash-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.secondary-button { border: 1px solid rgba(154,199,240,.34); border-radius: 14px; padding: 15px 22px; font-weight: 800; background: rgba(5,15,29,.76); color: #e7f4ff; cursor: pointer; backdrop-filter: blur(14px); }
.secondary-button:hover { background: rgba(38,92,142,.35); transform: translateY(-1px); }
.waypoint-hud { position: fixed; z-index: 24; left: 50%; top: 88px; transform: translate(-50%, -22px); opacity: 0; pointer-events: none; min-width: 255px; border-radius: 16px; padding: 10px 12px 10px 15px; display: flex; align-items: center; gap: 18px; transition: .25s ease; border-color: rgba(255,209,102,.32); }
.waypoint-hud.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.waypoint-hud div { min-width: 0; flex: 1; }
.waypoint-hud small, .waypoint-hud strong { display: block; }
.waypoint-hud small { color: #ffd166; font-size: .58rem; letter-spacing: .18em; }
.waypoint-hud strong { margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.waypoint-hud b { color: #fff1bc; white-space: nowrap; }
.waypoint-hud button { width: 30px; height: 30px; border-radius: 9px; border: 1px solid rgba(255,209,102,.25); background: rgba(255,209,102,.08); color: #ffe5a3; cursor: pointer; font-size: 1.1rem; }
.workbench { position: fixed; z-index: 35; inset: 92px 9vw 82px; border-radius: 24px; padding: 0; overflow: hidden; display: flex; flex-direction: column; opacity: 0; visibility: hidden; transform: translateY(18px) scale(.985); transition: opacity .25s ease, transform .25s ease, visibility .25s; background: rgba(4,12,24,.93); }
.workbench.open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.workbench-header { min-height: 76px; display: flex; align-items: center; gap: 18px; padding: 15px 20px; border-bottom: 1px solid rgba(130,184,233,.16); background: linear-gradient(90deg, rgba(44,118,184,.12), rgba(119,78,211,.08)); }
.workbench-header small { color: #77b8ee; font-size: .62rem; letter-spacing: .18em; }
.workbench-header h2 { margin: 3px 0 0; font-size: 1.35rem; }
.workbench-status { margin-left: auto; color: #a7c1d7; font-size: .67rem; letter-spacing: .1em; display: flex; align-items: center; gap: 8px; }
.workbench-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 13px var(--green); }
.workbench-header .icon-button { margin-left: 0; }
.workbench-tabs { display: flex; gap: 4px; padding: 9px 14px; border-bottom: 1px solid rgba(130,184,233,.13); overflow-x: auto; }
.workbench-tabs button { border: 0; border-radius: 10px; padding: 9px 14px; background: transparent; color: #90a8bd; cursor: pointer; font-weight: 750; font-size: .78rem; white-space: nowrap; }
.workbench-tabs button:hover, .workbench-tabs button.active { color: white; background: rgba(69,154,231,.16); }
.workbench-content { flex: 1; overflow: auto; padding: 18px; }
.workbench-footer { padding: 10px 18px; border-top: 1px solid rgba(130,184,233,.13); color: #718ba2; font-size: .68rem; text-align: center; }
.agent-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.agent-card { min-height: 202px; padding: 16px; border-radius: 18px; border: 1px solid color-mix(in srgb, var(--agent-color) 28%, transparent); background: linear-gradient(145deg, color-mix(in srgb, var(--agent-color) 10%, rgba(7,17,31,.92)), rgba(5,12,23,.94)); display: flex; flex-direction: column; }
.agent-card-heading { display: flex; align-items: center; gap: 11px; }
.agent-card-heading > span { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 13px; background: color-mix(in srgb, var(--agent-color) 28%, rgba(8,17,30,.9)); border: 1px solid color-mix(in srgb, var(--agent-color) 46%, transparent); font-weight: 900; color: white; }
.agent-card-heading small { display: block; color: #87a4bd; font-size: .56rem; letter-spacing: .1em; }
.agent-card-heading h3 { margin: 2px 0 0; }
.agent-card-heading i { margin-left: auto; font-style: normal; color: var(--green); font-size: .58rem; letter-spacing: .12em; }
.agent-card p { color: #9db2c5; line-height: 1.45; font-size: .79rem; flex: 1; }
.agent-card-actions { display: flex; gap: 8px; }
.agent-card-actions button { flex: 1; border: 0; border-radius: 10px; padding: 9px 10px; color: white; font-weight: 750; cursor: pointer; background: color-mix(in srgb, var(--agent-color) 58%, #19547f); }
.agent-card-actions button.secondary { background: rgba(111,149,183,.12); border: 1px solid rgba(135,182,224,.2); color: #c8dced; }
.dashboard-list, .workflow-ledger { display: grid; gap: 10px; }
.dashboard-row { display: flex; gap: 13px; align-items: center; border: 1px solid rgba(130,184,233,.14); background: rgba(10,24,42,.56); border-radius: 14px; padding: 14px; }
.dashboard-row > b { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: rgba(119,155,190,.12); color: #91a9bf; }
.dashboard-row.done > b { background: rgba(85,237,182,.13); color: var(--green); }
.dashboard-row strong, .dashboard-row small { display: block; }
.dashboard-row small { margin-top: 3px; color: #7891a8; }
.dashboard-summary { margin-top: 16px; padding: 16px; border-radius: 16px; background: rgba(44,110,169,.1); display: grid; grid-template-columns: 1fr auto; gap: 8px 18px; align-items: center; }
.dashboard-summary span { color: #9ab1c5; }
.dashboard-summary progress { grid-column: 1 / -1; width: 100%; accent-color: #55edb6; }
.workflow-card { border: 1px solid rgba(127,176,220,.16); border-radius: 16px; padding: 15px; background: rgba(8,20,36,.7); }
.workflow-card small { color: #7fa7c7; }
.workflow-card h3 { margin: 5px 0 10px; font-size: 1rem; }
.workflow-card ol { margin: 12px 0 0 20px; padding: 0; color: #9fb5c8; font-size: .78rem; line-height: 1.6; }
.workflow-flags { display: flex; gap: 7px; flex-wrap: wrap; }
.workflow-flags span { border-radius: 999px; padding: 5px 8px; background: rgba(255,172,82,.11); color: #ffc77e; border: 1px solid rgba(255,172,82,.16); font-size: .63rem; }
.workflow-flags span.safe { background: rgba(85,237,182,.09); color: #78eec2; border-color: rgba(85,237,182,.14); }
.empty-state { min-height: 260px; display: grid; place-content: center; text-align: center; max-width: 620px; margin: auto; color: #90a9be; }
.empty-state strong { color: white; font-size: 1.2rem; }
.empty-state p { line-height: 1.6; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.metric-grid article { padding: 15px; border-radius: 15px; border: 1px solid rgba(127,176,220,.15); background: rgba(9,22,39,.7); }
.metric-grid small, .metric-grid strong { display: block; }
.metric-grid small { color: #7697b2; font-size: .6rem; letter-spacing: .12em; }
.metric-grid strong { margin-top: 8px; font-size: 1rem; }
.world-json { margin: 14px 0 0; min-height: 300px; border-radius: 16px; border: 1px solid rgba(127,176,220,.14); background: #030a13; color: #9dd5ff; padding: 16px; overflow: auto; font: .76rem/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; }
@media (max-width: 980px) {
  .workbench { inset: 90px 18px 78px; }
  .agent-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .splash-actions { align-items: stretch; flex-direction: column; max-width: 310px; }
  .workbench { inset: 82px 8px 96px; border-radius: 18px; }
  .workbench-header { min-height: 66px; padding: 10px 12px; }
  .workbench-status { display: none; }
  .workbench-content { padding: 10px; }
  .agent-grid, .metric-grid { grid-template-columns: 1fr; }
  .waypoint-hud { top: 82px; min-width: min(280px, calc(100% - 100px)); }
}

/* v0.3 District Expansion */
.registry-toolbar { display: grid; grid-template-columns: minmax(220px,1fr) minmax(190px,.42fr); gap: 10px; margin-bottom: 14px; position: sticky; top: -18px; z-index: 3; padding: 12px 0 10px; background: linear-gradient(rgba(4,12,24,.98),rgba(4,12,24,.9),transparent); }
.registry-toolbar input, .registry-toolbar select { width: 100%; border: 1px solid rgba(129,183,231,.2); border-radius: 12px; background: rgba(5,15,29,.9); color: #e8f5ff; padding: 11px 13px; outline: none; }
.registry-toolbar input:focus, .registry-toolbar select:focus { border-color: rgba(91,179,255,.58); box-shadow: 0 0 0 3px rgba(66,165,255,.08); }
.agent-card em { display: inline-flex; align-self: flex-start; margin-top: 10px; padding: 4px 8px; border-radius: 999px; font-style: normal; font-size: .58rem; letter-spacing: .05em; color: color-mix(in srgb, var(--agent-color) 74%, white); background: color-mix(in srgb, var(--agent-color) 10%, transparent); border: 1px solid color-mix(in srgb, var(--agent-color) 18%, transparent); }
.agent-card p { max-height: 4.6em; overflow: hidden; }
.district-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.district-card { min-height: 205px; padding: 16px; border-radius: 18px; border: 1px solid color-mix(in srgb, var(--district-color) 27%, transparent); background: linear-gradient(145deg,color-mix(in srgb,var(--district-color) 9%,rgba(7,17,31,.94)),rgba(5,12,23,.96)); display:flex; flex-direction:column; }
.district-card-top { display:flex; align-items:center; gap:11px; }
.district-card-top > span { width:12px; height:48px; border-radius:999px; background:var(--district-color); box-shadow:0 0 22px color-mix(in srgb,var(--district-color) 60%,transparent); }
.district-card-top div { min-width:0; }
.district-card-top small { color:var(--district-color); font-size:.58rem; letter-spacing:.13em; }
.district-card-top h3 { margin:3px 0 0; font-size:1rem; }
.district-card-top b { margin-left:auto; white-space:nowrap; color:#8ea9bf; font-size:.65rem; }
.district-card > p { color:#91a9bd; font-size:.72rem; letter-spacing:.06em; }
.district-agent-list { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:14px; flex:1; align-content:flex-start; }
.district-agent-list span { border-radius:999px; padding:5px 8px; background:rgba(126,170,207,.09); border:1px solid rgba(126,170,207,.13); color:#a8bfd2; font-size:.62rem; }
@media (max-width: 1080px) { .district-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 680px) { .registry-toolbar { grid-template-columns:1fr; top:-10px; } .district-grid { grid-template-columns:1fr; } }

/* v0.4 Artifact & Approval Workbench */
.artifact-badge { margin-left: auto; border: 1px solid rgba(255,209,102,.24); border-radius: 999px; padding: 7px 11px; background: rgba(255,209,102,.08); color: #d8e9f8; font-size: .68rem; font-weight: 800; cursor: pointer; white-space: nowrap; }
.artifact-badge.attention { color: #ffe8a3; background: rgba(255,209,102,.14); box-shadow: 0 0 18px rgba(255,209,102,.12); }
.topbar .connection { margin-left: 0; }
.commandbar { max-width: min(930px, calc(100vw - 30px)); overflow-x: auto; }
.artifact-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 14px; padding: 12px 14px; border-radius: 14px; background: rgba(9,23,40,.72); border: 1px solid rgba(121,180,225,.14); }
.artifact-toolbar select { min-width: 190px; border: 1px solid rgba(129,183,231,.22); border-radius: 10px; background: rgba(4,14,27,.92); color: #eaf7ff; padding: 9px 11px; }
.artifact-toolbar span { color: #83a2bb; font-size: .72rem; }
.artifact-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.artifact-card { --artifact-color: #63d8ff; display: flex; flex-direction: column; min-height: 250px; border-radius: 18px; padding: 16px; border: 1px solid color-mix(in srgb,var(--artifact-color) 28%,transparent); background: linear-gradient(145deg,color-mix(in srgb,var(--artifact-color) 8%,rgba(7,18,33,.96)),rgba(4,11,21,.96)); }
.artifact-card-head { display: flex; align-items: flex-start; gap: 11px; }
.artifact-card-head > span { width: 42px; height: 48px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px 10px 15px 10px; background: color-mix(in srgb,var(--artifact-color) 18%,rgba(8,20,36,.9)); border: 1px solid color-mix(in srgb,var(--artifact-color) 34%,transparent); color: var(--artifact-color); font-size: 1.25rem; }
.artifact-card-head > div { min-width: 0; }
.artifact-card-head small { color: var(--artifact-color); font-size: .58rem; letter-spacing: .09em; }
.artifact-card-head h3 { margin: 4px 0 0; font-size: .98rem; line-height: 1.3; }
.artifact-card-head b { margin-left: auto; padding: 5px 8px; border-radius: 999px; color: var(--artifact-color); background: color-mix(in srgb,var(--artifact-color) 10%,transparent); border: 1px solid color-mix(in srgb,var(--artifact-color) 19%,transparent); text-transform: uppercase; font-size: .55rem; letter-spacing: .07em; white-space: nowrap; }
.artifact-card > p { color: #9bb2c5; line-height: 1.5; font-size: .78rem; flex: 1; }
.artifact-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 13px; }
.artifact-meta span { padding: 4px 7px; border-radius: 999px; background: rgba(123,170,207,.08); border: 1px solid rgba(123,170,207,.11); color: #8da9c0; font-size: .59rem; }
.artifact-actions, .artifact-detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.artifact-actions button, .artifact-actions a, .artifact-detail-actions button, .artifact-detail-actions a, .inline-primary { border: 0; border-radius: 10px; padding: 9px 11px; color: white; font-weight: 800; font-size: .7rem; cursor: pointer; text-decoration: none; background: color-mix(in srgb,var(--artifact-color,#42a5ff) 62%,#1d557d); }
.artifact-actions .secondary { background: rgba(111,149,183,.12); border: 1px solid rgba(135,182,224,.2); color: #c8dced; }
.approval-summary { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 15px 17px; margin-bottom: 14px; border-radius: 16px; background: linear-gradient(90deg,rgba(255,209,102,.12),rgba(96,167,224,.06)); border: 1px solid rgba(255,209,102,.19); }
.approval-summary small, .approval-summary strong { display: block; }
.approval-summary small { color: #ffd166; font-size: .58rem; letter-spacing: .14em; }
.approval-summary strong { margin-top: 5px; font-size: 1.1rem; }
.approval-summary p { max-width: 480px; color: #9eb2c3; font-size: .74rem; line-height: 1.45; }
.approval-queue { display: grid; gap: 14px; }
.approval-card { border-radius: 18px; padding: 16px; border: 1px solid rgba(255,209,102,.18); background: linear-gradient(145deg,rgba(41,35,18,.44),rgba(6,15,27,.94)); }
.approval-card-head { display: flex; align-items: flex-start; gap: 12px; }
.approval-card-head > div { flex: 1; min-width: 0; }
.approval-card-head small { color: #ffd166; font-size: .59rem; letter-spacing: .08em; }
.approval-card-head h3 { margin: 4px 0 0; font-size: 1rem; }
.approval-card-head > button { border: 1px solid rgba(125,180,226,.19); border-radius: 9px; padding: 7px 10px; background: rgba(75,148,207,.11); color: #cde9ff; cursor: pointer; }
.approval-card > p { color: #9db2c4; font-size: .78rem; line-height: 1.5; }
.approval-evidence { display: flex; gap: 7px; flex-wrap: wrap; margin: 10px 0 12px; }
.approval-evidence span { padding: 5px 8px; border-radius: 999px; background: rgba(85,237,182,.08); border: 1px solid rgba(85,237,182,.12); color: #7fe8c1; font-size: .61rem; }
.approval-card textarea { width: 100%; min-height: 74px; resize: vertical; border: 1px solid rgba(128,178,220,.18); border-radius: 11px; background: rgba(3,11,21,.7); color: #e9f7ff; padding: 10px 11px; outline: none; font: inherit; font-size: .74rem; }
.approval-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.approval-actions button, .artifact-detail-actions button { border: 0; border-radius: 10px; padding: 9px 12px; color: white; font-weight: 800; cursor: pointer; }
.approval-actions .approve, .artifact-detail-actions .approve { background: #16865f; }
.approval-actions .revise, .artifact-detail-actions .revise { background: #a86122; }
.approval-actions .reject, .artifact-detail-actions .reject { background: #9a3548; }
.artifact-detail { --artifact-color: #63d8ff; max-width: 980px; margin: 0 auto; }
.artifact-back { margin-bottom: 12px; border: 0; background: transparent; color: #8bc8f7; cursor: pointer; font-weight: 800; }
.artifact-detail > header { display: flex; gap: 16px; align-items: flex-start; padding: 18px; border-radius: 18px; border: 1px solid color-mix(in srgb,var(--artifact-color) 28%,transparent); background: linear-gradient(145deg,color-mix(in srgb,var(--artifact-color) 9%,rgba(8,19,34,.96)),rgba(5,12,23,.96)); }
.artifact-detail > header > div { flex: 1; min-width: 0; }
.artifact-detail header small { color: var(--artifact-color); font-size: .59rem; letter-spacing: .08em; }
.artifact-detail header h2 { margin: 6px 0; font-size: 1.45rem; }
.artifact-detail header p { color: #9db3c5; line-height: 1.55; }
.artifact-detail header > b { border-radius: 999px; padding: 7px 10px; background: color-mix(in srgb,var(--artifact-color) 11%,transparent); border: 1px solid color-mix(in srgb,var(--artifact-color) 22%,transparent); color: var(--artifact-color); text-transform: uppercase; font-size: .62rem; white-space: nowrap; }
.artifact-detail-meta { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; margin: 12px 0; }
.artifact-detail-meta span { padding: 10px; border-radius: 11px; background: rgba(9,22,38,.72); border: 1px solid rgba(124,177,220,.12); color: #829db3; font-size: .68rem; }
.artifact-detail-meta b { color: #dceeff; }
.artifact-document { padding: 20px; border-radius: 18px; background: #f4f7fa; color: #182433; box-shadow: 0 16px 50px rgba(0,0,0,.22); }
.artifact-document section + section { border-top: 1px solid #d8e0e7; margin-top: 18px; padding-top: 14px; }
.artifact-document h4 { margin: 0 0 8px; font-size: .92rem; }
.artifact-document ul { margin: 0 0 0 20px; padding: 0; line-height: 1.6; font-size: .78rem; }
.review-history { margin: 14px 0; padding: 16px; border-radius: 15px; border: 1px solid rgba(125,177,220,.14); background: rgba(7,18,32,.72); }
.review-history h3 { margin: 0 0 10px; }
.review-history ol { margin: 0 0 0 19px; padding: 0; color: #9cb3c6; font-size: .75rem; line-height: 1.55; }
.review-history li + li { margin-top: 8px; }
.review-history p { margin: 3px 0 0; }
@media (max-width: 860px) {
  .artifact-grid { grid-template-columns: 1fr; }
  .artifact-detail-meta { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .artifact-badge { display: none; }
  .approval-summary { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 560px) {
  .artifact-toolbar { align-items: stretch; flex-direction: column; }
  .artifact-detail > header { flex-direction: column; }
  .artifact-detail-meta { grid-template-columns: 1fr; }
  .approval-actions button { flex: 1 1 120px; }
}
