/* AgentHub (hub.agenthub.fi) — warm amber palette, modern UI */
:root {
  --bg: #faf6ee;
  --bg-2: #f3ead8;
  --paper: #fffdf8;
  --ink: #1c1d11;
  --ink-2: #4a4b3c;
  --muted: #7d7b6a;
  --line: rgba(28, 29, 17, .09);
  --line-2: rgba(28, 29, 17, .16);

  --amber: #b86b15;
  --amber-2: #e0a04a;
  --amber-soft: #f6e3c4;
  --forest: #4f6041;
  --forest-soft: #e2e8d6;
  --dusk: #2a3958;
  --dusk-soft: #dfe4ef;
  --clay: #b5523b;
  --clay-soft: #f4ddd5;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --shadow: 0 1px 2px rgba(28, 29, 17, .05), 0 8px 24px -8px rgba(28, 29, 17, .12);
  --shadow-lg: 0 2px 4px rgba(28, 29, 17, .04), 0 24px 60px -20px rgba(42, 57, 88, .28);

  --sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --mono: "Geist Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(224, 160, 74, .22), transparent 60%),
    radial-gradient(700px 500px at -10% 30%, rgba(79, 96, 65, .10), transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
em { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--amber); letter-spacing: 0; }

.glass {
  background: rgba(255, 253, 248, .72);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, .7);
  box-shadow: var(--shadow);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  border: 0; cursor: pointer; text-decoration: none;
  font-weight: 600; border-radius: 999px;
  padding: .95rem 1.6rem; font-size: 1.02rem;
  transition: transform .15s ease, box-shadow .2s ease, background .2s;
}
.btn:focus-visible, .tab:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.btn--primary {
  color: #fffaf0;
  background: linear-gradient(180deg, #c97a22, var(--amber));
  box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 10px 24px -10px rgba(184, 107, 21, .8);
}
.btn--primary:hover { transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 14px 30px -10px rgba(184, 107, 21, .9); }
.btn--ghost { background: var(--paper); border: 1px solid var(--line-2); }
.btn--ghost:hover { background: #fff; }
.btn--link { background: none; padding-inline: .4rem; color: var(--ink-2); }
.btn--link:hover { color: var(--ink); }
.btn--sm { padding: .55rem 1.05rem; font-size: .92rem; }
.btn--xs { padding: .3rem .75rem; font-size: .8rem; font-weight: 500; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 2rem;
  padding: .9rem clamp(1.25rem, 4vw, 3.5rem);
  background: rgba(250, 246, 238, .75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; font-weight: 700; font-size: 1.15rem; letter-spacing: -.02em; }
.brand__tld { color: var(--amber); }
.nav__links { display: flex; gap: 1.6rem; margin-left: auto; font-size: .95rem; }
.nav__links a { text-decoration: none; color: var(--ink-2); }
.nav__links a:hover { color: var(--ink); }

/* ---------- hero ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(2rem, 5vw, 5rem); align-items: center;
  max-width: 1320px; margin: 0 auto;
  padding: clamp(3rem, 8vw, 6.5rem) clamp(1.25rem, 4vw, 3.5rem) clamp(3rem, 6vw, 5rem);
}
.eyebrow {
  display: inline-flex; align-items: center; gap: .55rem;
  margin: 0 0 1.25rem; font-family: var(--mono); font-size: .78rem;
  letter-spacing: .06em; text-transform: uppercase; color: var(--forest);
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--forest); box-shadow: 0 0 0 4px rgba(79,96,65,.15); }
h1 {
  margin: 0; font-size: clamp(2.7rem, 6vw, 5.1rem); line-height: 1.02;
  letter-spacing: -.045em; font-weight: 600;
}
h1 em { font-size: 1.08em; letter-spacing: -.02em; }
.lead { font-size: clamp(1.05rem, 1.4vw, 1.22rem); color: var(--ink-2); max-width: 36rem; margin: 1.6rem 0 2rem; }

.fineprint { margin: 1.1rem 0 0; font-size: .88rem; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* hero: tavoitekenttä */
.command {
  display: flex; align-items: center; gap: .6rem; max-width: 36rem;
  padding: 8px 8px 8px 10px; border-radius: var(--r-lg);
  background: rgba(255, 253, 248, .9); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg);
  transition: border-color .2s, box-shadow .2s;
}
.command:focus-within { border-color: var(--amber); box-shadow: 0 0 0 4px rgba(184,107,21,.14), var(--shadow-lg); }
.command__avatar { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; object-position: center 15%; background: var(--amber-soft); flex: none; }
.command input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: 1.05rem; color: var(--ink); padding: .6rem .2rem; }
.command input:focus { outline: none; }
.command .btn { flex: none; white-space: nowrap; border-radius: 12px; }
.examples { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .5rem; margin-top: 1rem; max-width: 36rem; font-size: .86rem; }
.example {
  border: 1px dashed var(--line-2); background: transparent; border-radius: 10px;
  padding: .35rem .7rem; cursor: pointer; color: var(--ink-2); font-size: .84rem; text-align: left;
  transition: border-color .15s, background .15s, color .15s;
}
.example:hover { border-style: solid; border-color: var(--amber); color: #7a4408; }
.example.is-active { border-style: solid; border-color: rgba(184,107,21,.4); background: var(--amber-soft); color: #7a4408; }
.example:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* hero: tiimitaulu. Ainon brief ylhäällä, agenttikortit lomitettuina alla. */
.hub { width: 100%; max-width: 560px; margin: 0 auto; }
.brief {
  display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center;
  padding: .85rem 1rem .85rem .85rem; border-radius: var(--r-lg); margin-bottom: 1rem;
  position: relative; z-index: 2;
}
.brief__img { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; object-position: center 15%; background: var(--amber-soft); }
.brief__body { min-width: 0; display: flex; flex-direction: column; gap: .2rem; }
.brief__label { font-family: var(--mono); font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.brief__body strong { font-size: 1rem; font-weight: 600; line-height: 1.3; }
.brief__bar { height: 5px; margin-top: .3rem; border-radius: 99px; background: rgba(28,29,17,.08); overflow: hidden; }
.brief__bar i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--forest), #7b8f62); border-radius: inherit; transition: width .6s ease; }
.brief__now { display: flex; align-items: center; gap: .45rem; min-height: 1.5rem; margin-top: .25rem; font-size: .78rem; color: var(--ink-2); }
.brief__now img, .brief__now .ini { width: 20px; height: 20px; border-radius: 6px; object-fit: cover; object-position: center 15%; flex: none; }
.brief__now .ini { display: grid; place-items: center; background: var(--dusk); color: #fff; font-size: .55rem; font-weight: 700; border-radius: 50%; }
.brief__now strong { font-size: inherit; font-weight: 600; }
.brief__now .txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brief__now .status { font-size: .64rem; padding: .14rem .42rem; }
.brief__side { display: flex; flex-direction: column; align-items: flex-end; gap: .6rem; align-self: stretch; justify-content: space-between; }
.brief__pct { font-family: var(--mono); font-size: .85rem; color: var(--forest); }
.brief__me {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--dusk); color: #fff; font-size: .66rem; font-weight: 700;
  box-shadow: 0 0 0 3px var(--paper); transition: box-shadow .3s;
}
.brief.is-waiting .brief__me { box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px rgba(42,57,88,.45); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.1); } }

.crew { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; padding-bottom: 1.5rem; }
.crew .mate:nth-child(3n + 2) { transform: translateY(1.5rem); }
.mate {
  position: relative; margin: 0; padding: 6px; border-radius: var(--r-lg);
  background: var(--paper); box-shadow: var(--shadow);
  transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s;
}
.mate__img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center 20%; border-radius: 11px; background: var(--amber-soft); }
.mate__name {
  position: absolute; left: 12px; bottom: 12px; padding: .3rem .55rem; border-radius: 9px;
  font-size: .76rem; font-weight: 600; line-height: 1.2;
  background: rgba(255, 253, 248, .78); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.mate__name small { display: block; font-weight: 400; font-size: .66rem; color: var(--ink-2); }
.mate__status { position: absolute; top: 12px; right: 12px; opacity: 0; transform: translateY(-3px); transition: opacity .25s, transform .25s; }
.mate__status.is-on { opacity: 1; transform: none; }
.mate__status .status { font-size: .64rem; padding: .16rem .45rem; box-shadow: 0 2px 8px rgba(28,29,17,.12); }
.mate__task {
  position: absolute; left: 6px; right: 6px; bottom: 6px; padding: .55rem .6rem; border-radius: 0 0 11px 11px;
  font-size: .72rem; line-height: 1.3; font-weight: 500; color: var(--ink);
  background: linear-gradient(180deg, rgba(255,253,248,0), rgba(255,253,248,.92) 30%);
  opacity: 0; transition: opacity .3s;
}
.mate.is-working .mate__task { opacity: 1; }
.mate.is-working .mate__name { opacity: 0; }
.mate.is-working { box-shadow: 0 0 0 2px var(--amber), 0 18px 40px -16px rgba(184,107,21,.55); }
.crew .mate.is-working { transform: translateY(-6px); }
.crew .mate.is-working:nth-child(3n + 2) { transform: translateY(calc(1.5rem - 6px)); }
.mate.is-waiting { box-shadow: 0 0 0 2px var(--dusk), var(--shadow); }

/* ---------- sections ---------- */
section { scroll-margin-top: 70px; }
.section-head { max-width: 46rem; margin: 0 auto 2.5rem; text-align: center; }
.section-head .eyebrow { justify-content: center; }
h2 { margin: 0; font-size: clamp(2rem, 3.6vw, 3rem); line-height: 1.08; letter-spacing: -.035em; font-weight: 600; }
.section-head .muted { margin-top: 1rem; }
.demo, .how, .team { max-width: 1320px; margin: 0 auto; padding: clamp(3rem, 7vw, 6rem) clamp(1rem, 3vw, 3rem); }

/* ---------- app mock ---------- */
.app { border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--shadow-lg); background: rgba(255,253,248,.85); }
.app__bar {
  display: flex; align-items: center; gap: 1rem; padding: .7rem 1rem;
  border-bottom: 1px solid var(--line); background: rgba(243, 234, 216, .55);
}
.app__dots { display: flex; gap: 6px; }
.app__dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.app__title { display: flex; align-items: center; gap: .5rem; font-weight: 600; font-size: .92rem; white-space: nowrap; }
.tabs { display: flex; gap: .25rem; margin-left: auto; background: rgba(28,29,17,.05); padding: 3px; border-radius: 10px; }
.tab { border: 0; background: none; cursor: pointer; padding: .38rem .8rem; border-radius: 8px; font-size: .86rem; color: var(--ink-2); display: inline-flex; gap: .4rem; align-items: center; }
.tab.is-active { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(28,29,17,.1); }
.badge { font-family: var(--mono); font-size: .7rem; background: var(--clay); color: #fff; border-radius: 999px; padding: 0 .45rem; line-height: 1.4; }

.app__body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; height: 640px; }
.app__main { overflow: auto; padding: 1.1rem 1.25rem 1.5rem; }

