@import url("https://fonts.googleapis.com/css2?family=Radio+Canada+Big:wght@400;500;600;700&display=swap");

:root {
  color-scheme: light;
  --bg: #f6f5f4;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-solid: #ffffff;
  --panel-soft: #f1f0ef;
  --control: #f0efed;
  --line: rgba(17, 17, 17, 0.07);
  --line-2: rgba(17, 17, 17, 0.12);
  --text: #0a0c11;
  --muted: #807d78;
  --faint: #a19d96;
  --green: #009b6d;
  --green-2: #12d49a;
  --green-3: #75ffd6;
  --mint: #e4faf2;
  --blue: #4f64ff;
  --blue-soft: #eef1ff;
  --orange: #e7ac27;
  --orange-soft: #fff4db;
  --red: #ef4444;
  --red-soft: #fff0f0;
  --lavender: #7667ff;
  --lavender-soft: #f0edff;
  --sky: #42a8f8;
  --sky-soft: #eaf6ff;
  --pink: #f032d2;
  --pink-soft: #ffe8fa;
  --cyan: #11b8d8;
  --cyan-soft: #e7fbff;
  --amber: #f5b33f;
  --amber-soft: #fff5df;
  --accent: var(--green);
  --accent-2: var(--green-2);
  --accent-soft: var(--mint);
  --ink: #111111;
  --ink-2: #2c2c2c;
  --shadow: 0 1px 1px rgba(0, 0, 0, 0.035), 0 18px 40px rgba(0, 0, 0, 0.055);
  --shadow-soft: 0 1px 1px rgba(0, 0, 0, 0.035), 0 8px 22px rgba(0, 0, 0, 0.045);
  --shadow-control: 0 1px 1px rgba(0, 0, 0, 0.035), 0 8px 18px rgba(0, 0, 0, 0.05), inset 0 -2px 3px rgba(0, 0, 0, 0.045);
  --shadow-lift: 0 1px 1px rgba(0, 0, 0, 0.04), 0 28px 58px rgba(0, 0, 0, 0.095);
  --radius: 34px;
  --radius-card: 28px;
  --ease: 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  height: auto;
  min-height: 100%;
  overflow-y: scroll;
  background: var(--bg);
}

body {
  margin: 0;
  height: auto;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: visible;
  color: var(--text);
  background: #f7f6f4;
  font-family: "Radio Canada Big", -apple-system, BlinkMacSystemFont, "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv02", "cv03", "cv04", "liga";
}

body[data-page="dialogue"] {
  --accent: #009b6d;
  --accent-2: #12d49a;
  --accent-soft: #e4faf2;
}

body[data-page="miniapps"] {
  --accent: #7667ff;
  --accent-2: #42a8f8;
  --accent-soft: #f0edff;
}

body[data-page="skills"] {
  --accent: #11b8d8;
  --accent-2: #75ffd6;
  --accent-soft: #e7fbff;
}

body[data-page="activity"] {
  --accent: #4f64ff;
  --accent-2: #42a8f8;
  --accent-soft: #eef1ff;
}

body[data-page="memory"] {
  --accent: #00a874;
  --accent-2: #12d49a;
  --accent-soft: #e4faf2;
}

body[data-page="data"] {
  --accent: #0ea5e9;
  --accent-2: #11b8d8;
  --accent-soft: #eaf6ff;
}

body[data-page="settings"] {
  --accent: #f032d2;
  --accent-2: #7667ff;
  --accent-soft: #ffe8fa;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(0, 201, 139, 0.24);
  outline-offset: 2px;
}

button:active {
  transform: translateY(1px) scale(0.99);
}

svg.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#app {
  width: min(100%, 1740px);
  height: auto;
  min-height: 100dvh;
  margin-inline: auto;
  padding: 18px 24px clamp(420px, 42vh, 760px);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(220px, 340px);
  align-items: center;
  gap: 12px;
  margin: -10px 0 22px;
  padding: 14px 0 10px;
  border: 0;
  border-radius: 0;
  background: rgba(247, 246, 244, 0.86);
  box-shadow: none;
  backdrop-filter: blur(18px) saturate(1.22);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.logo-button {
  position: relative;
  min-height: 44px;
  padding: 0 4px;
  color: #006f5b;
  background: transparent;
  font-size: clamp(28px, 1.9vw, 37px);
  font-family: "Radio Canada Big", sans-serif;
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: 0;
}

.logo-button span span {
  position: relative;
  color: var(--green-2);
}

.logo-button span span::before {
  content: "";
  position: absolute;
  top: -8px;
  right: -2px;
  width: 10px;
  height: 10px;
  border-radius: 99px;
  background: var(--green-2);
  box-shadow: 0 0 0 6px rgba(0, 201, 139, 0.14);
}

.crumb {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  font-family: "Radio Canada Big", sans-serif;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main-nav {
  display: flex;
  justify-content: flex-start;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  width: 100%;
  max-width: 100%;
  margin-inline: 0;
  padding: 6px;
  border: 1px solid rgba(17, 17, 17, 0.055);
  border-radius: 999px;
  background: rgba(240, 239, 237, 0.92);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.035), 0 1px 1px rgba(255, 255, 255, 0.8);
  scrollbar-width: none;
}

.main-nav::-webkit-scrollbar,
.filter-scroll::-webkit-scrollbar,
.horizontal-cards::-webkit-scrollbar {
  display: none;
}

.nav-pill,
.filter-pill,
.select-button,
.btn,
.composer-tools button,
.quick-row button,
.owned-actions button,
.resource-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  max-width: 100%;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--text);
  background: transparent;
  box-shadow: none;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
  transition:
    transform var(--ease),
    border-color var(--ease),
    background var(--ease),
    color var(--ease),
    box-shadow var(--ease);
}

.nav-pill {
  min-height: 40px;
  padding: 0 13px;
  gap: 7px;
  font-size: 13px;
}

.nav-pill span,
.filter-pill span,
.select-button span,
.btn span,
.composer-tools button,
.quick-row button {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-pill.is-active,
.filter-pill.is-active,
.segmented .is-active {
  border-color: transparent;
  color: #ffffff;
  background: var(--accent);
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.08),
    0 10px 22px rgba(0, 0, 0, 0.1);
}

.top-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.search-shell,
.inline-search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(17, 17, 17, 0.06);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-control);
}

.search-shell input,
.inline-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: none;
  color: var(--text);
  background: transparent;
}

.search-shell input::placeholder,
.inline-search input::placeholder,
.composer-input::placeholder {
  color: #8d98a8;
}

.icon-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-control);
  transition: transform var(--ease), border-color var(--ease), box-shadow var(--ease), background var(--ease);
}

.icon-button--light {
  border-color: rgba(17, 17, 17, 0.06);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-control);
}

.badge {
  position: absolute;
  top: 3px;
  right: 2px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 2px solid #ffffff;
  border-radius: 99px;
  color: #ffffff;
  background: var(--green);
  font-size: 11px;
  font-weight: 900;
}

.profile-button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  min-width: 0;
  min-height: 44px;
  padding: 3px 12px 3px 4px;
  border: 1px solid rgba(17, 17, 17, 0.06);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-control);
  font-weight: 780;
  white-space: nowrap;
}

.profile-button .icon {
  width: 15px;
  transform: rotate(90deg);
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  color: #ffffff;
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.25), transparent 28%),
    linear-gradient(160deg, #0a8d6b, #075166);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.68), 0 8px 20px rgba(8, 30, 58, 0.14);
  font-weight: 900;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(340px, 24vw, 410px);
  align-items: start;
  gap: 20px;
  max-width: 1728px;
  margin: 0 auto;
}

.workspace--wide {
  grid-template-columns: 1fr;
}

.workspace-main,
.workspace-side {
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 0;
}

.workspace-main > *,
.workspace-side > * {
  min-width: 0;
}

.section-block {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.surface,
.hero-panel,
.dialogue-panel,
.composer-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 40px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.dialogue-panel::before,
.composer-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 72px;
  background: var(--accent-soft);
  opacity: 0.38;
  pointer-events: none;
}

.surface > *,
.dialogue-panel > *,
.composer-panel > * {
  position: relative;
  z-index: 1;
}

.surface,
.composer-panel,
.dialogue-panel {
  padding: 22px;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.92fr);
  align-items: center;
  min-height: 312px;
}

body[data-page="settings"] .hero-panel {
  grid-template-columns: minmax(0, 1.28fr) minmax(250px, 0.72fr);
}

.hero-copy {
  padding: clamp(30px, 3vw, 48px);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  max-width: 680px;
  color: var(--text);
  font-family: "Radio Canada Big", sans-serif;
  font-size: clamp(32px, 3.05vw, 54px);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: 0;
}

h2 {
  color: var(--text);
  font-size: clamp(18px, 1.2vw, 22px);
  font-family: "Radio Canada Big", sans-serif;
  font-weight: 800;
  line-height: 1.18;
}

h3 {
  color: var(--text);
  font-size: 16px;
  font-weight: 760;
  line-height: 1.24;
}

