/* =====================================================================
   SCREENS · shared app screens: sign-in, home, Ask Claude, demo menu
   ===================================================================== */

/* === SECTION: UTILITIES === */
.grow { flex: 1; min-width: 0; }
.stack-sm { display: flex; flex-direction: column; gap: var(--sp-2); }
.icon-wrap { display: inline-flex; }
.icon-wrap svg, .btn .icon { width: 18px; height: 18px; }
.is-disabled { opacity: .35; pointer-events: none; }
.chip {
  border: 1px solid var(--line);
  background: var(--bg-alt);
  color: var(--cream);
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-align: left;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.chip:hover:not([disabled]) { border-color: var(--accent); background: var(--circle); }
.chip[disabled] { opacity: .5; cursor: wait; }
/* === /SECTION: UTILITIES === */

/* === SECTION: SIGN-IN === */
.app-body.is-signed-out { display: block; padding-bottom: 0; }
.app-body.is-signed-out .app-main { max-width: none; padding: 0; }
.signin-brand { display: flex; align-items: center; min-height: 48px; }
.brand-logo-lg { height: 56px; width: auto; max-width: 280px; }
.brand-name-lg { font-size: 34px; font-weight: 800; letter-spacing: -0.04em; color: var(--white); }
.btn-ms { justify-content: center; }
.ms-logo { display: grid; grid-template-columns: 9px 9px; gap: 2px; }
.ms-logo i { width: 9px; height: 9px; display: block; }
.ms-logo i:nth-child(1) { background: #f25022; }
.ms-logo i:nth-child(2) { background: #7fba00; }
.ms-logo i:nth-child(3) { background: #00a4ef; }
.ms-logo i:nth-child(4) { background: #ffb900; }
.signin-demo {
  padding: var(--sp-4);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.signin-foot { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.role-grid { display: grid; gap: var(--sp-2); }
@media (min-width: 520px) { .role-grid-modal { grid-template-columns: 1fr 1fr; } }
.role-card {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-alt);
  color: var(--cream);
  text-align: left;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.role-card:hover { border-color: var(--accent); background: var(--circle); }
.role-card-text { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
.role-card-name { font-weight: 700; }
.role-card-role { font-size: var(--fs-xs); color: var(--accent); font-weight: 700; }
.role-card-desc { font-size: var(--fs-xs); color: var(--muted); }
.role-card-go { width: 18px; height: 18px; color: var(--muted); flex: none; }
.modal .role-card { background: var(--white); border-color: var(--surface-line); color: var(--ink); }
.modal .role-card:hover { background: #fff7f3; border-color: var(--accent); }
.modal .role-card.is-current { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.modal .role-card-role { color: var(--coral-deep); }
.modal .avatar { background: var(--card); color: var(--ink); }
.modal .avatar-accent { background: var(--accent); }
.modal .segmented { background: var(--surface-2); border-color: var(--surface-line); }
.modal .segmented button { color: var(--surface-sub); }
.modal .segmented button[aria-pressed="true"] { background: var(--ink); color: var(--cream); }
.segmented-wide { display: flex; width: 100%; }
.segmented-wide button { flex: 1; white-space: normal; }

.auth-sim { display: flex; flex-direction: column; align-items: center; gap: var(--sp-3); text-align: center; padding: var(--sp-4) 0; }
.auth-sim-icon {
  width: 76px; height: 76px; border-radius: 22px; display: grid; place-items: center;
  background: var(--ink); color: var(--cream);
}
.auth-sim-icon svg { width: 40px; height: 40px; }
.auth-sim.is-done .auth-sim-icon { background: var(--ok); }
.auth-sim-bar { width: 160px; height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.auth-sim-bar span { display: block; height: 100%; width: 40%; background: var(--accent); border-radius: 4px; animation: auth-bar 1.1s var(--ease) infinite; }
.auth-sim.is-done .auth-sim-bar span { width: 100%; animation: none; background: var(--ok); }
@keyframes auth-bar { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
/* === /SECTION: SIGN-IN === */

/* === SECTION: HOME === */
.home-grid { display: grid; gap: var(--sp-6); }
@media (min-width: 1100px) { .home-grid { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; } }
.summary-card {
  padding: var(--sp-5);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--circle), var(--bg-alt));
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.summary-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.summary-card .stat { background: rgba(12, 46, 48, .55); }
.agent-grid { display: grid; gap: var(--sp-3); grid-template-columns: 1fr; }
@media (min-width: 600px) { .agent-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .agent-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.agent-tile {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "icon head" "does does" "foot foot";
  gap: var(--sp-3);
  align-content: start;
  padding: var(--sp-4) var(--sp-4) var(--sp-3);
  border-radius: var(--radius);
  text-align: left;
  font: inherit;
  width: 100%;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), border-color .15s var(--ease);
}
.agent-tile.is-live {
  background: var(--card);
  color: var(--ink);
  border: 2px solid var(--accent);
  box-shadow: var(--shadow-1);
}
.agent-tile.is-live:hover { transform: translateY(-2px); color: var(--ink); box-shadow: var(--shadow-2); }
.agent-tile.is-soon {
  background: var(--bg-alt);
  color: var(--cream);
  border: 1px solid var(--line);
}
.agent-tile.is-soon:hover { border-color: var(--muted); }
.agent-icon {
  grid-area: icon;
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--circle);
  color: var(--accent);
}
.agent-icon svg { width: 22px; height: 22px; }
.agent-icon-sm { width: 36px; height: 36px; border-radius: 10px; background: var(--accent); color: var(--ink); }
.agent-icon-sm svg { width: 20px; height: 20px; }
.is-live .agent-icon { background: var(--ink); color: var(--accent); }
.agent-head { grid-area: head; display: flex; flex-direction: column; justify-content: center; min-width: 0; line-height: 1.25; }
.agent-name { font-weight: 800; font-size: var(--fs-lg); letter-spacing: -0.01em; }
.agent-sub { font-size: var(--fs-xs); font-weight: 600; color: var(--muted); }
.is-live .agent-sub { color: var(--sub); }
.agent-does { grid-area: does; font-size: var(--fs-sm); line-height: 1.45; color: var(--muted); }
.is-live .agent-does { color: var(--ink); }
.agent-foot { grid-area: foot; display: flex; align-items: center; justify-content: space-between; padding-top: var(--sp-2); border-top: 1px solid var(--line); }
.is-live .agent-foot { border-top-color: rgba(12, 46, 48, .15); }
.is-live .badge-ok { background: var(--ink); color: var(--ok-dark); }
.agent-go { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: var(--fs-sm); }
.agent-go svg { width: 18px; height: 18px; }
.is-soon .agent-go { color: var(--muted); }

.octopus-card { display: flex; flex-direction: column; gap: var(--sp-3); }
.octopus { margin: 0 calc(var(--sp-3) * -1); }
.octopus-svg { width: 100%; height: auto; overflow: visible; }
.oct-spoke { stroke: var(--line); stroke-width: 1.5; stroke-dasharray: 3 4; }
.oct-spoke.is-live { stroke: var(--accent); stroke-dasharray: none; stroke-width: 2; }
.oct-flow { fill: none; stroke: #2b5a5a; stroke-width: 1.5; }
.oct-flow.is-live { stroke: var(--accent); stroke-opacity: .7; stroke-width: 2; }
.oct-core { fill: var(--circle); stroke: var(--accent); stroke-width: 2; }
.oct-core-name { fill: var(--white); font-size: 12px; font-weight: 800; text-anchor: middle; font-family: var(--font); }
.oct-core-sub { fill: var(--muted); font-size: 8px; font-weight: 600; text-anchor: middle; font-family: var(--font); }
.oct-node > circle { fill: var(--bg); stroke: var(--line); stroke-width: 1.5; }
.oct-node svg { color: var(--muted); }
.oct-node.is-live > circle { fill: var(--accent); stroke: var(--accent); }
.oct-node.is-live svg { color: var(--ink); }
.oct-label { fill: var(--cream); font-size: 10px; font-weight: 700; text-anchor: middle; font-family: var(--font); }
.oct-node.is-live .oct-label { fill: var(--accent); }
.oct-node.is-preview > circle { fill: var(--bg); stroke: var(--accent); stroke-width: 2; stroke-dasharray: 4 3; }
.oct-node.is-preview svg { color: var(--accent); }

.flow-list { display: flex; flex-direction: column; gap: 2px; }
.flow {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: var(--fs-sm);
}
.flow-data { font-weight: 700; color: var(--white); }
.flow-path { color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.flow-from.is-live { color: var(--accent); font-weight: 700; }
.flow-arrow { width: 14px; height: 14px; }

.activity { display: flex; flex-direction: column; margin-top: var(--sp-3); }
.activity-item { display: flex; gap: var(--sp-3); padding: 10px 0; border-top: 1px solid var(--line); }
.activity-agent { width: 28px; height: 28px; flex: none; border-radius: 8px; display: grid; place-items: center; background: var(--circle); color: var(--accent); }
.activity-agent svg { width: 16px; height: 16px; }
.activity-body { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.activity-text { font-size: var(--fs-sm); }
.activity-meta { font-size: var(--fs-xs); color: var(--muted); }
.connect-list { display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-sm); }
/* === /SECTION: HOME === */

/* === SECTION: ASK CLAUDE === */
.chat-shell { max-width: 760px; display: flex; flex-direction: column; gap: var(--sp-4); }
.chat { display: flex; flex-direction: column; gap: var(--sp-3); }
.bubble {
  max-width: 92%;
  padding: 14px 16px;
  border-radius: 18px;
  line-height: 1.5;
  font-size: var(--fs-md);
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: toast-in .25s var(--ease);
}
.bubble p + p { margin-top: 4px; }
.bubble-who { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 700; opacity: .8; }
.bubble-who svg { width: 14px; height: 14px; }
.bubble-you { align-self: flex-end; background: var(--accent); color: var(--ink); border-bottom-right-radius: 6px; }
.bubble-claude { align-self: flex-start; background: var(--surface); color: var(--ink); border-bottom-left-radius: 6px; }
.bubble-claude .bubble-who { color: var(--coral-deep); opacity: 1; }
.bubble-claude .badge { margin-left: 4px; }
.chat-list { list-style: disc; padding-left: 20px; display: flex; flex-direction: column; gap: 2px; }
.chat-suggest { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.typing { display: inline-flex; gap: 4px; padding: 6px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--sub); animation: typing 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 60%, 100% { opacity: .25; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
/* === /SECTION: ASK CLAUDE === */