/* board */
.group { margin-bottom: 1.6rem; }
.group__head { display: flex; align-items: baseline; gap: .75rem; margin: 0 0 .6rem; flex-wrap: wrap; }
.group__head h3 { margin: 0; font-size: 1.02rem; letter-spacing: -.01em; }
.group__meta { font-family: var(--mono); font-size: .74rem; color: var(--muted); }
.progress { flex: 0 0 120px; height: 6px; border-radius: 99px; background: rgba(28,29,17,.08); overflow: hidden; align-self: center; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--forest), #7b8f62); border-radius: inherit; transition: width .6s ease; }

.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .88rem; }
.table th {
  text-align: left; font-weight: 500; color: var(--muted); font-size: .74rem;
  font-family: var(--mono); text-transform: uppercase; letter-spacing: .04em;
  padding: .45rem .6rem; border-bottom: 1px solid var(--line);
}
.table td { padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; background: var(--paper); }
.table tr.row { cursor: pointer; transition: background .2s; }
.table tr.row:hover td { background: #fff; }
.table td:first-child { border-left: 3px solid var(--group, var(--amber)); }
.table .phase-row td { background: transparent; font-family: var(--mono); font-size: .72rem; color: var(--muted); padding-top: .8rem; border-left-color: transparent; }
.task-title { font-weight: 500; }
.task-title small { display: block; color: var(--muted); font-weight: 400; font-size: .76rem; }
.col-who { width: 190px; }
.col-status { width: 168px; }
.col-due { width: 72px; font-family: var(--mono); font-size: .78rem; color: var(--ink-2); }

.who { display: flex; align-items: center; gap: .5rem; white-space: nowrap; }
.who__name { font-size: .84rem; }
.who__role { display: block; font-size: .72rem; color: var(--muted); }
.avatar {
  width: 26px; height: 26px; border-radius: 8px; object-fit: cover; object-position: center 15%;
  background: var(--amber-soft); flex: none;
}
.avatar--md { width: 38px; height: 38px; border-radius: 11px; }
.avatar--lg { width: 56px; height: 56px; border-radius: 14px; }
.avatar--human {
  display: grid; place-items: center; font-size: .72rem; font-weight: 700;
  background: var(--dusk); color: #fff; border-radius: 50%;
}

.status {
  display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap;
  font-size: .78rem; font-weight: 500; padding: .28rem .6rem; border-radius: 8px;
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.s-unassigned { background: var(--clay-soft); color: var(--clay); }
.s-queued { background: rgba(28,29,17,.06); color: var(--ink-2); }
.s-working { background: linear-gradient(90deg, var(--amber-soft), #fbefd9, var(--amber-soft)); background-size: 200% 100%; color: #7a4408; animation: shimmer 1.8s linear infinite; }
.s-review { background: var(--dusk-soft); color: var(--dusk); }
.s-done { background: var(--forest-soft); color: var(--forest); }
.s-blocked { background: var(--clay-soft); color: var(--clay); }

.inline-actions { display: inline-flex; gap: .3rem; margin-left: .35rem; }
.mini {
  border: 1px solid var(--line-2); background: var(--paper); border-radius: 7px;
  font-size: .74rem; padding: .2rem .5rem; cursor: pointer;
}
.mini:hover { background: #fff; border-color: var(--ink-2); }
.mini--go { background: var(--forest); border-color: var(--forest); color: #fff; }
.mini--go:hover { background: #3f4f33; border-color: #3f4f33; }

tr.row.is-working td { background: #fffaf0; }
tr.row.flash td { animation: flash 1.2s ease; }
@keyframes flash { from { background: var(--amber-soft); } }

.result-row td { background: #fffcf5 !important; padding: .8rem 1rem 1rem 1.2rem; }
.result { display: flex; gap: 1rem; align-items: flex-start; }
.result__body { font-size: .88rem; color: var(--ink-2); white-space: pre-line; flex: 1; }
.result__meta { font-family: var(--mono); font-size: .72rem; color: var(--muted); margin-top: .5rem; }
.visual {
  flex: none; width: 170px; aspect-ratio: 4 / 5; border-radius: var(--r);
  padding: 14px; display: flex; flex-direction: column; justify-content: flex-end;
  color: #fffaf0; font-family: var(--serif); font-size: 1.35rem; line-height: 1.05;
  background:
    radial-gradient(circle at 75% 25%, var(--amber-2) 0 18%, transparent 19%),
    linear-gradient(170deg, var(--dusk) 0%, #4c4a5c 45%, var(--amber) 100%);
}
.visual small { font-family: var(--mono); font-size: .62rem; opacity: .8; margin-top: .4rem; }

.empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; border: 1.5px dashed var(--line-2); border-radius: var(--r-lg); }

/* agent working overlay */
.agent-pop {
  position: absolute; z-index: 5; pointer-events: none;
  display: flex; align-items: center; gap: .65rem;
  padding: 6px 12px 6px 6px; border-radius: var(--r);
  background: rgba(255,253,248,.9); border: 1.5px solid rgba(184,107,21,.45);
  box-shadow: var(--shadow-lg); font-size: .86rem; white-space: nowrap;
  transition: top .4s ease, opacity .3s; backdrop-filter: blur(10px);
}
.agent-pop img { width: 36px; height: 36px; border-radius: 9px; object-fit: cover; object-position: center 15%; }
.agent-pop .working-chip__state { font-size: .72rem; }
.app__main { position: relative; }

/* overview */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; margin-bottom: 1.4rem; }
.kpi { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: .9rem 1rem; }
.kpi__label { font-size: .76rem; color: var(--muted); }
.kpi__value { font-size: 1.6rem; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi__value small { font-size: .8rem; font-weight: 400; color: var(--muted); }
.kpi--alert { border-color: rgba(181,82,59,.35); background: #fff8f5; }
.ov-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 1rem; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1rem 1.1rem; }
.panel h4 { margin: 0 0 .75rem; font-size: .9rem; }
.panel + .panel { margin-top: 1rem; }
.decision { display: flex; align-items: center; gap: .6rem; padding: .55rem 0; border-top: 1px solid var(--line); font-size: .86rem; }
.decision:first-of-type { border-top: 0; }
.decision__text { flex: 1; }
.decision__text small { display: block; color: var(--muted); font-size: .74rem; }
.proj { padding: .55rem 0; border-top: 1px solid var(--line); font-size: .86rem; }
.proj:first-of-type { border-top: 0; }
.proj__head { display: flex; justify-content: space-between; gap: .5rem; }
.proj__phases { display: flex; gap: 4px; margin-top: .45rem; }
.proj__phases span { flex: 1; height: 6px; border-radius: 99px; background: rgba(28,29,17,.08); position: relative; overflow: hidden; }
.proj__phases span > i { position: absolute; inset: 0 auto 0 0; background: var(--forest); border-radius: inherit; }
.proj__meta { font-family: var(--mono); font-size: .72rem; color: var(--muted); margin-top: .35rem; }
.log { list-style: none; margin: 0; padding: 0; font-size: .8rem; max-height: 300px; overflow: auto; }
.log li { display: grid; grid-template-columns: 48px 1fr; gap: .5rem; padding: .35rem 0; border-top: 1px solid var(--line); }
.log li:first-child { border-top: 0; }
.log time { font-family: var(--mono); color: var(--muted); font-size: .72rem; padding-top: .1rem; }

/* team view */
.members { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .75rem; }
.member { display: flex; gap: .75rem; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: .75rem; }
.member__info { flex: 1; min-width: 0; font-size: .84rem; }
.member__info strong { display: block; font-size: .92rem; }
.quota { margin-top: .35rem; height: 5px; border-radius: 99px; background: rgba(28,29,17,.08); overflow: hidden; }
.quota > i { display: block; height: 100%; background: var(--amber); }
.member__q { font-family: var(--mono); font-size: .7rem; color: var(--muted); margin-top: .2rem; }
.member.is-cooldown { background: #f7f4ee; }
.member.is-cooldown .avatar { filter: grayscale(.9) opacity(.7); }
.tag { display: inline-block; font-family: var(--mono); font-size: .66rem; padding: .1rem .4rem; border-radius: 6px; background: var(--dusk-soft); color: var(--dusk); }
.tag--warn { background: var(--clay-soft); color: var(--clay); }

/* chat */
.chat { display: flex; flex-direction: column; border-left: 1px solid var(--line); background: rgba(250, 246, 238, .6); min-height: 0; }
.chat__head { display: flex; align-items: center; gap: .7rem; padding: .85rem 1rem; border-bottom: 1px solid var(--line); font-size: .9rem; }
.chat__head strong { display: block; }
.chat__head .muted { font-size: .78rem; }
.status-dot { margin-left: auto; width: 9px; height: 9px; border-radius: 50%; background: #6b9a4e; box-shadow: 0 0 0 3px rgba(107,154,78,.2); }
.chat__log { flex: 1; overflow: auto; padding: 1rem; display: flex; flex-direction: column; gap: .6rem; }
.msg { max-width: 88%; padding: .6rem .8rem; border-radius: 14px; font-size: .88rem; line-height: 1.45; animation: pop .25s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(4px); } }
.msg--agent { background: var(--paper); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg--user { align-self: flex-end; background: var(--ink); color: #fbf6ea; border-bottom-right-radius: 4px; }
.msg--system { align-self: center; max-width: 100%; font-family: var(--mono); font-size: .72rem; color: var(--muted); background: none; padding: .1rem; }
.msg ul { margin: .4rem 0 0; padding-left: 1.1rem; }
.msg li { margin: .1rem 0; }
.msg .actions { display: flex; gap: .4rem; margin-top: .6rem; flex-wrap: wrap; }
.msg--typing { display: inline-flex; gap: 4px; width: fit-content; }
.msg--typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: bounce 1s infinite; }
.msg--typing i:nth-child(2) { animation-delay: .15s; }
.msg--typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 50% { transform: translateY(-4px); opacity: .5; } }
.chat__suggest { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0 1rem .6rem; }
.chip { border: 1px solid var(--line-2); background: var(--paper); border-radius: 999px; padding: .3rem .7rem; font-size: .78rem; cursor: pointer; text-align: left; }
.chip:hover { border-color: var(--amber); color: #7a4408; }
.chat__form { display: flex; gap: .5rem; padding: .75rem; border-top: 1px solid var(--line); }
.chat__form input {
  flex: 1; min-width: 0; border: 1px solid var(--line-2); background: var(--paper);
  border-radius: 12px; padding: .7rem .85rem; font: inherit; font-size: .9rem; color: var(--ink);
}
.chat__form input:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(184,107,21,.15); }
.send { width: 42px; border: 0; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 700; cursor: pointer; font-size: 1.05rem; }
.send:disabled { opacity: .4; cursor: default; }

/* ---------- how ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.step { border-radius: var(--r-xl); padding: 1.6rem; }
.step__n { font-family: var(--mono); font-size: .8rem; color: var(--amber); }
.step h3 { margin: .6rem 0 .5rem; font-size: 1.25rem; letter-spacing: -.02em; }
.step p { margin: 0; color: var(--ink-2); }
.principles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.principle h4 { margin: 0 0 .4rem; font-size: 1rem; }
.principle p { margin: 0; color: var(--ink-2); font-size: .92rem; }

/* ---------- team ---------- */
.team__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem; }
@media (min-width: 1100px) { .team__grid { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.tcard { background: var(--paper); border-radius: var(--r-lg); padding: 8px; box-shadow: var(--shadow); transition: transform .2s; }
.tcard:hover { transform: translateY(-3px); }
.tcard img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; background: var(--amber-soft); }
.tcard__body { padding: .65rem .4rem .35rem; }
.tcard__body strong { display: block; }
.tcard__body span { font-size: .84rem; color: var(--muted); }
.tcard__tools { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .45rem; }
.tcard__tools .tag { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- closing ---------- */
.closing {
  max-width: 1100px; margin: 2rem auto 4rem; padding: clamp(2.5rem, 6vw, 4.5rem) 1.5rem;
  border-radius: var(--r-xl); text-align: center;
  background:
    radial-gradient(600px 240px at 50% 0%, rgba(224,160,74,.35), transparent 70%),
    rgba(255,253,248,.7);
}
.closing p { color: var(--ink-2); max-width: 34rem; margin: 1rem auto 1.8rem; }

.footer { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1.5rem clamp(1.25rem, 4vw, 3.5rem); border-top: 1px solid var(--line); font-size: .85rem; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .app__body { grid-template-columns: 1fr; height: auto; }
  .app__main { max-height: 560px; }
  .chat { border-left: 0; border-top: 1px solid var(--line); height: 460px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .ov-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hub { max-width: 520px; }
  .steps, .principles { grid-template-columns: 1fr 1fr; }
  .nav__links { display: none; }
  .nav .btn { margin-left: auto; }
}
@media (max-width: 640px) {
  .command .btn { padding-inline: .8rem; }
  .command__avatar { display: none; }
  .crew { gap: .5rem; }
  .crew .mate:nth-child(3n + 2) { transform: translateY(.9rem); }
  .crew .mate.is-working:nth-child(3n + 2) { transform: translateY(calc(.9rem - 6px)); }
  .mate { padding: 4px; }
  .mate__name { left: 8px; bottom: 8px; font-size: .68rem; }
  .mate__name small { display: none; }
  .mate__task { font-size: .62rem; padding: .4rem .45rem; }
  .mate__status { top: 8px; right: 8px; }
  .mate__status .status { font-size: .56rem; padding: .12rem .35rem; }
  .brief__img { width: 48px; height: 48px; }
  .steps, .principles { grid-template-columns: 1fr; }
  .app__title .muted, .app__dots { display: none; }
  .app__bar { flex-wrap: wrap; }
  .app__bar .btn--xs { margin-left: auto; }
  .tabs { order: 3; width: 100%; margin-left: 0; }
  .tab { flex: 1; justify-content: center; }
  .col-due, .table th.col-due { display: none; }
  .col-who { width: auto; }
  .who__role { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