.hero-copy p,
.composer-panel p,
.message-card p,
.surface p,
.selected-card p,
.setting-card p,
.memory-card p {
  color: var(--muted);
  line-height: 1.5;
}

.hero-copy > p {
  max-width: 620px;
  margin-top: 14px;
  font-size: 17px;
}

.hero-actions,
.dual-actions,
.widget-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-actions {
  margin-top: 24px;
}

.btn {
  min-height: 48px;
  padding: 0 22px;
}

.btn--primary {
  border-color: transparent;
  color: #ffffff;
  background: var(--accent);
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.08),
    0 14px 26px rgba(0, 0, 0, 0.11);
}

.btn--outline,
.btn--quiet {
  color: var(--text);
  border-color: rgba(17, 17, 17, 0.065);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-control);
}

.btn--quiet {
  width: 100%;
  border-radius: 999px;
}

.btn--danger {
  color: var(--red);
  border-color: rgba(239, 74, 74, 0.3);
  background: #fffafa;
  box-shadow: var(--shadow-control);
}

.btn .icon,
.composer-tools button .icon,
.quick-row button .icon,
.owned-actions button .icon,
.resource-actions button .icon {
  width: 19px;
  height: 19px;
  padding: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.06);
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 26px;
  max-width: 690px;
}

body[data-page="settings"] .metric-row {
  grid-template-columns: repeat(3, minmax(158px, 1fr));
  max-width: 760px;
}

.metric {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 11px;
  min-width: 0;
  min-height: 76px;
  padding: 12px 16px;
  border: 1px solid rgba(17, 17, 17, 0.06);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 -2px 3px rgba(0, 0, 0, 0.025);
}

body[data-page="settings"] .metric {
  min-height: 88px;
}

.metric:first-child {
  padding-left: 16px;
}

.metric:last-child {
  border-right: 1px solid rgba(17, 17, 17, 0.06);
}

.metric-icon,
.small-icon,
.round-icon,
.file-badge,
.app-logo {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
}

.metric-icon {
  grid-row: 1 / span 2;
  width: 38px;
  height: 38px;
  border-radius: 999px;
}

.metric-icon.info {
  color: var(--blue);
  background: var(--blue-soft);
}

.metric-icon.warning {
  color: var(--orange);
  background: var(--orange-soft);
}

.metric-icon.danger {
  color: var(--red);
  background: var(--red-soft);
}

.metric strong {
  align-self: end;
  font-size: clamp(18px, 1.15vw, 23px);
  font-weight: 820;
  line-height: 1.08;
}

.metric span:last-child {
  color: var(--muted);
  font-size: 13px;
}

.orb-scene {
  position: relative;
  min-height: 260px;
  align-self: stretch;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 56%, rgba(0, 201, 139, 0.16), transparent 7rem),
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.85), transparent 16rem);
}

.core-orb {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.9);
  background:
    radial-gradient(circle at 35% 25%, #ffffff 0 6px, transparent 7px),
    radial-gradient(circle at 60% 42%, rgba(255, 255, 255, 0.92) 0 9px, transparent 10px),
    radial-gradient(circle at 52% 54%, #40ffd0, #00b77d 36%, #00665a 70%, #073141 100%);
  box-shadow:
    inset -12px -18px 34px rgba(0, 24, 38, 0.32),
    inset 10px 8px 30px rgba(255, 255, 255, 0.28),
    0 24px 48px rgba(0, 143, 97, 0.28),
    0 0 40px rgba(0, 201, 139, 0.34);
  transform: translate(-50%, -50%);
}

.core-orb::before,
.core-orb::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(188, 255, 236, 0.66);
  border-radius: 50%;
  inset: 20px;
  transform: rotate(22deg);
}

.core-orb::after {
  inset: 34px 12px;
  transform: rotate(-18deg);
}

.core-orb span {
  position: absolute;
  bottom: 14px;
  font-weight: 900;
  opacity: 0.7;
}

.orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 330px;
  height: 116px;
  border: 1px solid rgba(0, 177, 130, 0.28);
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(-18deg);
}

.orbit-b {
  width: 390px;
  height: 148px;
  transform: translate(-50%, -50%) rotate(20deg);
}

.orbit-c {
  width: 270px;
  height: 210px;
  border-color: rgba(40, 105, 217, 0.12);
  transform: translate(-50%, -50%) rotate(62deg);
}

.orbit-tile {
  position: absolute;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--green);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-soft);
}

.orbit-tile-1 {
  top: 42px;
  left: 18%;
}

.orbit-tile-2 {
  top: 68px;
  right: 18%;
}

.orbit-tile-3 {
  right: 12%;
  bottom: 58px;
}

.orbit-tile-4 {
  left: 16%;
  bottom: 58px;
}

.spark {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--green-2);
  box-shadow: 0 0 0 6px rgba(0, 201, 139, 0.12);
}

.spark-1 {
  top: 42px;
  left: 48%;
}

.spark-2 {
  right: 16%;
  top: 110px;
}

.spark-3 {
  left: 28%;
  bottom: 48px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-head--outside {
  margin: 0 8px;
  padding: 2px 2px 0;
}

.section-head--outside h2 {
  position: relative;
  z-index: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  font-size: clamp(23px, 1.65vw, 31px);
  font-weight: 850;
  letter-spacing: 0;
  transition: color var(--ease), transform var(--ease), text-shadow var(--ease);
}

.section-head--outside h2::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 7px var(--accent-soft);
}

.section-head--outside h2::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: -14px;
  top: 50%;
  width: 72px;
  height: 42px;
  border-radius: 999px;
  background: var(--accent-soft);
  opacity: 0;
  filter: blur(16px);
  transform: translateY(-50%);
  transition: opacity var(--ease), transform var(--ease);
}

.section-head--outside .ghost-link {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(17, 17, 17, 0.06);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-control);
}

.ghost-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  color: var(--accent);
  background: transparent;
  font-weight: 790;
  white-space: nowrap;
}

.ghost-link .icon {
  width: 15px;
}

.dialogue-panel {
  min-height: 0;
}

.chat-panel {
  display: grid;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.chat-panel::before {
  display: none;
}

.chat-panel .chat-stream {
  height: clamp(420px, 62vh, 760px);
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: auto;
  padding: 28px 24px 20px 92px;
  scrollbar-width: thin;
  scrollbar-color: rgba(17, 17, 17, 0.18) transparent;
}

.chat-panel .chat-stream::-webkit-scrollbar {
  width: 8px;
}

.chat-panel .chat-stream::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.18);
  background-clip: padding-box;
}

.chat-panel .timeline-line {
  left: 52px;
  top: 44px;
  bottom: 36px;
}

.chat-panel .chat-message {
  width: min(100%, 1030px);
}

.chat-panel .message-card {
  border-radius: 28px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.02), 0 12px 30px rgba(0, 0, 0, 0.045);
}

.chat-dock {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  margin: 0 24px 24px;
  padding: 14px;
  border: 1px solid rgba(17, 17, 17, 0.065);
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-soft);
}

.chat-dock .composer-box {
  min-height: 148px;
  padding: 18px 84px 18px 18px;
  border-radius: 30px;
  background: #fbfbfa;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -2px 4px rgba(0, 0, 0, 0.022),
    0 12px 28px rgba(0, 0, 0, 0.04);
}

.chat-dock .composer-input {
  min-height: 58px;
  font-size: 16px;
  line-height: 1.45;
}

.chat-dock .composer-tools {
  align-self: end;
  padding-top: 13px;
  border-top: 1px solid rgba(17, 17, 17, 0.055);
}

.chat-dock .composer-tools button,
.chat-dock .quick-row button {
  border: 1px solid rgba(17, 17, 17, 0.055);
  background: #ffffff;
  box-shadow: var(--shadow-control);
}

.chat-dock .send-button {
  right: 18px;
  bottom: 18px;
  width: 58px;
  height: 58px;
}

.chat-dock .quick-row {
  margin-top: 0;
  padding-inline: 2px;
}

.chat-stream {
  position: relative;
  display: grid;
  gap: 14px;
  padding-left: 62px;
}

.timeline-line {
  position: absolute;
  top: 14px;
  bottom: 6px;
  left: 26px;
  width: 2px;
  background: linear-gradient(var(--line-2), var(--line));
}

.timeline-line::before,
.timeline-line::after {
  content: "";
  position: absolute;
  left: -4px;
  width: 10px;
  height: 10px;
  border-radius: 99px;
  background: #adbbcb;
}

.timeline-line::before {
  top: 0;
}

.timeline-line::after {
  bottom: 0;
}

.chat-message {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  width: min(100%, 930px);
}

.chat-message time {
  position: absolute;
  left: -62px;
  top: 17px;
  color: var(--muted);
  font-size: 12px;
}

.message-avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-top: 12px;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(160deg, #00a86e, #005c5b);
  box-shadow: 0 8px 18px rgba(0, 96, 76, 0.16);
}

