/* Meikero — home hero: AI chat window ↔ MCP ↔ WordPress site (front page only). */

.hero-x--studio { padding: calc(65px + clamp(36px, 5vw, 64px)) 0 clamp(48px, 6vw, 80px); }
.hero-x--studio .hero-x__eyebrow { margin-bottom: 20px; }
.hs-head { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(28px, 4vw, 64px); align-items: end; margin-bottom: clamp(32px, 4vw, 48px); }
.hero-x--studio .hero-x__title { max-width: 14ch; margin-bottom: 0; font-size: clamp(2.8rem, 6vw, 5.4rem); }
.hs-head__side .hero-x__lead { margin-bottom: 22px; max-width: 44ch; font-size: clamp(1rem, 1.3vw, 1.12rem); }
.hs-head__side .actions { gap: 10px; }
.hs-clients { margin: 16px 0 0; font-size: .84rem; color: rgba(255,255,255,.48); max-width: 44ch; }
.hs-clients strong { color: #fff; font-weight: 600; }
.hs-note { margin: 14px 0 0; font-size: .8rem; color: rgba(255,255,255,.4); }
@media (max-width: 960px) { .hs-head { grid-template-columns: 1fr; align-items: start; } }

/* Layout: chat | bridge | site */
.duo { display: grid; grid-template-columns: minmax(330px, 420px) 76px minmax(0, 1fr); height: 660px; }
.win {
	display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden;
	border: 1px solid rgba(255,255,255,.12); border-radius: 12px;
	background: rgba(20,20,22,.86);
	-webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
	box-shadow: 0 50px 100px -40px rgba(0,0,0,.9), inset 0 1px 0 rgba(255,255,255,.06);
}
.win--site { background: #0f0f11; }
.win__bar { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 14px; border-bottom: 1px solid rgba(255,255,255,.08); font-family: var(--font-mono); font-size: .7rem; color: rgba(255,255,255,.6); }
.win__dots { display: inline-flex; gap: 6px; }
.win__dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.14); }
.win__app { display: inline-flex; align-items: center; gap: 6px; color: rgba(255,255,255,.75); white-space: nowrap; }
.win__app svg, .conn svg, .wpadmin__label svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.agent { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border: 1px solid rgba(255,255,255,.14); border-radius: 4px; color: #fff; font-family: var(--font-sans); font-size: .76rem; font-weight: 600; }
.agent__mark { width: 8px; height: 8px; border-radius: 2px; background: #fff; }
.conn { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; padding: 3px 8px; border-radius: 4px; background: rgba(110,231,160,.07); border: 1px solid rgba(110,231,160,.25); color: #a7f3c9; white-space: nowrap; }
.conn i { width: 5px; height: 5px; border-radius: 50%; background: #4ade80; }
.win__tab { max-width: 46%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 4px 10px; border-radius: 4px; background: rgba(255,255,255,.07); color: rgba(255,255,255,.82); transition: color .3s, background .3s; }
.win__tab.is-edited { color: #6ee7a0; background: rgba(110,231,160,.08); }
.win__addr { flex: 1; min-width: 0; padding: 4px 8px; border-radius: 4px; background: rgba(255,255,255,.04); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* Chat */
.chat { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 16px 10px; display: flex; flex-direction: column; gap: 14px; scrollbar-width: none; }
.chat::-webkit-scrollbar { display: none; }
.msg { animation: msg-in .35s ease-out; }
.msg.is-static { animation: none; }
.msg--user { align-self: flex-end; max-width: 86%; padding: 10px 13px; border-radius: 12px 12px 3px 12px; background: rgba(255,255,255,.1); color: #fff; font-size: .88rem; line-height: 1.45; }
.msg--ai { align-self: stretch; }
.msg__who { display: flex; align-items: center; gap: 7px; margin: 0 0 8px; font-family: var(--font-mono); font-size: .64rem; letter-spacing: .07em; text-transform: uppercase; color: rgba(255,255,255,.45); }
.msg__who::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: #fff; }
.msg__text { margin: 0; color: rgba(255,255,255,.86); font-size: .88rem; line-height: 1.55; }
.msg__text b { color: #fff; font-weight: 600; }
.msg__text.is-deny { color: #fca5a5; }
.msg--note { align-self: center; padding: 3px 10px; border: 1px dashed rgba(255,255,255,.18); border-radius: 4px; font-family: var(--font-mono); font-size: .64rem; color: rgba(255,255,255,.5); }
.thinking { display: inline-flex; gap: 4px; padding: 4px 0 8px; }
.thinking i { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,.5); animation: think 1s ease-in-out infinite; }
.thinking i:nth-child(2) { animation-delay: .15s; }
.thinking i:nth-child(3) { animation-delay: .3s; }

.tool { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 3px 10px; align-items: center; margin: 0 0 8px; padding: 9px 11px; border: 1px solid rgba(255,255,255,.1); border-radius: 8px; background: rgba(0,0,0,.35); font-family: var(--font-mono); font-size: .7rem; color: rgba(255,255,255,.8); }
.tool__ico { width: 14px; height: 14px; display: inline-flex; align-items: center; justify-content: center; font-size: .72rem; line-height: 1; }
.tool.is-running .tool__ico { border-radius: 50%; border: 1.5px solid rgba(255,255,255,.25); border-top-color: #fff; animation: spin .8s linear infinite; }
.tool.is-ok .tool__ico { color: #6ee7a0; }
.tool.is-deny .tool__ico { color: #f87171; }
.tool__name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tool__name b { color: #fff; font-weight: 500; }
.tool__res { white-space: nowrap; color: rgba(255,255,255,.4); }
.tool.is-ok .tool__res { color: #6ee7a0; }
.tool.is-deny { border-color: rgba(248,113,113,.35); }
.tool.is-deny .tool__res { color: #f87171; }
.tool__target { grid-column: 2 / 4; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: rgba(255,255,255,.42); }

/* Suggestions + composer */
.chat__suggest { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 14px 10px; }
.next { padding: 6px 10px; border: 1px solid rgba(255,255,255,.12); border-radius: 4px; background: rgba(255,255,255,.03); color: rgba(255,255,255,.78); font: inherit; font-size: .76rem; cursor: pointer; text-align: left; transition: border-color .2s, color .2s, background .2s; }
.next:hover { border-color: rgba(255,255,255,.32); color: #fff; background: rgba(255,255,255,.07); }
.next:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.next small { display: none; }

.composer { padding: 0 14px 14px; }
.cbx { position: relative; display: flex; align-items: center; gap: 8px; padding: 5px 5px 5px 14px; border: 1px solid rgba(255,255,255,.18); border-radius: 10px; background: rgba(0,0,0,.45); transition: border-color .2s, box-shadow .2s; }
.cbx:focus-within, .cbx.is-focus { border-color: rgba(255,255,255,.55); box-shadow: 0 0 0 4px rgba(255,255,255,.05); }
.cbx input { flex: 1; min-width: 0; padding: 9px 0; border: 0; outline: none; background: transparent; color: #fff; font: inherit; font-size: .92rem; }
.cbx input::placeholder { color: rgba(255,255,255,.38); }
.cbx__toggle { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: 0 0 auto; border: 0; border-radius: 7px; background: #fff; color: #0b0b0c; cursor: pointer; }
.cbx__toggle:hover { background: #e9e9e9; }
.cbx__toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .2s; }
.cbx.is-open .cbx__toggle svg { transform: rotate(180deg); }
.cbx__list {
	position: absolute; left: -1px; right: -1px; top: calc(100% + 6px); z-index: 30;
	max-height: 360px; overflow: auto; margin: 0; padding: 6px; list-style: none;
	border: 1px solid rgba(255,255,255,.14); border-radius: 10px; background: #141416;
	box-shadow: 0 24px 48px -12px rgba(0,0,0,.85);
	scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent;
}
.cbx--up .cbx__list { top: auto; bottom: calc(100% + 8px); }
.cbx__group { margin: 0; padding: 10px 8px 4px; font-family: var(--font-mono); font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.38); }
.cbx__opt { display: flex; align-items: center; gap: 10px; margin: 0; padding: 8px 10px; border-radius: 5px; cursor: pointer; color: rgba(255,255,255,.86); font-size: .86rem; }
.cbx__opt span { flex: 1; }
.cbx__opt small { font-family: var(--font-mono); font-size: .64rem; color: rgba(255,255,255,.35); white-space: nowrap; }
.cbx__opt i { width: 12px; font-style: normal; color: #6ee7a0; font-size: .75rem; }
.cbx__opt[aria-selected="true"] { background: #fff; color: #0b0b0c; }
.cbx__opt[aria-selected="true"] small { color: #5a5a5f; }
.cbx__opt[aria-selected="true"] i { color: #15803d; }
.cbx__opt.is-picked { animation: cbx-pick .45s ease-out; }
.cbx__empty { margin: 0; padding: 12px 10px; color: rgba(255,255,255,.45); font-size: .85rem; }
.composer__meta { margin: 8px 2px 0; font-family: var(--font-mono); font-size: .64rem; color: rgba(255,255,255,.38); }

/* MCP bridge */
.bridge { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 0 6px; }
.bridge .hx-link { flex: none; width: 100%; min-width: 0; background: linear-gradient(90deg, rgba(255,255,255,.15), rgba(255,255,255,.45), rgba(255,255,255,.15)); }
.bridge__label { padding: 3px 8px; border: 1px solid rgba(255,255,255,.22); border-radius: 4px; background: var(--night, #0b0b0c); font-family: var(--font-mono); font-size: .66rem; letter-spacing: .12em; color: #fff; }
.bridge__sub { font-family: var(--font-mono); font-size: .6rem; color: rgba(255,255,255,.42); }

/* Site */
.studio__view { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.studio__view::after { content: ""; position: absolute; left: 0; right: 0; top: -30%; height: 30%; pointer-events: none; opacity: 0; z-index: 5;
	background: linear-gradient(180deg, transparent, rgba(110,231,160,.14) 70%, rgba(110,231,160,.5) 100%); }
.studio__view.is-updating::after { animation: hb-scan .8s cubic-bezier(.45,0,.2,1); }
.studio__view.is-blocked::after { background: linear-gradient(180deg, transparent, rgba(248,113,113,.12) 70%, rgba(248,113,113,.45) 100%); animation: hb-scan-half .7s ease-out; }
.hb-state { display: inline-flex; align-items: center; gap: 5px; padding: 2px 7px; border-radius: 4px; font-size: .62rem; border: 1px solid; white-space: nowrap; }
.hb-state::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.hb-state[data-state="live"] { color: #6ee7a0; border-color: rgba(110,231,160,.35); background: rgba(110,231,160,.06); }
.hb-state[data-state="busy"] { color: #fbbf24; border-color: rgba(251,191,36,.4); background: rgba(251,191,36,.07); }
.hb-state[data-state="busy"]::before { animation: hx-blink .8s steps(1) infinite; }
.hb-state[data-state="blocked"] { color: #f87171; border-color: rgba(248,113,113,.4); background: rgba(248,113,113,.07); }
.hb-toast { position: absolute; right: 14px; bottom: 14px; z-index: 6; padding: 8px 12px; border-radius: 6px; font-family: var(--font-mono); font-size: .7rem; color: #fff; background: rgba(11,11,12,.88); border: 1px solid rgba(255,255,255,.14); opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .3s; pointer-events: none; }
.hb-toast.is-on { opacity: 1; transform: none; }

/* WordPress admin permissions strip */
.wpadmin { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-top: 1px solid rgba(255,255,255,.08); background: #141416; }
.wpadmin__label { display: inline-flex; align-items: center; gap: 7px; margin: 0; font-family: var(--font-mono); font-size: .64rem; letter-spacing: .04em; color: rgba(255,255,255,.5); white-space: nowrap; }
.perms { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; flex: 1; }
.perm { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 9px; border: 1px solid rgba(255,255,255,.08); border-radius: 4px; background: rgba(255,255,255,.02); color: rgba(255,255,255,.86); font: inherit; font-size: .75rem; cursor: pointer; text-align: left; }
.perm span:first-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.perm:hover { border-color: rgba(255,255,255,.22); }
.perm:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.perm .hx-toggle { width: 26px; height: 16px; }
.perm .hx-toggle::after { width: 10px; height: 10px; }
.perm[aria-checked="true"] .hx-toggle { background: #16a34a; }
.perm[aria-checked="true"] .hx-toggle::after { transform: translateX(10px); }
.perm[aria-checked="false"] { color: rgba(255,255,255,.45); border-color: rgba(248,113,113,.3); }
.perm.is-denied { animation: hx-deny .9s ease-out; }

@media (max-width: 1200px) { .wpadmin__label { display: none; } }
@media (max-width: 1080px) {
	.duo { grid-template-columns: 1fr; height: auto; }
	.win--chat { height: 470px; }
	.win--site { height: 560px; }
	.bridge { flex-direction: row; height: 64px; }
	.bridge .hx-link { width: 56px; transform: rotate(90deg); }
}
@media (max-width: 640px) {
	.perms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.agent { display: none; }
	.win--site { height: 600px; }
}

@keyframes hb-scan { 0% { top: -30%; opacity: 1; } 100% { top: 100%; opacity: 1; } }
@keyframes hb-scan-half { 0% { top: -30%; opacity: 1; } 60% { top: 20%; opacity: 1; } 100% { top: 20%; opacity: 0; } }
@keyframes hb-edit { 0% { box-shadow: 0 0 0 2px rgba(110,231,160,.85); } 100% { box-shadow: 0 0 0 2px rgba(110,231,160,0); } }
@keyframes cbx-pick { 0% { background: #6ee7a0; color: #04130a; } 100% { background: #fff; } }
@keyframes pv-in { to { opacity: 1; transform: none; } }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes think { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-2px); } }

@media (prefers-reduced-motion: reduce) {
	.studio__view::after, .cbx__opt.is-picked, .perm.is-denied, .msg, .thinking i { animation: none !important; }
	.tool.is-running .tool__ico { animation: none; }
}