.chat-message--user .message-avatar {
  background: linear-gradient(160deg, #00a86e, #007342);
}

.message-card {
  min-width: 0;
  min-height: 70px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 22px rgba(8, 30, 58, 0.035);
}

.chat-message--user .message-card {
  max-width: 620px;
  background: #f8fdfb;
}

.message-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.message-meta strong {
  color: var(--green);
}

.message-meta span {
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 12px;
  font-weight: 780;
}

.chat-history-control,
.date-separator {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 1030px);
  min-height: 34px;
}

.chat-history-control {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.chat-history-control .ghost-link {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
}

.chat-history-control--muted {
  opacity: 0.76;
}

.date-separator span {
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.94);
  font-size: 12px;
  font-weight: 780;
}

.message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.message-actions button {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(17, 17, 17, 0.07);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.82);
}

.message-actions button:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.message-actions button {
  width: auto;
  min-width: 30px;
  padding: 0 9px;
  gap: 5px;
  font-size: 11px;
  font-weight: 760;
}

.message-action-label {
  display: inline-block;
}

.message-content {
  display: grid;
  gap: 10px;
  color: #18312d;
  line-height: 1.58;
}

.message-content:empty {
  display: none;
}

.message-content p {
  margin: 0;
  color: inherit;
}

.message-content h3,
.message-content h4,
.message-content h5,
.message-content h6 {
  margin: 6px 0 0;
  color: #092c28;
  font-size: 15px;
  line-height: 1.25;
  letter-spacing: 0;
}

.message-content h3 {
  font-size: 17px;
}

.message-content strong {
  color: #092c28;
  font-weight: 850;
}

.message-content em {
  color: #315b55;
}

.message-content a {
  color: var(--green);
  font-weight: 760;
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 168, 110, 0.28);
}

.message-content ul,
.message-content ol {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 22px;
}

.message-content li {
  padding-left: 2px;
}

.message-content code {
  padding: 2px 6px;
  border: 1px solid rgba(20, 69, 60, 0.1);
  border-radius: 7px;
  color: #084238;
  background: rgba(0, 201, 139, 0.08);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

.markdown-code-block {
  max-width: 100%;
  margin: 0;
  padding: 12px;
  overflow-x: auto;
  border: 1px solid rgba(20, 69, 60, 0.1);
  border-radius: 14px;
  background: #f7fbf9;
}

.markdown-code-block code {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  white-space: pre;
}

.message-content blockquote {
  margin: 0;
  padding: 8px 12px;
  border-left: 3px solid var(--green);
  border-radius: 10px;
  color: #315b55;
  background: rgba(0, 201, 139, 0.08);
}

.markdown-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
}

.markdown-table {
  width: 100%;
  min-width: 420px;
  border-collapse: collapse;
  font-size: 13px;
}

.markdown-table th,
.markdown-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.markdown-table th {
  color: #092c28;
  background: #f6fbf9;
  font-weight: 850;
}

.markdown-table tr:last-child td {
  border-bottom: 0;
}

.compare-widget {
  width: min(100%, 650px);
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #ffffff;
}

.mini-head,
.mission-top,
.resource-top,
.profile-large {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mini-head {
  margin-bottom: 12px;
}

.mini-head em {
  margin-left: auto;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 12px;
  font-style: normal;
  font-weight: 780;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.compare-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #ffffff;
}

.compare-card span {
  color: var(--muted);
  font-size: 13px;
}

.compare-card b {
  color: var(--green);
}

.widget-actions {
  justify-content: flex-end;
  margin-top: 12px;
}

.miniapp-widget {
  width: min(100%, 690px);
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(8, 30, 58, 0.035);
}

.miniapp-widget .message-content {
  margin-top: 10px;
}

.miniapp-actions {
  justify-content: flex-start;
  margin-top: 12px;
}

.miniapp-note {
  margin: 12px 0 0;
  color: #315b55;
  font-size: 13px;
}

.miniapp-list {
  display: grid;
  gap: 8px;
}

.miniapp-list span {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfefd;
  color: #315b55;
  font-size: 13px;
}

.miniapp-list span i {
  display: grid;
  gap: 3px;
  min-width: 0;
  color: inherit;
  font-style: normal;
}

.miniapp-list span i strong {
  color: #092c28;
}

.miniapp-list span small {
  display: block;
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.agent-list {
  display: grid;
  gap: 10px;
}

.agent-row {
  border-color: #bfe4da;
  background: #f6fffb;
}

.agent-row .small-icon {
  color: #087d67;
  background: #dff7ee;
}

.miniapp-list b {
  min-width: 66px;
  color: #092c28;
}

.composer-panel > div:first-child {
  margin-bottom: 10px;
}

.composer-box {
  position: relative;
  display: grid;
  min-height: 106px;
  padding: 14px 72px 14px 14px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #ffffff;
  box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.025);
}

.composer-input {
  min-height: 38px;
  resize: vertical;
  border: 0;
  outline: none;
  color: var(--text);
  background: transparent;
}

.composer-tools,
.quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.composer-tools {
  align-self: end;
}

.composer-tools button,
.quick-row button {
  min-height: 40px;
  padding: 0 15px;
  color: var(--text);
  background: rgba(245, 244, 243, 0.88);
  box-shadow: inset 0 -2px 3px rgba(0, 0, 0, 0.035), 0 1px 1px rgba(0, 0, 0, 0.025);
}

.composer-tools button.is-selected {
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 7px 18px color-mix(in srgb, var(--accent) 22%, transparent);
}

.send-button {
  position: absolute;
  right: 16px;
  bottom: 14px;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08), 0 16px 28px rgba(0, 0, 0, 0.11);
}

.quick-row {
  margin-top: 12px;
}

.split-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(190px, 300px) minmax(0, 1fr) auto 44px;
  gap: 10px;
  align-items: center;
  padding: 8px;
  margin-bottom: 16px;
  border: 1px solid rgba(17, 17, 17, 0.055);
  border-radius: 32px;
  background: rgba(246, 245, 243, 0.92);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025);
}

.inline-search {
  width: 100%;
  min-height: 38px;
  box-shadow: none;
}

.filter-scroll {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  padding: 2px;
  scrollbar-width: none;
}

.filter-pill,
.select-button {
  min-height: 40px;
  padding: 0 15px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.025);
}

.select-button {
  min-width: max-content;
  max-width: 190px;
}

.toolbar > .icon-button {
  width: 44px;
  height: 44px;
  justify-self: end;
}

.card-grid,
.settings-grid,
.validation-grid,
.quality-grid,
.confirm-grid,
.compact-list,
.memory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
  gap: 12px;
}

.settings-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
  gap: 16px;
}

.memory-grid,
.compact-list {
  grid-template-columns: repeat(auto-fit, minmax(min(390px, 100%), 1fr));
}

.card-grid--compact {
  grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr));
}

.dark-card,
.add-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 9px;
  min-height: 244px;
  padding: 20px;
  overflow: hidden;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  color: var(--text);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
  isolation: isolate;
  transition: transform var(--ease), border-color var(--ease), box-shadow var(--ease), background var(--ease);
}

.card-grid--compact .dark-card,
.card-grid--compact .add-card {
  min-height: 234px;
  padding: 18px;
}

.card-grid--compact .card-art {
  width: 56px;
  height: 56px;
  border-radius: 19px;
}

.card-grid--compact .dark-card strong {
  font-size: 18px;
}

.dark-card.is-selected {
  border-color: rgba(17, 17, 17, 0.12);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.dark-card strong,
.owned-card strong,
.result-card strong,
.import-card strong {
  position: relative;
  z-index: 1;
  font-family: "Radio Canada Big", sans-serif;
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.12;
}

.dark-card > span:not(.card-art):not(.card-menu),
.owned-card small,
.result-card small,
.import-card small {
  position: relative;
  z-index: 1;
  color: var(--muted);
  line-height: 1.42;
}

.card-meta {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 4px;
}

.card-meta span {
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid rgba(17, 17, 17, 0.055);
  border-radius: 16px;
  color: var(--muted);
  background: rgba(248, 248, 247, 0.82);
  font-size: 12px;
  line-height: 1.1;
}

.card-meta b {
  color: var(--text);
  font-size: 16px;
  line-height: 1;
}

.card-lines {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 6px;
  margin-top: 2px;
}

.card-lines i {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: #e7e3dd;
}

.card-lines i:nth-child(2) {
  width: 78%;
}

.card-lines i:nth-child(3) {
  width: 48%;
}

.card-menu {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #a6adb8;
  background: rgba(245, 245, 246, 0.72);
}

.card-art {
  position: relative;
  z-index: 1;
  display: inline-grid;
  place-items: center;
  width: 66px;
  height: 66px;
  margin-bottom: 8px;
  border: 1px solid rgba(17, 17, 17, 0.06);
  border-radius: 22px;
  color: var(--accent);
  background: #ffffff;
  box-shadow:
    inset 0 -5px 12px rgba(0, 0, 0, 0.035),
    0 10px 24px rgba(0, 0, 0, 0.045);
}

.card-art .icon {
  width: 28px;
  height: 28px;
}

.card-art--pdf {
  color: #f43f5e;
  border-color: rgba(244, 63, 94, 0.12);
  background: #fff0f3;
  box-shadow: inset 0 -5px 12px rgba(244, 63, 94, 0.05), 0 10px 24px rgba(244, 63, 94, 0.08);
}

.card-art--mail {
  color: var(--sky);
  border-color: rgba(66, 168, 248, 0.14);
  background: var(--sky-soft);
  box-shadow: inset 0 -5px 12px rgba(66, 168, 248, 0.055), 0 10px 24px rgba(66, 168, 248, 0.08);
}

.card-art--web,
.card-art--docs {
  color: var(--cyan);
  border-color: rgba(17, 184, 216, 0.14);
  background: var(--cyan-soft);
  box-shadow: inset 0 -5px 12px rgba(17, 184, 216, 0.05), 0 10px 24px rgba(17, 184, 216, 0.08);
}

.card-art--chart,
.card-art--dashboard,
.card-art--sliders,
.card-art--screen,
.card-art--check {
  color: var(--lavender);
  border-color: rgba(118, 103, 255, 0.14);
  background: var(--lavender-soft);
  box-shadow: inset 0 -5px 12px rgba(118, 103, 255, 0.055), 0 10px 24px rgba(118, 103, 255, 0.08);
}

.card-art--visual,
.card-art--palette,
.card-art--spark {
  color: var(--pink);
  border-color: rgba(240, 50, 210, 0.14);
  background: var(--pink-soft);
  box-shadow: inset 0 -5px 12px rgba(240, 50, 210, 0.055), 0 10px 24px rgba(240, 50, 210, 0.08);
}

.card-art--crm,
.card-art--target,
.card-art--shield,
.card-art--chat {
  color: var(--cyan);
  border-color: rgba(17, 184, 216, 0.14);
  background: var(--cyan-soft);
  box-shadow: inset 0 -5px 12px rgba(17, 184, 216, 0.055), 0 10px 24px rgba(17, 184, 216, 0.08);
}

.card-art--calendar {
  color: var(--amber);
  border-color: rgba(245, 179, 63, 0.16);
  background: var(--amber-soft);
}

.card-art--sheet,
.card-art--data {
  color: var(--green);
  background: #e7fbf5;
}

.card-art--api {
  color: #5b6470;
  background: #f1f2f4;
}

.status {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 23px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-style: normal;
  font-weight: 760;
  white-space: nowrap;
}

.dark-card .status {
  margin-top: auto;
}

.status--success {
  color: #007a50;
  background: #dff7ed;
}

.status--warning {
  color: #c25a00;
  background: var(--orange-soft);
}

.status--danger {
  color: var(--red);
  background: var(--red-soft);
}

.status--info {
  color: var(--blue);
  background: var(--blue-soft);
}

.add-card {
  place-items: center;
  align-content: center;
  border: 1.5px dashed rgba(10, 12, 17, 0.14);
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.add-card span {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--green);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.add-card strong {
  font-family: "Radio Canada Big", sans-serif;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.18;
}

.add-card small {
  color: var(--muted);
}

.mission-card,
.selected-card,
.suggestion-box,
.confidence,
.profile-large,
.preview-box,
.white-card,
.quality-card,
.confirm-card,
.setting-card,
.memory-card,
.resource-card,
.validation-row,
.list-row {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
}

.mission-card {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.mission-top {
  justify-content: space-between;
}

.round-icon {
  border-radius: 999px;
}

.progress-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: center;
  gap: 10px;
}

.progress-line::before {
  content: "";
  grid-column: 1;
  grid-row: 1;
  height: 8px;
  border-radius: 999px;
  background: #e7edf1;
}

.progress-line span {
  grid-column: 1;
  grid-row: 1;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
}

.progress-line b {
  color: var(--text);
  font-size: 13px;
}

.validation-row,
.list-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 56px;
  padding: 11px;
  color: var(--text);
  text-align: left;
}

.list-row > span:nth-child(2) {
  min-width: 0;
}

.list-row strong,
.list-row small {
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-run-row,
.capability-group-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
}

.mini-run-row button,
.mini-run-row a,
.capability-group-row button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.summary-card {
  display: grid;
  gap: 8px;
}

.summary-card strong {
  color: var(--text);
}

.summary-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.summary-card__content {
  max-height: 290px;
  overflow: auto;
  padding-right: 5px;
  color: var(--muted);
  overflow-wrap: anywhere;
  scrollbar-width: thin;
}

.summary-card__content .message-content {
  margin: 0;
}

.summary-card__content .message-content > :first-child {
  margin-top: 0;
}

.summary-card small,
.empty-inline {
  color: var(--muted);
  font-size: 13px;
}

.skill-test-result {
  display: grid;
  gap: 12px;
}

.skill-test-output {
  max-height: 360px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfefd;
  scrollbar-width: thin;
}

.skill-test-output .message-content {
  margin: 0;
}

.catalog-panel,
.search-mini-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.inline-search--full {
  width: 100%;
}

.search-result-list,
.template-list {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.template-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
}

.template-row > span:nth-child(2) {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.template-row strong,
.template-row small,
.template-row em {
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-insight {
  display: block;
  min-height: 34px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.template-row small,
.template-row em {
  color: var(--muted);
  font-style: normal;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.row-actions button,
.template-row a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: #ffffff;
  font-weight: 740;
  text-decoration: none;
}

.skill-search-row {
  grid-template-columns: auto minmax(0, 1fr) minmax(160px, auto) auto;
}

.notification-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.notification-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  min-width: 0;
  width: 100%;
  padding: 0;
  color: inherit;
  text-align: left;
}

.notification-trash {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.notification-trash summary,
.directive-preview summary,
.directive-history summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.validation-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.validation-row em,
.validation-row small,
.list-row small {
  display: block;
  color: var(--muted);
  font-style: normal;
}

.validation-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.validation-row strong,
.validation-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-stack {
  display: grid;
  gap: 10px;
}

.file-badge.danger {
  color: #ffffff;
  background: var(--red);
}

.file-badge.success {
  color: #ffffff;
  background: var(--green);
}

.small-icon.warning {
  color: var(--orange);
  background: var(--orange-soft);
}

.today-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.today-grid .metric {
  display: grid;
  grid-template-columns: auto;
  justify-items: center;
  gap: 8px;
  min-width: 0;
  padding: 12px 8px;
  border: 1px solid var(--line);
  border-radius: 20px;
  text-align: center;
  background: rgba(255, 255, 255, 0.92);
}

.today-grid .metric-icon {
  grid-row: auto;
}

.activity-list {
  display: grid;
  gap: 10px;
}

.activity-row {
  display: grid;
  grid-template-columns: 62px 44px minmax(0, 1fr) minmax(170px, 280px) 44px;
  grid-template-areas:
    "time dot body status menu"
    "time dot body category menu"
    ". . progress progress menu"
    ". . action action menu";
  align-items: center;
  gap: 10px 14px;
  min-height: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
}

.activity-row time {
  grid-area: time;
}

.activity-row time,
.activity-row p,
.activity-row em {
  color: var(--muted);
}

.activity-row p {
  margin-top: 4px;
  font-size: 13px;
}

.activity-row em {
  grid-area: category;
  justify-self: start;
  font-style: normal;
  font-weight: 720;
}

.activity-dot {
  grid-area: dot;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
}

.activity-row .status {
  grid-area: status;
  justify-self: end;
}

.activity-row > div:not(.progress-line) {
  grid-area: body;
  min-width: 0;
}

.activity-row .progress-line {
  grid-area: progress;
  min-width: 0;
}

.activity-row .btn {
  grid-area: action;
  justify-self: start;
  width: auto;
  min-width: 138px;
  max-width: 260px;
  min-height: 42px;
}

.activity-row .icon-button {
  grid-area: menu;
  justify-self: end;
}

.activity-row > span:not(.activity-dot):not(.status) {
  display: none;
}

.status-bg--success {
  color: var(--green);
  background: var(--mint);
}

.status-bg--warning {
  color: var(--orange);
  background: var(--orange-soft);
}

.status-bg--danger {
  color: var(--red);
  background: var(--red-soft);
}

.status-bg--info {
  color: var(--blue);
  background: var(--blue-soft);
}

.white-card {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 14px;
  min-height: 176px;
  padding: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.92);
}

.white-card .card-art {
  width: 84px;
  height: 84px;
}

.white-card .dual-actions {
  grid-column: 1 / -1;
  align-self: end;
}

.white-card h3,
.white-card p,
.white-card small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.horizontal-cards {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(280px, 24vw, 340px);
  gap: 14px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scrollbar-width: none;
}

.result-card,
.owned-card,
.import-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 9px;
  min-height: 204px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  color: var(--text);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.result-card .card-art,
.import-card .card-art {
  width: 60px;
  height: 60px;
}

.result-card button,
.owned-card button,
.import-card button {
  position: relative;
  z-index: 1;
  min-height: 38px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-control);
  font-weight: 760;
}

.selected-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  margin-bottom: 14px;
}

.selected-card .card-art {
  width: 56px;
  height: 56px;
  margin: 0;
}

.score-table {
  display: grid;
  grid-template-columns: minmax(80px, 0.9fr) 1fr 1fr;
  gap: 10px 8px;
  min-width: 0;
  padding: 12px 0;
  overflow-x: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.score-table > * {
  min-width: 0;
}

.score-table span {
  color: var(--muted);
  font-size: 13px;
}

.score-table em {
  display: inline-flex;
  justify-content: center;
  padding: 6px 9px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--green);
  font-style: normal;
  font-weight: 800;
}

.stars {
  color: var(--green);
  white-space: nowrap;
}

.stars i {
  color: #c5d1dc;
  font-style: normal;
}

.detail-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.detail-list span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.owned-card {
  min-height: 238px;
}

.result-card > span:not(.card-art),
.import-card > span:not(.card-art) {
  position: relative;
  z-index: 1;
  width: fit-content;
  margin-top: auto;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--green);
  background: var(--mint);
  font-size: 12px;
  font-weight: 800;
}

.owned-card > span {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1;
  padding: 5px 9px;
  border-radius: 999px;
  color: #007a50;
  background: #dff7ed;
  font-size: 12px;
  font-weight: 800;
}

.owned-card strong {
  max-width: calc(100% - 86px);
}

.owned-card small,
.owned-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-visual,
.resource-art {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: repeat(3, 1fr);
  align-items: center;
  gap: 7px 12px;
  width: 100%;
  min-height: 78px;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid rgba(17, 17, 17, 0.06);
  border-radius: 22px;
  background: #f8f8f7;
  box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.025);
}

.mini-visual .card-art,
.resource-art .card-art {
  grid-row: 1 / span 3;
  width: 48px;
  height: 48px;
  margin: 0;
  border-radius: 16px;
}

.mini-visual i,
.resource-art i {
  display: block;
  height: 7px;
  border-radius: 999px;
  background: #dedbd6;
}

.mini-visual i:nth-of-type(2),
.resource-art i:nth-of-type(2) {
  width: 72%;
}

.mini-visual i:nth-of-type(3),
.resource-art i:nth-of-type(3) {
  width: 48%;
}

.owned-actions,
.resource-actions,
.surface-footer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.workspace-side .surface-footer {
  grid-template-columns: 1fr;
}

.owned-actions button,
.resource-actions button {
  min-width: 0;
  min-height: 40px;
  padding: 0 12px;
  border-color: rgba(17, 17, 17, 0.065);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-control);
  overflow: hidden;
  text-overflow: ellipsis;
}

.toggle-stack {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 -2px 3px rgba(0, 0, 0, 0.025);
}

.toggle-stack.compact {
  border: 1px solid rgba(17, 17, 17, 0.055);
  background: #fbfbfa;
  box-shadow: none;
}

.toggle-stack.compact .toggle-row {
  min-height: 54px;
  padding: 11px 12px;
}

.toggle-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}

.toggle-row:last-child {
  border-bottom: 0;
}

.toggle-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.toggle-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-row i {
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: #cfd8dd;
  transition: background var(--ease);
}

.toggle-row i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(8, 30, 58, 0.18);
  transition: transform var(--ease);
}

.toggle-row input:checked + i {
  background: var(--accent);
}

.toggle-row input:checked + i::after {
  transform: translateX(20px);
}

.notice {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
  padding: 15px;
  border: 1px solid rgba(17, 184, 216, 0.16);
  border-radius: 22px;
  color: var(--text);
  background: #eff9fc;
}

.notice button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 999px;
  background: #ffffff;
  color: var(--text);
  font-weight: 800;
}

.notice--danger {
  border-color: rgba(239, 68, 68, 0.2);
  background: var(--red-soft);
}

.notice--success {
  border-color: rgba(0, 155, 109, 0.2);
  background: var(--mint);
}

.public-auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 620px) minmax(240px, 1fr);
  gap: 28px;
  align-items: center;
  width: min(1060px, 100%);
  min-height: calc(100dvh - 36px);
  margin: 0 auto;
  padding: 24px;
}

.public-auth-panel,
.public-auth-aside {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
}

.public-auth-panel {
  display: grid;
  gap: 18px;
  padding: clamp(24px, 5vw, 48px);
}

.public-auth-brand {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 15px;
  color: #006f5b;
  font-size: 30px;
  font-weight: 900;
}

.public-auth-brand span span { color: var(--green-2); }
.public-auth-brand em { color: var(--muted); font-size: 12px; font-style: normal; font-weight: 700; }
.public-auth-copy { display: grid; gap: 8px; }
.public-auth-copy h1 { margin: 0; font-size: clamp(28px, 4vw, 42px); }
.public-auth-copy p { margin: 0; color: var(--muted); }
.auth-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.auth-form { display: grid; gap: 13px; }
.auth-form label { display: grid; gap: 6px; color: var(--muted); font-weight: 760; }
.auth-form input:not([type="checkbox"]),
.auth-form textarea,
.invite-link-output { width: 100%; min-height: 44px; padding: 11px 13px; border: 1px solid var(--line-2); border-radius: 13px; color: var(--text); background: #fff; }
.auth-form textarea { min-height: 105px; resize: vertical; }
.auth-trap { position: absolute; left: -10000px; opacity: 0; }
.consent-row { display: flex !important; grid-template-columns: auto 1fr; align-items: flex-start; gap: 9px !important; font-size: 12px; }
.consent-row input { margin-top: 3px; accent-color: var(--green); }
.auth-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 3px; color: var(--muted); font-size: 12px; }
.public-auth-aside { display: grid; gap: 15px; min-height: 310px; place-items: center; align-content: center; padding: 32px; text-align: center; }
.public-auth-aside .core-orb { width: 112px; height: 112px; font-size: 42px; }
.public-auth-aside strong { font-size: 19px; }
.public-auth-aside p { max-width: 260px; margin: 0; color: var(--muted); }
.account-form { padding-top: 4px; }
.account-form--password { margin-top: 4px; padding-top: 18px; border-top: 1px solid var(--line); }
.beta-management { display: grid; gap: 12px; }
.beta-row { align-items: center; }
.beta-row > span:nth-child(2) { min-width: 0; }
.beta-row > span:nth-child(2) small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subsection-title { margin: 16px 0 0; font-size: 14px; }
.invite-link-output { min-height: 78px; font-size: 12px; resize: vertical; }

@media (max-width: 820px) {
  .public-auth-shell { grid-template-columns: 1fr; padding: 12px; }
  .public-auth-aside { display: none; }
}

.mini-kpi-row,
.runtime-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mini-kpi-row span,
.runtime-actions span {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-size: 12px;
}

.runtime-health {
  display: grid;
  gap: 5px;
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
  font-size: 11px;
}

.runtime-health strong {
  color: var(--text);
  font-size: 12px;
}

.mini-kpi-row strong {
  display: block;
  color: var(--text);
  font-size: 15px;
}

.runtime-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.runtime-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.runtime-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.runtime-field input,
.runtime-field select,
.runtime-field textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid rgba(17, 17, 17, 0.075);
  border-radius: 18px;
  color: var(--text);
  background: #fbfbfa;
  box-shadow: inset 0 -2px 3px rgba(0, 0, 0, 0.022);
}

.runtime-field textarea {
  min-height: 96px;
  padding-top: 12px;
  resize: vertical;
}

.runtime-field--wide {
  grid-column: 1 / -1;
}

.empty-state {
  display: grid;
  justify-items: start;
  gap: 10px;
  padding: 18px;
  border: 1px dashed rgba(17, 17, 17, 0.12);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
}

.empty-state p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
}

.tenant-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.tenant-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
}

.tenant-card.is-active {
  border-color: rgba(0, 155, 109, 0.34);
  background: var(--mint);
}

.tenant-card h3,
.tenant-card p {
  margin: 0;
}

.tenant-card p {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tenant-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.tenant-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tenant-actions button {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(17, 17, 17, 0.07);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: var(--shadow-control);
}

.app-logo {
  color: #ffffff;
  background: var(--blue);
  font-weight: 900;
}

.resource-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  overflow: hidden;
}

.resource-top {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.resource-top > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.resource-top strong,
.resource-top small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-top .status {
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quality-grid {
  align-items: center;
}

.quality-card {
  display: grid;
  gap: 7px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.92);
}

.quality-card strong {
  font-size: 26px;
}

.quality-card small {
  color: var(--muted);
}

.mini-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf1;
}

.mini-progress span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--blue);
}

.mini-progress .success {
  background: var(--green);
}

.mini-progress .warning {
  background: var(--orange);
}

.quality-ring {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  margin: 14px auto 0;
  border-radius: 999px;
  background:
    radial-gradient(circle, #ffffff 57%, transparent 58%),
    conic-gradient(var(--green) 0 82%, #e9eef2 82% 100%);
}

.quality-ring span {
  font-size: 18px;
  font-weight: 850;
}

.suggestion-box {
  display: grid;
  gap: 13px;
  padding: 18px;
}

.memory-card {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px 14px;
  min-height: 156px;
  padding: 18px;
  overflow: hidden;
}

.memory-card > div {
  min-width: 0;
}

.memory-card h3,
.memory-card p {
  overflow-wrap: anywhere;
}

.memory-card > .status {
  grid-column: 3;
  justify-self: end;
  align-self: start;
  max-width: 100%;
  margin-top: -2px;
  white-space: nowrap;
}

.memory-card footer {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  justify-content: start;
  gap: 10px 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.memory-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--panel-soft);
  white-space: nowrap;
}

.memory-card footer button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 -2px 3px rgba(0, 0, 0, 0.025);
  white-space: nowrap;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

.confirm-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: #ffffff;
}

.confirm-main {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-width: 0;
}

.confirm-main > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.confirm-main strong {
  font-size: 16px;
  line-height: 1.15;
}

.confirm-main p {
  color: var(--muted);
  line-height: 1.38;
}

.confirm-main .status {
  grid-column: 2;
  justify-self: start;
  margin-top: 2px;
}

.confirm-card .dual-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.confirm-card .btn {
  min-width: 0;
}

.confidence {
  position: relative;
  min-height: 150px;
  padding: 22px;
}

.confidence strong {
  font-size: 38px;
  font-weight: 850;
}

.confidence strong span {
  color: var(--muted);
  font-size: 21px;
}

.shield-big {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 999px;
  color: var(--green);
  background: var(--mint);
}

.setting-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  grid-template-areas: "icon body action";
  gap: 14px 18px;
  align-items: center;
  min-height: 152px;
  padding: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.92);
}

.setting-card .card-art {
  grid-area: icon;
  width: 72px;
  height: 72px;
  margin: 0;
}

.setting-card > div {
  grid-area: body;
  min-width: 0;
}

.setting-card h3,
.setting-card p {
  overflow-wrap: anywhere;
}

.setting-card .status {
  margin-top: 8px;
}

.setting-card button {
  grid-area: action;
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(17, 17, 17, 0.06);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-control);
  font-weight: 780;
}

.setting-card:nth-child(3n + 1) .card-art {
  color: var(--green);
  background: var(--mint);
}

.setting-card:nth-child(3n + 2) .card-art {
  color: var(--lavender);
  background: var(--lavender-soft);
}

.setting-card:nth-child(3n) .card-art {
  color: var(--pink);
  background: var(--pink-soft);
}

.behavior-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.behavior-grid > div {
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(17, 17, 17, 0.065);
  border-radius: 26px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.behavior-grid label {
  display: block;
  margin-bottom: 10px;
  font-weight: 800;
}

.range {
  width: 100%;
  accent-color: var(--accent);
}

.range-labels {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--control);
  padding: 4px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.035);
}

.segmented button {
  min-height: 42px;
  color: var(--text);
  background: transparent;
  border-radius: 999px;
  border-right: 0;
  font-weight: 760;
}

.segmented button:last-child {
  border-right: 0;
}

.preview-box {
  padding: 18px;
  background: rgba(245, 246, 247, 0.78);
}

.profile-large {
  padding: 16px;
  margin-bottom: 12px;
}

.avatar--large {
  width: 62px;
  height: 62px;
  font-size: 23px;
}

kbd {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: var(--panel-soft);
  box-shadow: inset 0 -1px 0 rgba(8, 30, 58, 0.08);
}

.toast-stack {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 120;
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 250px;
  padding: 12px 15px;
  border: 1px solid rgba(0, 143, 97, 0.18);
  border-radius: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  animation: toast-in 220ms ease both;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(7, 25, 54, 0.24);
  backdrop-filter: blur(10px);
}

.modal {
  position: relative;
  display: grid;
  gap: 15px;
  width: min(500px, 100%);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 26px 80px rgba(8, 30, 58, 0.2);
}

.modal--wide {
  width: min(760px, 100%);
  max-height: min(88vh, 840px);
  overflow: auto;
}

.skill-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-detail-meta span {
  display: inline-flex;
  gap: 5px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-muted);
  font-size: 11px;
}

.skill-detail-meta strong {
  color: var(--text);
}

.skill-detail-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, .8fr);
  gap: 18px;
}

.skill-detail-columns > section,
.skill-detail-columns > aside {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfbfa;
}

.skill-detail-columns h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.skill-document {
  max-height: 460px;
  overflow: auto;
  padding-right: 5px;
}

.skill-document .message-content {
  font-size: 13px;
}

.detail-list {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
}

.detail-list div {
  display: grid;
  gap: 4px;
}

.detail-list dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
  text-transform: uppercase;
}

.detail-list dd {
  margin: 0;
  white-space: pre-wrap;
  color: var(--text);
  font-size: 12px;
}

.skill-file-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 12px;
}

.skill-file-list li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.skill-detail-actions {
  justify-content: flex-start;
}

.skill-content-editor {
  min-height: 280px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

.directive-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.directive-grid__wide {
  grid-column: 1 / -1;
}

.directive-editor form {
  display: grid;
  gap: 14px;
}

.directive-preview,
.directive-history {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-muted);
}

.miniapp-intake-modal {
  --mini-accent: #6758e8;
  --mini-soft: #f0efff;
  width: min(920px, 100%);
  gap: 18px;
  border-top: 4px solid var(--mini-accent);
}

.miniapp-intake--marketing_social {
  --mini-accent: #a044d6;
  --mini-soft: #f8efff;
}

.miniapp-intake--client_reply {
  --mini-accent: #2678c9;
  --mini-soft: #edf6ff;
}

.miniapp-intake--site_content {
  --mini-accent: #008a82;
  --mini-soft: #eaf9f5;
}

.miniapp-intake--review_reputation {
  --mini-accent: #d26d2c;
  --mini-soft: #fff4eb;
}

.miniapp-intake--site_faq {
  --mini-accent: #168b96;
  --mini-soft: #eafafb;
}

.miniapp-result--marketing_social {
  --mini-accent: #a044d6;
  --mini-soft: #f8efff;
}

.miniapp-result--client_reply {
  --mini-accent: #2678c9;
  --mini-soft: #edf6ff;
}

.miniapp-result--site_content {
  --mini-accent: #008a82;
  --mini-soft: #eaf9f5;
}

.miniapp-result--review_reputation {
  --mini-accent: #d26d2c;
  --mini-soft: #fff4eb;
}

.miniapp-result--site_faq {
  --mini-accent: #168b96;
  --mini-soft: #eafafb;
}

.miniapp-result-modal > .miniapp-result-heading .card-art {
  color: var(--mini-accent, var(--accent));
  background: var(--mini-soft, var(--surface-muted));
  border-color: color-mix(in srgb, var(--mini-accent, var(--accent)) 22%, white);
}

.miniapp-intake-header {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  padding-right: 42px;
}

.miniapp-intake-header .card-art {
  flex: 0 0 auto;
  color: var(--mini-accent);
  background: var(--mini-soft);
  border-color: color-mix(in srgb, var(--mini-accent) 22%, white);
}

.miniapp-kicker {
  display: block;
  margin: 2px 0 5px;
  color: var(--mini-accent);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.miniapp-intake-header h2 {
  margin: 0 0 5px;
}

.miniapp-intake-header .modal-intro {
  margin: 0;
}

.miniapp-workflow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--mini-accent) 18%, var(--line));
  border-radius: 14px;
  background: var(--mini-soft);
}

.miniapp-step {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.miniapp-step b {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  color: var(--muted);
  font-size: 11px;
}

.miniapp-step.is-current {
  color: var(--mini-accent);
}

.miniapp-step.is-current b {
  background: var(--mini-accent);
  color: #ffffff;
}

.miniapp-presets {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
}

.miniapp-presets > span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 12px;
  font-weight: 820;
}

.miniapp-presets > span .icon {
  color: var(--mini-accent);
}

.miniapp-presets > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.miniapp-preset {
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid color-mix(in srgb, var(--mini-accent) 28%, var(--line));
  border-radius: 999px;
  background: var(--mini-soft);
  color: var(--mini-accent);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.miniapp-preset:hover,
.miniapp-preset:focus-visible {
  border-color: var(--mini-accent);
  background: #ffffff;
}

.miniapp-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.miniapp-field {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.miniapp-field--wide {
  grid-column: 1 / -1;
}

.miniapp-field-label,
.miniapp-fieldset legend {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: var(--text);
  font-size: 12px;
  font-weight: 820;
}

.miniapp-field-label small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.miniapp-field input,
.miniapp-field select,
.miniapp-field textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfbfa;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: 0;
}

.miniapp-field textarea {
  min-height: 96px;
  resize: vertical;
}

.miniapp-field input:focus,
.miniapp-field select:focus,
.miniapp-field textarea:focus {
  border-color: var(--mini-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mini-accent) 14%, transparent);
}

.miniapp-fieldset legend {
  width: 100%;
  margin-bottom: 7px;
}

.miniapp-choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.miniapp-choice {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #ffffff;
  color: var(--text);
  font-size: 12px;
  font-weight: 740;
  cursor: pointer;
}

.miniapp-choice:has(input:checked) {
  border-color: var(--mini-accent);
  background: var(--mini-soft);
  color: var(--mini-accent);
}

.miniapp-choice input {
  width: 15px;
  height: 15px;
  min-height: 0;
  margin: 0;
  accent-color: var(--mini-accent);
}

.miniapp-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.miniapp-form-footer > span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.miniapp-form-footer > span .icon {
  color: var(--mini-accent);
}

.miniapp-result-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-right: 36px;
}

.miniapp-result-heading h2 {
  margin: 0 0 4px;
}

.miniapp-result-heading .modal-intro {
  margin: 0;
}

.miniapp-result-output {
  max-height: min(52vh, 520px);
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfefd;
  scrollbar-width: thin;
}

.miniapp-result-output .message-content {
  margin: 0;
}

.miniapp-result-visual {
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
}

.miniapp-result-visual .mini-head {
  margin-bottom: 12px;
}

.miniapp-result-raw {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.miniapp-result-raw summary {
  padding: 12px 0 2px;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.miniapp-result-raw > div {
  padding-top: 10px;
}

.miniapp-result-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.miniapp-result-meta span:first-child {
  color: var(--success, #087f5b);
  font-weight: 800;
}

.miniapp-result-actions {
  flex-wrap: wrap;
}

.modal-loading {
  text-align: center;
  align-items: center;
}

.modal-loading-art {
  margin: 0 auto 8px;
}

.modal-loading h2 {
  margin-bottom: 8px;
}

.modal-loading .modal-intro {
  max-width: 440px;
  margin: 0 auto;
}

.modal-loading-bar {
  width: min(100%, 360px);
  height: 6px;
  overflow: hidden;
  margin: 22px auto 14px;
  border-radius: 999px;
  background: var(--surface-muted, #edf3f2);
}

.modal-loading-bar span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent, #18b6d9);
  animation: novis-loading 1.2s ease-in-out infinite;
}

.modal-loading-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

@keyframes novis-loading {
  0% { transform: translateX(-115%); }
  50% { transform: translateX(135%); }
  100% { transform: translateX(250%); }
}

.modal-intro {
  max-width: 640px;
  margin: -4px 0 2px;
  color: var(--muted);
  line-height: 1.5;
}

.modal-close {
  position: absolute;
  top: 13px;
  right: 13px;
}

.modal label {
  display: grid;
  gap: 8px;
  font-weight: 800;
}

.modal input,
.modal textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px 13px;
  outline: none;
  color: var(--text);
  background: var(--control);
}

.modal textarea {
  min-height: 110px;
  resize: vertical;
}

.detail-backdrop {
  place-items: center;
  padding: 28px;
  background: rgba(14, 14, 16, 0.18);
}

.detail-modal {
  position: relative;
  display: grid;
  gap: 18px;
  width: min(980px, 100%);
  max-height: min(860px, calc(100dvh - 56px));
  overflow: auto;
  padding: 24px;
  border: 1px solid rgba(17, 17, 17, 0.07);
  border-radius: 38px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.04),
    0 34px 90px rgba(0, 0, 0, 0.16);
}

.detail-hero {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 8px 46px 18px 4px;
  border-bottom: 1px solid var(--line);
}

.detail-hero .card-art {
  width: 74px;
  height: 74px;
  margin: 0;
  border-radius: 24px;
}

.detail-kicker {
  display: inline-flex;
  margin-bottom: 5px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 820;
}

.detail-hero h2 {
  font-size: clamp(28px, 2.4vw, 44px);
  line-height: 1.02;
}

.detail-hero p {
  max-width: 720px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 16px;
}

.detail-body {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(280px, 0.82fr);
  gap: 14px;
}

.detail-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(17, 17, 17, 0.065);
  border-radius: 28px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.detail-panel--preview {
  grid-row: span 2;
}

.detail-panel--actions {
  background: #fbfbfa;
}

.detail-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.detail-panel-head span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 780;
}

.detail-preview-table {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fafafa;
}

.detail-preview-table > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px 82px;
  gap: 10px;
  align-items: center;
  min-height: 52px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

.detail-preview-table > div:last-child {
  border-bottom: 0;
}

.detail-preview-table strong,
.detail-preview-table b {
  color: var(--text);
}

.detail-preview-table span {
  color: var(--muted);
}

.detail-message-preview,
.detail-preview-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: #fafafa;
}

.activity-preview {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: #fafafa;
}

.activity-preview-top {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.activity-preview-top p {
  margin-top: 4px;
  color: var(--muted);
}

.activity-steps {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.activity-steps span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.data-preview,
.chunk-list {
  display: grid;
  gap: 12px;
}

.chunk-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
}

.chunk-card strong {
  color: var(--text);
  font-size: 13px;
}

.chunk-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.48;
}

.activity-steps .icon {
  color: var(--accent);
}

.detail-message-preview p,
.detail-preview-card p {
  color: var(--muted);
}

.detail-message-preview span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--green);
  background: var(--mint);
  font-weight: 780;
}

.detail-preview-card {
  grid-template-columns: 70px minmax(0, 1fr);
  align-items: center;
}

.detail-preview-card .card-art {
  width: 64px;
  height: 64px;
  margin: 0;
}

.detail-preview-lines {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
}

.detail-preview-lines i {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: #e4e0da;
}

.detail-preview-lines i:nth-child(2) {
  width: 74%;
}

.detail-preview-lines i:nth-child(3) {
  width: 48%;
}

.detail-list-rich {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.detail-list-rich li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  color: var(--muted);
}

.detail-list-rich .icon {
  width: 30px;
  height: 30px;
  padding: 7px;
  border-radius: 999px;
  color: var(--green);
  background: var(--mint);
}

.detail-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.detail-stats span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(17, 17, 17, 0.055);
  border-radius: 20px;
  background: #fafafa;
}

.detail-stats strong {
  overflow: hidden;
  color: var(--text);
  font-size: 19px;
  line-height: 1.08;
  text-overflow: ellipsis;
}

.detail-stats small {
  color: var(--muted);
}

.detail-result {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid rgba(0, 155, 109, 0.15);
  border-radius: 22px;
  color: var(--text);
  background: var(--accent-soft);
}

.detail-result .icon {
  color: var(--accent);
}

.detail-result small {
  color: var(--muted);
  white-space: nowrap;
}

.detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.detail-actions .btn--quiet {
  grid-column: 1 / -1;
}

@media (hover: hover) {
  .nav-pill:hover,
  .filter-pill:hover,
  .select-button:hover,
  .btn:hover,
  .composer-tools button:hover,
  .quick-row button:hover,
  .owned-actions button:hover,
  .resource-actions button:hover,
  .icon-button:hover,
  .profile-button:hover,
  .list-row:hover,
  .validation-row:hover {
    transform: translateY(-2px);
    border-color: rgba(17, 17, 17, 0.08);
    box-shadow: var(--shadow-soft);
  }

  .nav-pill:not(.is-active):hover {
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.025), 0 8px 18px rgba(0, 0, 0, 0.045);
  }

  .filter-pill:not(.is-active):hover,
  .btn--outline:hover,
  .btn--quiet:hover,
  .composer-tools button:hover,
  .quick-row button:hover,
  .owned-actions button:hover,
  .resource-actions button:hover {
    background: #ffffff;
  }

  .section-head--outside:hover h2 {
    color: var(--accent);
    transform: translateX(2px);
    text-shadow: 0 10px 30px var(--accent-soft);
  }

  .section-head--outside:hover h2::after {
    opacity: 0.92;
    transform: translateY(-50%) scale(1.08);
  }

  .section-head--outside:hover .ghost-link {
    transform: translateY(-1px);
    border-color: rgba(17, 17, 17, 0.1);
    box-shadow: var(--shadow-soft);
  }

  .dark-card:hover,
  .owned-card:hover,
  .result-card:hover,
  .import-card:hover,
  .add-card:hover {
    transform: translateY(-3px) scale(1.005);
    box-shadow: var(--shadow-lift);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .core-orb {
    animation: orb-pulse 5.8s ease-in-out infinite;
  }

  .orbit-a {
    animation: orbit-drift-a 18s linear infinite;
  }

  .orbit-b {
    animation: orbit-drift-b 22s linear infinite;
  }
}

@keyframes orb-pulse {
  0%,
  100% {
    filter: saturate(1);
    transform: translate(-50%, -50%) scale(1);
  }

  50% {
    filter: saturate(1.18);
    transform: translate(-50%, -50%) scale(1.035);
  }
}

@keyframes orbit-drift-a {
  to {
    transform: translate(-50%, -50%) rotate(342deg);
  }
}

@keyframes orbit-drift-b {
  to {
    transform: translate(-50%, -50%) rotate(380deg);
  }
}

@media (max-width: 1460px) {
  .topbar {
    grid-template-columns: auto minmax(0, 1fr) minmax(210px, 310px);
  }

  .brand-block {
    justify-content: flex-start;
  }

  .crumb {
    display: none;
  }

  .main-nav {
    grid-column: auto;
    justify-content: flex-start;
  }

  .nav-pill {
    min-height: 38px;
    padding: 0 11px;
    font-size: 12px;
  }

  .top-actions {
    grid-column: auto;
    grid-template-columns: 42px 42px auto;
  }

  .top-actions .search-shell {
    width: 42px;
    min-height: 42px;
    padding: 0;
    justify-content: center;
  }

  .top-actions .search-shell input {
    display: none;
  }

  .workspace {
    grid-template-columns: minmax(0, 1fr) minmax(330px, 380px);
  }

  .activity-row {
    grid-template-columns: 58px 42px minmax(0, 1fr) minmax(150px, 240px) 42px;
    grid-template-areas:
      "time dot body status menu"
      "time dot body category menu"
      ". . progress progress menu"
      ". . action action menu";
  }
}

@media (max-width: 1180px) {
  #app {
    padding: 12px;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 390px);
    margin: -4px 0 14px;
    padding: 12px;
  }

  .main-nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .top-actions {
    grid-column: 2;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .workspace-side {
    grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
  }

  .hero-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-page="settings"] .hero-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-page="settings"] .metric-row {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .orb-scene {
    min-height: 190px;
    order: -1;
  }

  .toolbar {
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
  }

  .toolbar .inline-search {
    grid-column: 1 / -1;
  }

  .toolbar .filter-scroll {
    grid-column: 1;
  }

  .toolbar .select-button {
    grid-column: 2;
    width: auto;
  }

  .toolbar > .icon-button {
    grid-column: 3;
    width: 44px;
  }

  .resource-top {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .resource-top .status {
    grid-column: 2;
    justify-self: start;
  }

  .template-row,
  .skill-search-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .template-row .status,
  .template-row .row-actions {
    grid-column: 2;
    justify-self: start;
  }

  .split-row,
  .behavior-grid {
    grid-template-columns: 1fr;
  }

  .settings-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  }

  .runtime-grid,
  .tenant-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  }

  .activity-row {
    grid-template-columns: 56px 44px minmax(0, 1fr) auto;
    grid-template-areas:
      "time dot body menu"
      "time dot body status"
      ". . progress progress"
      ". . action action";
  }

  .detail-body {
    grid-template-columns: 1fr;
  }

  .detail-panel--preview {
    grid-row: auto;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 13px;
  }

  .topbar {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .brand-block,
  .top-actions,
  .main-nav {
    grid-column: 1;
  }

  .logo-button {
    font-size: 30px;
  }

  .crumb {
    max-width: 46vw;
  }

  .main-nav {
    gap: 7px;
    padding: 3px 0 6px;
  }

  .nav-pill {
    min-height: 36px;
    padding: 0 11px;
    font-size: 13px;
  }

  .top-actions {
    grid-template-columns: minmax(0, 1fr) 40px 40px;
  }

  .toolbar {
    grid-template-columns: minmax(0, 1fr) 44px;
  }

  .toolbar .inline-search,
  .toolbar .filter-scroll {
    grid-column: 1 / -1;
  }

  .toolbar .select-button {
    grid-column: 1;
    justify-self: start;
    max-width: 100%;
  }

  .toolbar > .icon-button {
    grid-column: 2;
    width: 44px;
  }

  .profile-button {
    width: 40px;
    padding: 0;
  }

  .profile-button span:not(.avatar),
  .profile-button .icon {
    display: none;
  }

  .search-shell,
  .inline-search,
  .icon-button {
    min-height: 40px;
  }

  h1 {
    font-size: clamp(28px, 9vw, 36px);
  }

  h2 {
    font-size: 18px;
  }

  .hero-copy {
    padding: 22px 16px 18px;
  }

  .hero-actions,
  .dual-actions,
  .widget-actions,
  .surface-footer,
  .owned-actions,
  .resource-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .metric-row,
  .today-grid,
  .card-grid,
  .card-grid--compact,
  .memory-grid,
  .settings-grid,
  .runtime-grid,
  .tenant-grid,
  .validation-grid,
  .quality-grid,
  .confirm-grid,
  .compact-list,
  .workspace-side {
    grid-template-columns: 1fr;
  }

  .metric-row {
    display: grid;
  }

  .metric,
  .metric:first-child,
  .metric:last-child {
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.86);
  }

  .dark-card,
  .add-card,
  .result-card,
  .owned-card,
  .import-card {
    min-height: 168px;
    padding: 18px;
    border-radius: 24px;
  }

  .orb-scene {
    min-height: 132px;
  }

  .core-orb {
    width: 86px;
    height: 86px;
  }

  .orbit,
  .orbit-b,
  .orbit-c {
    width: 230px;
    height: 88px;
  }

  .orbit-tile {
    display: none;
  }

  .chat-stream {
    padding-left: 0;
  }

  .chat-panel > .section-head {
    display: none;
  }

  .chat-panel .chat-stream {
    height: min(56vh, 620px);
    padding: 16px;
  }

  .chat-dock {
    margin: 0 14px 14px;
    padding: 14px;
    border-radius: 26px;
  }

  .chat-dock .composer-box {
    min-height: 164px;
    padding: 14px 14px 78px;
  }

  .timeline-line,
  .chat-message time {
    display: none;
  }

  .chat-message {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 9px;
    width: 100%;
  }

  .message-avatar {
    width: 36px;
    height: 36px;
    margin-top: 8px;
  }

  .message-card,
  .chat-message--user .message-card {
    max-width: none;
    min-height: 0;
    padding: 13px;
  }

  .message-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .compare-grid,
  .selected-card,
  .memory-card,
  .white-card,
  .confirm-card {
    grid-template-columns: 1fr;
  }

  .setting-card {
    grid-template-columns: 1fr;
    grid-template-areas:
      "icon"
      "body"
      "action";
    min-height: 0;
  }

  .memory-card > .status {
    grid-column: 1;
  }

  .memory-card footer {
    grid-template-columns: 1fr;
  }

  .composer-box {
    min-height: 148px;
    padding-right: 14px;
    padding-bottom: 78px;
  }

  .composer-tools {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .send-button {
    left: 14px;
    right: auto;
  }

  .quick-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .activity-row {
    grid-template-columns: 42px minmax(0, 1fr) 40px;
    grid-template-areas:
      "time status menu"
      "dot body body"
      "progress progress progress"
      "action action action";
    align-items: start;
    min-height: 0;
  }

  .activity-row time {
    grid-area: time;
  }

  .activity-dot {
    grid-area: dot;
    width: 38px;
    height: 38px;
  }

  .activity-row > div:not(.progress-line) {
    grid-area: body;
  }

  .activity-row em {
    display: none;
  }

  .activity-row .progress-line {
    grid-area: progress;
  }

  .activity-row .btn {
    grid-area: action;
    justify-self: stretch;
    max-width: none;
  }

  .activity-row .icon-button {
    grid-area: menu;
  }

  .horizontal-cards {
    grid-auto-columns: minmax(260px, 82vw);
  }

  .toast-stack {
    right: 10px;
    bottom: 10px;
    left: 10px;
  }

  .toast {
    min-width: 0;
  }

  .detail-backdrop {
    padding: 12px;
  }

  .detail-modal {
    max-height: calc(100dvh - 24px);
    padding: 16px;
    border-radius: 28px;
  }

  .detail-hero {
    grid-template-columns: 58px minmax(0, 1fr);
    padding-right: 40px;
  }

  .detail-hero .status {
    grid-column: 2;
    justify-self: start;
  }

  .detail-hero .card-art {
    width: 56px;
    height: 56px;
    border-radius: 20px;
  }

  .detail-stats,
  .detail-actions,
  .detail-preview-table > div {
    grid-template-columns: 1fr;
  }

  .detail-actions .btn--quiet {
    grid-column: auto;
  }

  .detail-result {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .detail-result small {
    grid-column: 2;
  }
}

@media (max-width: 760px) {
  .skill-detail-columns,
  .directive-grid {
    grid-template-columns: 1fr;
  }

  .directive-grid__wide {
    grid-column: auto;
  }

  .message-action-label {
    display: none;
  }

  .message-actions button {
    width: 34px;
    padding: 0;
  }
}

@media (max-width: 420px) {
  .nav-pill span {
    display: none;
  }

  .nav-pill {
    width: 38px;
    padding: 0;
  }

  .composer-tools {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .miniapp-form-grid {
    grid-template-columns: 1fr;
  }

  .miniapp-field--wide {
    grid-column: auto;
  }

  .miniapp-form-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .miniapp-form-footer .dual-actions {
    width: 100%;
  }

  .miniapp-form-footer .btn {
    flex: 1;
  }
}
