:root {
  --bg-0: #050b09;
  --bg-1: #0a1612;
  --ink: #d8f5e8;
  --ink-soft: #9fcbb8;
  --muted: #6f9a88;
  --line: rgba(57, 255, 170, 0.18);
  --panel: rgba(8, 22, 18, 0.78);
  --panel-solid: #0c1a16;
  --accent: #39ffaa;
  --accent-deep: #18c980;
  --accent-soft: rgba(57, 255, 170, 0.12);
  --warn: #ff7a45;
  --user-bg: linear-gradient(145deg, #0f2f26 0%, #123d31 55%, #0c241d 100%);
  --user-ink: #e8fff5;
  --bot-bg: linear-gradient(160deg, rgba(10, 28, 22, 0.96), rgba(7, 18, 15, 0.92));
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --glow: 0 0 0 1px rgba(57, 255, 170, 0.22), 0 0 24px rgba(57, 255, 170, 0.12), 0 18px 40px rgba(0, 0, 0, 0.4);
  --glow-strong: 0 0 0 1px rgba(57, 255, 170, 0.4), 0 0 28px rgba(57, 255, 170, 0.22), 0 22px 48px rgba(0, 0, 0, 0.5);
  --radius: 18px;
  --font-brand: "Syne", sans-serif;
  --font-body: "Figtree", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg-0);
  overflow: hidden;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(57, 255, 170, 0.16), transparent 55%),
    radial-gradient(700px 480px at 95% 8%, rgba(24, 201, 128, 0.1), transparent 50%),
    radial-gradient(800px 500px at 50% 110%, rgba(10, 60, 45, 0.45), transparent 55%),
    linear-gradient(165deg, #040807, #081410 45%, #050b09);
}

.atmosphere::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(57, 255, 170, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(57, 255, 170, 0.08) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(circle at 45% 20%, black, transparent 78%);
  animation: gridDrift 28s linear infinite;
}

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.14) 0 1px,
    transparent 1px 3px
  );
  opacity: 0.22;
  mix-blend-mode: soft-light;
}

.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 100dvh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(8, 22, 18, 0.92), rgba(5, 14, 11, 0.88));
  backdrop-filter: blur(16px);
  box-shadow: inset -1px 0 0 rgba(57, 255, 170, 0.08), 8px 0 40px rgba(0, 0, 0, 0.25);
  min-height: 0;
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

/* Animated border angle (NOT element rotate — avoids propeller look) */
@property --disco-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@property --item-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

/* ===== Profile: forced circle + disco rim light ===== */
.profile-wrap {
  --profile-size: 44px;
  --rim: 3px;
  --disco-angle: 0deg;
  position: relative;
  flex: 0 0 var(--profile-size);
  width: var(--profile-size);
  height: var(--profile-size);
  min-width: var(--profile-size);
  min-height: var(--profile-size);
  border-radius: 9999px;
  display: block;
  isolation: isolate;
  animation: profileFloat 4.8s ease-in-out infinite;
}

.profile-wrap--sm {
  --profile-size: 34px;
  --rim: 2px;
}

.profile-wrap--lg {
  --profile-size: 58px;
  --rim: 3px;
}

.profile-wrap--hero {
  --profile-size: 110px;
  --rim: 4px;
}

.profile-glow {
  position: absolute;
  inset: -18px;
  border-radius: 9999px;
  background: radial-gradient(circle, rgba(57, 255, 170, 0.4) 0%, rgba(0, 212, 255, 0.15) 40%, transparent 70%);
  filter: blur(12px);
  z-index: 0;
  pointer-events: none;
  animation: profilePulse 2.6s ease-in-out infinite;
}

/* Rim-only light: gradient angle animates, shape stays fixed */
.profile-disco {
  position: absolute;
  inset: calc(var(--rim) * -1.35);
  border-radius: 9999px;
  z-index: 1;
  pointer-events: none;
  padding: var(--rim);
  box-sizing: border-box;
  background: conic-gradient(
    from var(--disco-angle),
    #39ffaa 0deg,
    #00e5ff 60deg,
    #7c5cff 120deg,
    #ff4d6d 180deg,
    #ffd60a 240deg,
    #39ffaa 300deg,
    #00e5ff 360deg
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  box-shadow:
    0 0 16px rgba(57, 255, 170, 0.4),
    0 0 28px rgba(0, 229, 255, 0.22);
  animation: discoAngle 2.4s linear infinite;
}

.profile-disco::before,
.profile-disco::after {
  display: none;
}

.profile-ring {
  display: none;
}

/* Circular photo plate */
.profile-avatar {
  position: absolute;
  inset: var(--rim);
  z-index: 2;
  border-radius: 9999px;
  overflow: hidden;
  background: #0a1218;
  box-shadow:
    0 0 0 1px rgba(57, 255, 170, 0.25),
    0 8px 22px rgba(0, 0, 0, 0.5),
    0 0 26px rgba(57, 255, 170, 0.2);
}

.profile-photo,
.profile-avatar img,
img.profile-photo {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover !important;
  object-position: center center !important;
  border-radius: 9999px !important;
  border: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #0a1218;
}

.profile-wrap:hover .profile-disco {
  animation-duration: 1.1s;
  box-shadow:
    0 0 22px rgba(57, 255, 170, 0.6),
    0 0 36px rgba(0, 229, 255, 0.35);
}

.profile-wrap:hover .profile-avatar {
  box-shadow:
    0 0 0 1px rgba(57, 255, 170, 0.5),
    0 10px 28px rgba(0, 0, 0, 0.55),
    0 0 40px rgba(57, 255, 170, 0.35);
}

.profile-status {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 4;
  width: 12px;
  height: 12px;
  border-radius: 9999px;
  background: #39ffaa;
  border: 2px solid #06140f;
  box-shadow: 0 0 10px rgba(57, 255, 170, 0.85);
  animation: statusBlink 2.2s ease-in-out infinite;
}

.profile-wrap--sm .profile-status {
  width: 9px;
  height: 9px;
  border-width: 1.5px;
}

.profile-wrap--hero .profile-status {
  width: 16px;
  height: 16px;
  right: 4px;
  bottom: 4px;
}

.welcome-avatar {
  display: flex;
  justify-content: center;
  margin: 0 0 1.1rem;
}

.message-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding-inline: 0.1rem;
}

.message-avatar {
  --profile-size: 30px;
  --rim: 2px;
}

.message.assistant .message-head .message-role::before {
  content: none;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #072018;
  color: var(--accent);
  border: 1px solid rgba(57, 255, 170, 0.35);
  box-shadow: 0 0 18px rgba(57, 255, 170, 0.25);
  font-family: var(--font-brand);
  font-weight: 800;
  font-size: 1.25rem;
  animation: markPulse 3.2s ease-in-out infinite;
}

.brand-name {
  margin: 0;
  font-family: var(--font-brand);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  line-height: 1;
  color: #e9fff5;
  text-shadow: 0 0 18px rgba(57, 255, 170, 0.25);
}

.brand-tag {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-family: var(--font-mono);
}

.sidebar-nav {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.35rem;
  flex-shrink: 0;
}

.history-panel {
  --disco-rim: 2px;
  --disco-radius: 16px;
  --disco-angle: 0deg;
  --hx: #ff2a6d;
  --hy: #05d9e8;
  --hz: #fee440;
  --hp: #9d4edd;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  margin-top: 0.35rem;
  border-radius: var(--disco-radius);
  isolation: isolate;
}

.history-disco {
  position: absolute;
  inset: -2px;
  z-index: 0;
  pointer-events: none;
  border-radius: 18px;
  padding: var(--disco-rim);
  box-sizing: border-box;
  background: conic-gradient(
    from var(--disco-angle),
    var(--hx) 0deg,
    var(--hy) 70deg,
    var(--hp) 140deg,
    var(--hz) 210deg,
    var(--hx) 280deg,
    var(--hy) 360deg
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  box-shadow:
    0 0 16px rgba(255, 42, 109, 0.28),
    0 0 28px rgba(5, 217, 232, 0.18);
  animation: discoAngle 3s linear infinite;
}

.history-panel-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  border-radius: var(--disco-radius);
  background:
    linear-gradient(180deg, rgba(12, 8, 18, 0.96), rgba(6, 10, 16, 0.94));
  box-shadow:
    inset 0 0 0 1px rgba(5, 217, 232, 0.08),
    0 14px 30px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.history-scan {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    repeating-linear-gradient(
      0deg,
      transparent 0 2px,
      rgba(5, 217, 232, 0.03) 2px 3px
    );
  mix-blend-mode: screen;
  opacity: 0.55;
}

.history-scan::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 28%;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(255, 42, 109, 0.08),
    rgba(5, 217, 232, 0.12),
    transparent
  );
  animation: historySweep 4.2s ease-in-out infinite;
}

.history-head {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 0.85rem 0.55rem;
  border-bottom: 1px solid rgba(5, 217, 232, 0.14);
  background: linear-gradient(90deg, rgba(255, 42, 109, 0.08), transparent 55%);
}

.history-label {
  margin: 0;
  color: var(--hy);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  text-shadow: 0 0 12px rgba(5, 217, 232, 0.35);
}

.history-cursor {
  display: inline-block;
  color: var(--hx);
  animation: historyBlink 1s steps(1) infinite;
  text-shadow: 0 0 10px rgba(255, 42, 109, 0.8);
}

.history-refresh {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(5, 217, 232, 0.28);
  background: rgba(5, 217, 232, 0.06);
  color: var(--hy);
  cursor: pointer;
  font: inherit;
  line-height: 1;
  box-shadow: 0 0 12px rgba(5, 217, 232, 0.12);
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.history-refresh:hover {
  background: rgba(255, 42, 109, 0.14);
  border-color: rgba(255, 42, 109, 0.4);
  color: #ff8fb3;
  box-shadow: 0 0 16px rgba(255, 42, 109, 0.25);
  transform: rotate(90deg);
}

.history-list {
  position: relative;
  z-index: 3;
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  display: grid;
  gap: 0.45rem;
  align-content: start;
}

.history-empty {
  margin: 0.7rem 0.45rem;
  color: rgba(5, 217, 232, 0.55);
  font-size: 0.78rem;
  line-height: 1.5;
  font-family: var(--font-mono);
}

.history-item {
  --item-angle: 0deg;
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem;
  align-items: start;
  width: 100%;
  text-align: left;
  padding: 2px;
  border-radius: 12px;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  isolation: isolate;
  transition: transform 0.18s ease;
}

.history-item-glow {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  padding: 1px;
  box-sizing: border-box;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
  background: conic-gradient(
    from var(--item-angle),
    transparent 0deg,
    var(--hy) 40deg,
    transparent 80deg,
    var(--hx) 160deg,
    transparent 200deg,
    var(--hz) 280deg,
    transparent 320deg,
    var(--hy) 360deg
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  transition: opacity 0.2s ease;
}

.history-item:hover .history-item-glow,
.history-item.active .history-item-glow {
  opacity: 1;
  animation: historyItemAngle 2.2s linear infinite;
}

.history-item-body {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem;
  align-items: start;
  width: 100%;
  padding: 0.62rem 0.68rem;
  border-radius: 11px;
  background: rgba(8, 12, 20, 0.92);
  border: 1px solid rgba(5, 217, 232, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 42, 109, 0.04);
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.history-item:hover {
  transform: translateX(2px);
}

.history-item:hover .history-item-body {
  background: rgba(14, 10, 22, 0.96);
  border-color: rgba(5, 217, 232, 0.28);
  box-shadow:
    inset 0 0 0 1px rgba(255, 42, 109, 0.08),
    0 0 18px rgba(5, 217, 232, 0.12);
}

.history-item.active .history-item-body {
  background: linear-gradient(135deg, rgba(28, 8, 24, 0.98), rgba(8, 18, 28, 0.96));
  border-color: rgba(255, 42, 109, 0.4);
  box-shadow:
    inset 3px 0 0 var(--hx),
    0 0 22px rgba(255, 42, 109, 0.18),
    0 0 18px rgba(5, 217, 232, 0.1);
}

.history-item-main {
  min-width: 0;
}

.history-item-title {
  display: block;
  font-size: 0.86rem;
  font-weight: 650;
  color: #eafcff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item.active .history-item-title {
  color: #fff;
  text-shadow: 0 0 12px rgba(255, 42, 109, 0.35);
}

.history-item-meta {
  display: block;
  margin-top: 0.18rem;
  color: rgba(5, 217, 232, 0.62);
  font-size: 0.7rem;
  font-family: var(--font-mono);
}

.history-item-del {
  position: relative;
  z-index: 2;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 150, 120, 0.75);
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  opacity: 0.55;
}

.history-item:hover .history-item-del,
.history-item.active .history-item-del {
  opacity: 1;
}

.history-item-del:hover {
  background: rgba(255, 42, 109, 0.16);
  color: #ffb3c7;
}

.chip-danger {
  border-color: rgba(255, 122, 69, 0.35);
  background: rgba(255, 122, 69, 0.08);
  color: #ffb39a;
}

.chip-danger:hover {
  background: rgba(255, 122, 69, 0.16);
  box-shadow: 0 0 18px rgba(255, 122, 69, 0.18);
}

.nav-item {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 0.75rem;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 0.8rem 0.85rem;
  border-radius: 16px;
  border: 1px solid rgba(57, 255, 170, 0.14);
  background: rgba(5, 16, 13, 0.72);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.nav-item:hover,
.nav-item.is-active {
  transform: translateY(-1px);
  border-color: rgba(57, 255, 170, 0.4);
  background: linear-gradient(145deg, rgba(14, 40, 31, 0.95), rgba(8, 24, 19, 0.9));
  box-shadow: 0 0 22px rgba(57, 255, 170, 0.14), 0 14px 28px rgba(0, 0, 0, 0.3);
}

.nav-ico {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(57, 255, 170, 0.08);
  border: 1px solid rgba(57, 255, 170, 0.22);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 1.05rem;
  box-shadow: 0 0 14px rgba(57, 255, 170, 0.1);
  flex: 0 0 auto;
}

.nav-ico--svg svg {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}

.nav-item strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  color: #e9fff5;
}

.nav-item small {
  display: block;
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.nav-item-copy {
  min-width: 0;
}

.sidebar-foot {
  margin-top: 0;
  flex-shrink: 0;
  padding: 0.85rem 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(57, 255, 170, 0.12);
  background: rgba(4, 14, 11, 0.65);
  box-shadow: inset 0 0 0 1px rgba(57, 255, 170, 0.04);
  display: grid;
  gap: 0.65rem;
}

.owner-link {
  --disco-angle: 0deg;
  position: relative;
  display: block;
  width: 100%;
  border: 0;
  padding: 1.5px;
  border-radius: 14px;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
  text-decoration: none;
  background: transparent;
  isolation: isolate;
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.owner-link-disco {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 0;
  background: conic-gradient(
    from var(--disco-angle),
    #39ffaa,
    #05d9e8,
    #ff2a6d,
    #fee440,
    #39ffaa
  );
  animation: discoAngle 3.2s linear infinite;
  opacity: 0.55;
}

.owner-link-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 0.7rem;
  align-items: center;
  width: 100%;
  border-radius: 13px;
  padding: 0.55rem 0.65rem;
  background:
    linear-gradient(135deg, rgba(8, 22, 20, 0.96), rgba(4, 12, 16, 0.98)),
    rgba(4, 14, 11, 0.95);
  box-shadow: inset 0 0 0 1px rgba(5, 217, 232, 0.08);
}

.owner-avatar {
  position: relative;
  width: 32px;
  height: 32px;
}

.owner-avatar img {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  object-fit: cover;
  display: block;
  box-shadow: 0 0 0 1px rgba(255, 42, 109, 0.4), 0 0 14px rgba(5, 217, 232, 0.25);
}

.owner-pulse {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #39ffaa;
  box-shadow: 0 0 0 2px #06140f, 0 0 10px rgba(57, 255, 170, 0.8);
  animation: statusBlink 1.6s ease-in-out infinite;
}

.owner-link-text strong {
  display: block;
  font-size: 0.82rem;
  color: #eafcff;
  letter-spacing: 0.01em;
}

.owner-link-text small {
  display: block;
  margin-top: 0.12rem;
  color: rgba(5, 217, 232, 0.72);
  font-size: 0.68rem;
  font-family: var(--font-mono);
}

.owner-link-arrow {
  color: rgba(255, 42, 109, 0.75);
  font-size: 0.85rem;
  transition: transform 0.2s ease, color 0.2s ease;
}

.owner-link:hover,
.owner-link:focus-visible {
  transform: translateY(-2px);
  outline: none;
}

.owner-link:hover .owner-link-disco,
.owner-link:focus-visible .owner-link-disco {
  opacity: 0.9;
}

.owner-link:hover .owner-link-arrow,
.owner-link:focus-visible .owner-link-arrow {
  color: #ff6b9a;
  transform: translate(2px, -2px);
}

.owner-fab {
  --disco-angle: 0deg;
  position: relative;
  display: inline-flex;
  border: 0;
  padding: 1.5px;
  border-radius: 999px;
  background: transparent;
  color: #ffd0dc;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  isolation: isolate;
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.owner-fab-disco {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 0;
  background: conic-gradient(
    from var(--disco-angle),
    #ff2a6d,
    #05d9e8,
    #39ffaa,
    #fee440,
    #ff2a6d
  );
  animation: discoAngle 2.8s linear infinite;
  opacity: 0.75;
  box-shadow: 0 0 18px rgba(255, 42, 109, 0.25);
}

.owner-fab-inner {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  border-radius: 999px;
  padding: 0.28rem 0.7rem 0.28rem 0.28rem;
  background: linear-gradient(135deg, rgba(36, 8, 18, 0.95), rgba(8, 16, 22, 0.96));
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.owner-fab img {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  object-fit: cover;
  display: block;
  box-shadow: 0 0 0 1px rgba(5, 217, 232, 0.4);
}

.owner-fab:hover,
.owner-fab:focus-visible {
  transform: translateY(-2px) scale(1.03);
  outline: none;
}

.owner-fab:hover .owner-fab-disco,
.owner-fab:focus-visible .owner-fab-disco {
  opacity: 1;
  box-shadow: 0 0 26px rgba(255, 42, 109, 0.4);
}

.owner-modal[hidden] {
  display: none !important;
  pointer-events: none;
}

.owner-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.owner-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.owner-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background:
    radial-gradient(800px 420px at 50% 20%, rgba(57, 255, 170, 0.08), transparent 60%),
    rgba(2, 6, 8, 0.78);
  backdrop-filter: blur(10px) saturate(1.15);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.owner-modal.is-open .owner-modal-backdrop {
  opacity: 1;
}

.owner-modal-shell {
  --disco-angle: 0deg;
  position: relative;
  z-index: 1;
  width: min(980px, 100%);
  height: min(860px, 92dvh);
  border-radius: 22px;
  padding: 1.5px;
  isolation: isolate;
  transform: translateY(18px) scale(0.97);
  opacity: 0;
  transition:
    transform 0.38s cubic-bezier(0.2, 0.85, 0.2, 1),
    opacity 0.32s ease;
  box-shadow:
    0 0 40px rgba(57, 255, 170, 0.12),
    0 30px 80px rgba(0, 0, 0, 0.55);
}

.owner-modal.is-open .owner-modal-shell {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.owner-modal-disco {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 0;
  background: conic-gradient(
    from var(--disco-angle),
    #39ffaa,
    #05d9e8,
    #ff2a6d,
    #fee440,
    #39ffaa
  );
  animation: discoAngle 4s linear infinite;
  opacity: 0.85;
}

.owner-modal-chrome {
  position: absolute;
  top: 10px;
  left: 12px;
  right: 12px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  pointer-events: none;
}

.owner-modal-title {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(5, 217, 232, 0.22);
  background: rgba(3, 10, 12, 0.78);
  color: rgba(5, 217, 232, 0.9);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.owner-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #39ffaa;
  box-shadow: 0 0 10px rgba(57, 255, 170, 0.8);
  animation: statusBlink 1.4s ease-in-out infinite;
}

.owner-modal-close {
  pointer-events: auto;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255, 42, 109, 0.4);
  background: rgba(255, 42, 109, 0.14);
  color: #ffb3c7;
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  display: grid;
  place-items: center;
  backdrop-filter: blur(8px);
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.owner-modal-close:hover,
.owner-modal-close:focus-visible {
  transform: scale(1.06);
  background: rgba(255, 42, 109, 0.24);
  box-shadow: 0 0 16px rgba(255, 42, 109, 0.28);
  outline: none;
}

.owner-modal-frame {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 21px;
  overflow: hidden;
  background: #03070a;
}

.owner-modal-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #03070a;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.owner-modal-frame.is-ready iframe {
  opacity: 1;
}

.owner-modal-loader {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.85rem;
  background: radial-gradient(600px 320px at 50% 40%, rgba(5, 217, 232, 0.08), #03070a 70%);
  color: rgba(5, 217, 232, 0.85);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.owner-modal-frame.is-ready .owner-modal-loader {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.owner-loader-ring {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 2px solid rgba(5, 217, 232, 0.18);
  border-top-color: #39ffaa;
  border-right-color: #ff2a6d;
  animation: ownerSpin 0.85s linear infinite;
  box-shadow: 0 0 18px rgba(57, 255, 170, 0.2);
}

body.owner-open {
  overflow: hidden;
}

@media (max-width: 860px) {
  .owner-fab-inner span:last-child {
    display: none;
  }
  .owner-fab-inner {
    padding: 0.28rem;
  }
  .owner-modal-shell {
    height: min(920px, 94dvh);
    border-radius: 16px;
  }
  .owner-modal-frame {
    border-radius: 15px;
  }
  .owner-modal-chrome {
    top: 8px;
    left: 8px;
    right: 8px;
  }
}

@keyframes ownerSpin {
  to {
    transform: rotate(360deg);
  }
}

.sidebar-foot-title {
  margin: 0;
  font-family: var(--font-brand);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--accent);
}

.sidebar-foot-sub {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-family: var(--font-mono);
}

.main {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  height: 100dvh;
  position: relative;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 16, 13, 0.78);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  position: relative;
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 1;
}

.topbar-heading {
  min-width: 0;
}

.topbar-heading h1 {
  margin: 0;
}

.topbar-sub {
  display: none;
  margin: 0.12rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: rgba(5, 217, 232, 0.78);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  position: relative;
}

.forum-notify {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.45rem;
  min-height: 2.45rem;
  padding: 0 0.72rem 0 0.62rem;
  border-radius: 999px;
  border: 1px solid rgba(57, 255, 170, 0.22);
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(57, 255, 170, 0.14), transparent 55%),
    rgba(8, 22, 18, 0.88);
  color: #eafff5;
  text-decoration: none;
  flex: 0 0 auto;
  overflow: visible;
  transition:
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.22s ease,
    background 0.22s ease;
}

.forum-notify-inner {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  position: relative;
  z-index: 1;
}

.forum-notify-glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 30% 20%, rgba(57, 255, 170, 0.22), transparent 65%);
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
}

.forum-notify:hover,
.forum-notify:focus-visible {
  border-color: rgba(57, 255, 170, 0.45);
  box-shadow: 0 0 20px rgba(57, 255, 170, 0.22);
  transform: translateY(-1px);
}

.forum-notify:hover .forum-notify-glow,
.forum-notify:focus-visible .forum-notify-glow,
.forum-notify.is-active .forum-notify-glow {
  opacity: 1;
}

.forum-notify.is-active {
  border-color: rgba(255, 42, 109, 0.42);
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(255, 42, 109, 0.16), transparent 55%),
    rgba(8, 22, 18, 0.94);
  box-shadow: 0 0 22px rgba(255, 42, 109, 0.18);
}

.forum-notify-ico {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
  flex: 0 0 auto;
  transition: transform 0.22s ease;
}

.forum-notify-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(233, 255, 245, 0.88);
  white-space: nowrap;
}

.forum-notify.is-active .forum-notify-ico {
  animation: forumNotifyWiggle 0.55s ease;
}

.forum-notify-ring {
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  border: 1px solid rgba(57, 255, 170, 0.35);
  opacity: 0;
  pointer-events: none;
}

.forum-notify.is-active .forum-notify-ring {
  animation: forumNotifyRing 1.8s ease-out infinite;
}

.forum-notify:active {
  transform: scale(0.96);
}

.forum-notify-dot {
  position: absolute;
  top: -0.1rem;
  right: -0.15rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: linear-gradient(145deg, #ff2a6d, #ff6b9d);
  border: 2px solid rgba(5, 16, 13, 0.95);
  box-shadow: 0 0 12px rgba(255, 42, 109, 0.75);
  animation: forumUnreadDotPulse 1.5s ease-out infinite;
}

.forum-unread-badge {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  pointer-events: none;
}

.forum-unread-badge[hidden] {
  display: none !important;
}

.forum-unread-ping {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(255, 42, 109, 0.85);
  animation: forumUnreadPing 1.7s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.forum-unread-count {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-width: 1.38rem;
  height: 1.38rem;
  padding: 0 0.38rem;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  background: linear-gradient(145deg, #ff2a6d 0%, #ff5f93 48%, #ff2a6d 100%);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  box-shadow:
    0 0 0 1px rgba(255, 42, 109, 0.45),
    0 6px 18px rgba(255, 42, 109, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  animation: forumUnreadPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.forum-unread-badge--notify {
  position: absolute;
  top: -0.48rem;
  right: -0.42rem;
  z-index: 4;
}

.forum-unread-badge--nav {
  margin-left: auto;
  align-self: center;
}

.forum-unread-badge--sheet {
  margin-left: auto;
}

.forum-unread-badge--toast {
  flex: 0 0 auto;
}

.forum-unread-badge--toast .forum-unread-count {
  min-width: 1.5rem;
  height: 1.5rem;
  font-size: 0.7rem;
}

#navForumLink {
  position: relative;
  grid-template-columns: 40px minmax(0, 1fr) auto;
}

#navForumLink.has-unread {
  border-color: rgba(255, 42, 109, 0.34);
  background:
    linear-gradient(135deg, rgba(255, 42, 109, 0.1), rgba(57, 255, 170, 0.06)),
    rgba(8, 22, 18, 0.82);
  box-shadow:
    inset 3px 0 0 rgba(255, 42, 109, 0.85),
    0 0 22px rgba(255, 42, 109, 0.12);
}

#navForumLink.has-unread .nav-ico {
  border-color: rgba(255, 42, 109, 0.42);
  color: #ffb8cc;
  box-shadow: 0 0 18px rgba(255, 42, 109, 0.22);
}

#navForumLink.has-unread strong {
  color: #ffe8f0;
}

#topbarForumLink.has-unread {
  background: rgba(255, 42, 109, 0.1);
  border-radius: 10px;
}

#topbarForumLink.has-unread .topbar-sheet-forum-copy::after {
  content: " · belum dibaca";
  color: #ff8fb0;
  font-weight: 500;
}

.forum-unread-pill {
  position: sticky;
  top: 0;
  z-index: 24;
  padding: 0 0.85rem;
  margin-top: -0.15rem;
  animation: forumUnreadPillIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.forum-unread-pill[hidden] {
  display: none !important;
}

.forum-unread-pill-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.62rem 0.85rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 42, 109, 0.32);
  background:
    linear-gradient(120deg, rgba(255, 42, 109, 0.16), rgba(5, 217, 232, 0.08)),
    rgba(6, 16, 13, 0.92);
  backdrop-filter: blur(12px);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.28),
    0 0 24px rgba(255, 42, 109, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.forum-unread-pill-link:hover,
.forum-unread-pill-link:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(255, 42, 109, 0.5);
  box-shadow:
    0 14px 32px rgba(0, 0, 0, 0.32),
    0 0 30px rgba(255, 42, 109, 0.22);
  outline: none;
}

.forum-unread-pill-dot {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
  background: linear-gradient(145deg, #ff2a6d, #ff8fb0);
  box-shadow: 0 0 14px rgba(255, 42, 109, 0.75);
  animation: forumUnreadDotPulse 1.5s ease-out infinite;
  flex: 0 0 auto;
}

.forum-unread-pill-copy {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
}

.forum-unread-pill-copy strong {
  font-family: Syne, Figtree, sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffe8f0;
  line-height: 1;
}

.forum-unread-pill-copy span {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 200, 216, 0.82);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.forum-unread-pill-cta {
  flex: 0 0 auto;
  padding: 0.32rem 0.62rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 42, 109, 0.38);
  background: rgba(255, 42, 109, 0.14);
  color: #ffb8cc;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.forum-inbox-toast {
  position: fixed;
  top: calc(0.85rem + env(safe-area-inset-top, 0px));
  right: calc(0.85rem + env(safe-area-inset-right, 0px));
  z-index: 120;
  width: min(360px, calc(100vw - 1.7rem));
  padding: 1.5px;
  border-radius: 18px;
  isolation: isolate;
  pointer-events: auto;
  animation: forumToastIn 0.42s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.forum-inbox-toast[hidden] {
  display: none !important;
}

.forum-inbox-toast-rim {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: conic-gradient(
    from var(--disco-angle, 0deg),
    #39ffaa,
    #05d9e8,
    #ff2a6d,
    #fee440,
    #39ffaa
  );
  animation: discoAngle 4s linear infinite;
  opacity: 0.75;
  z-index: 0;
}

.forum-inbox-toast-body {
  position: relative;
  z-index: 1;
  padding: 0.85rem 0.95rem 0.9rem;
  border-radius: calc(18px - 1px);
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(5, 217, 232, 0.12), transparent 55%),
    rgba(5, 16, 13, 0.96);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45), 0 0 28px rgba(57, 255, 170, 0.12);
}

.forum-inbox-toast-head {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
}

.forum-inbox-toast-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex: 1;
  min-width: 0;
}

.forum-inbox-toast-live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(57, 255, 170, 0.55);
  animation: forumNotifyPulse 1.8s ease-out infinite;
  flex: 0 0 auto;
}

.forum-inbox-toast-head strong {
  flex: 1;
  font-family: Syne, Figtree, sans-serif;
  font-size: 0.92rem;
  color: #e9fff5;
  line-height: 1.35;
}

.forum-inbox-toast-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.1rem 0.25rem;
}

.forum-inbox-toast-meta {
  margin: 0.45rem 0 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: rgba(5, 217, 232, 0.85);
}

.forum-inbox-toast-preview {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--muted);
}

.forum-inbox-toast-action {
  display: inline-flex;
  margin-top: 0.65rem;
  padding: 0.38rem 0.72rem;
  border-radius: 999px;
  border: 1px solid rgba(57, 255, 170, 0.28);
  background: rgba(57, 255, 170, 0.1);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
}

.forum-inbox-toast-action:hover,
.forum-inbox-toast-action:focus-visible {
  background: rgba(57, 255, 170, 0.18);
  border-color: rgba(57, 255, 170, 0.45);
}

@keyframes forumUnreadPing {
  0% {
    transform: scale(1);
    opacity: 0.75;
  }
  70% {
    transform: scale(1.85);
    opacity: 0;
  }
  100% {
    transform: scale(1.85);
    opacity: 0;
  }
}

@keyframes forumUnreadPop {
  0% {
    transform: scale(0.4);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes forumUnreadDotPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 42, 109, 0.65);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(255, 42, 109, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 42, 109, 0);
  }
}

@keyframes forumUnreadPillIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes forumNotifyRing {
  0% {
    opacity: 0.85;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.35);
  }
}

@keyframes forumNotifyWiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-8deg); }
  50% { transform: rotate(8deg); }
  75% { transform: rotate(-4deg); }
}

@keyframes forumNotifyPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(57, 255, 170, 0.55);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(57, 255, 170, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(57, 255, 170, 0);
  }
}

@keyframes forumToastIn {
  from {
    opacity: 0;
    transform: translateY(-12px) translateX(8px) scale(0.96);
    filter: blur(3px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .forum-notify.is-active .forum-notify-ring,
  .forum-notify.is-active .forum-notify-ico,
  .forum-unread-ping,
  .forum-unread-count,
  .forum-notify-dot,
  .forum-unread-pill-dot,
  .forum-unread-pill,
  .forum-inbox-toast-live,
  .forum-inbox-toast-rim,
  .forum-inbox-toast {
    animation: none !important;
  }
}

.topbar-mob {
  display: none !important;
}

.topbar-sheet {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0.75rem;
  z-index: 30;
  min-width: 188px;
  padding: 0.4rem;
  border-radius: 14px;
  border: 1px solid rgba(57, 255, 170, 0.22);
  background: rgba(6, 16, 13, 0.96);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45), 0 0 24px rgba(57, 255, 170, 0.1);
  backdrop-filter: blur(14px);
  display: grid;
  gap: 0.2rem;
}

.topbar-sheet[hidden] {
  display: none !important;
}

.topbar-sheet-item {
  appearance: none;
  border: 0;
  background: transparent;
  color: #eafff5;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.topbar-sheet-item:hover,
.topbar-sheet-item:focus-visible {
  background: rgba(57, 255, 170, 0.1);
  outline: none;
}

.topbar-sheet-item.is-danger {
  color: #ffb3c7;
}

.chip-new {
  min-width: 2.35rem;
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
  font-size: 1.1rem;
  line-height: 1;
}

.chip {
  border: 1px solid rgba(57, 255, 170, 0.28);
  background: rgba(57, 255, 170, 0.08);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.38rem 0.75rem;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 0 14px rgba(57, 255, 170, 0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.chip:hover {
  transform: translateY(-1px);
  background: rgba(57, 255, 170, 0.16);
  box-shadow: 0 0 20px rgba(57, 255, 170, 0.22);
}

.topbar h1 {
  margin: 0;
  font-family: var(--font-brand);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #eafff5;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(57, 255, 170, 0.1);
  border: 1px solid rgba(57, 255, 170, 0.28);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono);
  white-space: nowrap;
  box-shadow: 0 0 16px rgba(57, 255, 170, 0.15);
  animation: pillGlow 2.6s ease-in-out infinite;
}

.chat {
  position: relative;
  overflow-y: auto;
  padding: 1.4rem 1.25rem 1.7rem;
  scroll-behavior: smooth;
  background:
    linear-gradient(180deg, rgba(57, 255, 170, 0.03), transparent 18%),
    rgba(3, 10, 8, 0.35);
}

.chat::before {
  content: "";
  pointer-events: none;
  position: sticky;
  top: 0;
  display: block;
  height: 2px;
  margin: -1.4rem -1.25rem 1.2rem;
  background: linear-gradient(90deg, transparent, rgba(57, 255, 170, 0.65), transparent);
  box-shadow: 0 0 18px rgba(57, 255, 170, 0.45);
  animation: scanX 3.5s linear infinite;
  opacity: 0.85;
}

.welcome {
  --disco-rim: 2px;
  --disco-radius: 22px;
  --disco-angle: 0deg;
  max-width: 720px;
  margin: 7vh auto 0;
  position: relative;
  border-radius: var(--disco-radius);
  isolation: isolate;
  animation: terminalBoot 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.welcome-panel {
  position: relative;
  z-index: 1;
  padding: 1.4rem 1.5rem;
  border-radius: var(--disco-radius);
  background: linear-gradient(160deg, rgba(8, 24, 19, 0.96), rgba(5, 14, 11, 0.94));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.welcome-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(57, 255, 170, 0.08) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: sheen 4.5s ease-in-out infinite;
  pointer-events: none;
}

.welcome-kicker {
  margin: 0 0 0.55rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: 0 0 14px rgba(57, 255, 170, 0.35);
}

.welcome-brand {
  margin: 0;
  font-family: var(--font-brand);
  font-size: clamp(2.6rem, 8vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 0.95;
  color: var(--accent);
  text-shadow: 0 0 24px rgba(57, 255, 170, 0.35);
}

.welcome-title {
  margin: 1rem 0 0.5rem;
  font-family: var(--font-brand);
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #f2fff8;
}

.welcome-sub {
  margin: 0;
  max-width: 38rem;
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1.55;
}

.starter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.4rem;
}

.starter {
  border: 1px solid rgba(57, 255, 170, 0.28);
  background: rgba(8, 28, 22, 0.8);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(57, 255, 170, 0.05), 0 8px 22px rgba(0, 0, 0, 0.28);
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.starter:hover {
  transform: translateY(-2px);
  background: rgba(12, 40, 31, 0.95);
  border-color: rgba(57, 255, 170, 0.55);
  box-shadow: 0 0 22px rgba(57, 255, 170, 0.2), 0 12px 28px rgba(0, 0, 0, 0.35);
}

.message {
  display: grid;
  gap: 0.4rem;
  max-width: 820px;
  margin: 0 auto 1.15rem;
  animation: hackIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.message.user {
  justify-items: end;
}

.message.assistant {
  justify-items: start;
}

.message-role {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding-inline: 0.35rem;
  font-family: var(--font-mono);
}

.message.user .message-role {
  color: rgba(57, 255, 170, 0.7);
}

.message.assistant .message-role {
  color: rgba(159, 203, 184, 0.85);
}

.message-role::before {
  content: "> ";
  color: var(--accent);
  opacity: 0.8;
}

/* Disco border frame — angle animates along border, box stays still */
.message-shell,
.disco-frame {
  --disco-rim: 2px;
  --disco-radius: 18px;
  --disco-angle: 0deg;
  position: relative;
  max-width: min(100%, 760px);
  border-radius: var(--disco-radius);
  isolation: isolate;
}

.message.user .message-shell {
  --disco-radius: 18px 18px 6px 18px;
}

.message.assistant .message-shell {
  --disco-radius: 18px 18px 18px 6px;
}

.welcome,
.composer-frame {
  --disco-angle: 0deg;
  border-radius: var(--disco-radius, 18px);
}

.bubble-disco,
.disco-frame > .bubble-disco,
.welcome > .bubble-disco,
.composer-frame > .bubble-disco {
  position: absolute;
  inset: -2px;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  padding: var(--disco-rim, 2px);
  box-sizing: border-box;
  background: conic-gradient(
    from var(--disco-angle),
    #39ffaa 0deg,
    #00e5ff 60deg,
    #7c5cff 120deg,
    #ff4d6d 180deg,
    #ffd60a 240deg,
    #39ffaa 300deg,
    #00e5ff 360deg
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  box-shadow:
    0 0 14px rgba(57, 255, 170, 0.35),
    0 0 26px rgba(0, 229, 255, 0.18);
  animation: discoAngle 2.4s linear infinite;
}

.message.user .message-shell > .bubble-disco {
  border-radius: 20px 20px 8px 20px;
}

.message.assistant .message-shell > .bubble-disco {
  border-radius: 20px 20px 20px 8px;
}

.bubble-disco::before,
.bubble-disco::after {
  display: none;
}

.message-shell:hover .bubble-disco,
.disco-frame:hover > .bubble-disco,
.composer-frame:focus-within > .bubble-disco {
  animation-duration: 1.1s;
  box-shadow:
    0 0 20px rgba(57, 255, 170, 0.5),
    0 0 34px rgba(0, 229, 255, 0.28);
}

.message-bubble {
  position: relative;
  z-index: 1;
  padding: 1rem 1.15rem;
  border-radius: var(--disco-radius, 18px);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  max-width: 100%;
  border: 0;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.message.user .message-bubble {
  background: linear-gradient(145deg, #0f2f26 0%, #123d31 55%, #0c241d 100%);
  color: var(--user-ink);
  border-bottom-right-radius: 6px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.35);
}

.message.assistant .message-bubble {
  background: linear-gradient(160deg, rgba(10, 28, 22, 0.98), rgba(7, 18, 15, 0.96));
  border-bottom-left-radius: 6px;
  white-space: normal;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
}

.message-shell:hover .message-bubble {
  transform: translateY(-1px);
}

.message.assistant .message-bubble .md-text {
  white-space: pre-wrap;
  word-break: break-word;
  color: #d9f6e8;
}

.file-inline-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.file-inline-link:hover {
  color: #05d9e8;
}

/* ./skill-creator — dokumen sheet + pusat unduhan modern */
.message-bubble.has-doc-sheet {
  padding-top: 0.65rem;
}

.doc-sheet {
  margin: 0 0 0.85rem;
  border-radius: 14px;
  border: 1px solid rgba(232, 245, 238, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 28%),
    #0a1612;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.doc-sheet-inner {
  padding: 0.9rem 1rem 1rem;
  max-height: min(42vh, 360px);
  overflow: auto;
  scrollbar-width: thin;
}

.message-bubble.has-delivery {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.message-bubble.has-delivery .doc-sheet {
  order: 0;
  flex: 1 1 auto;
  min-height: 0;
}

.message-bubble.has-delivery .delivery-suite {
  order: 1;
  flex: 0 0 auto;
  margin-top: 0.55rem;
}

.doc-sheet-title {
  margin: 0 0 0.65rem;
  font-family: var(--font-brand);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: #f4fff8;
  font-weight: 800;
}

.doc-sheet-p,
.doc-sheet-line,
.doc-sheet-bullet,
.doc-sheet-table {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #d9f5e8;
}

.doc-sheet-line {
  display: grid;
  grid-template-columns: minmax(7rem, 34%) 1fr;
  gap: 0.45rem;
}

.doc-sheet-k {
  color: rgba(5, 217, 232, 0.92);
  font-weight: 650;
}

.doc-sheet-v {
  color: #eafff5;
  word-break: break-word;
}

.doc-sheet-bullet {
  padding-left: 0.85rem;
  position: relative;
}

.doc-sheet-bullet::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.doc-sheet-table {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #bfe9d5;
  white-space: pre-wrap;
}

.doc-sheet-rule {
  height: 1px;
  margin: 0.7rem 0;
  background: linear-gradient(90deg, transparent, rgba(57, 255, 170, 0.35), transparent);
}

.delivery-suite,
.delivery-suite--pro,
.delivery-suite--slim {
  margin-top: 0.7rem;
  border-radius: 14px;
  border: 1px solid rgba(57, 255, 170, 0.18);
  background: rgba(4, 14, 11, 0.92);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.delivery-suite--slim {
  position: relative;
  z-index: 1;
}

.delivery-head {
  padding: 1rem 1.05rem 0.9rem;
  border-bottom: 1px solid rgba(57, 255, 170, 0.12);
}

.delivery-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.delivery-kicker {
  display: inline-flex;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #04140f;
  background: var(--accent);
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  font-weight: 700;
}

.delivery-kind {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(5, 217, 232, 0.35);
  background: rgba(5, 217, 232, 0.1);
  color: #c9f7ff;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  padding: 0.22rem 0.55rem;
}

.delivery-headline {
  margin: 0.55rem 0 0;
  font-family: var(--font-brand);
  font-size: 1.18rem;
  letter-spacing: -0.02em;
  color: #f2fff8;
  line-height: 1.25;
}

.delivery-request {
  margin: 0.65rem 0 0;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(5, 217, 232, 0.18);
  background: rgba(5, 217, 232, 0.06);
  color: #d8fff0;
  font-size: 0.88rem;
  line-height: 1.45;
}

.delivery-request span {
  display: block;
  margin-bottom: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(5, 217, 232, 0.85);
}

.delivery-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.7rem 0 0;
}

.delivery-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(57, 255, 170, 0.22);
  background: rgba(57, 255, 170, 0.08);
  color: #cfeede;
  font-size: 0.74rem;
  padding: 0.28rem 0.6rem;
}

.delivery-hint {
  margin: 0.65rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: rgba(159, 203, 184, 0.85);
}

.delivery-list {
  display: grid;
  gap: 0;
}

.export-kit {
  padding: 0.9rem 1.05rem 1rem;
  border-top: 1px solid rgba(57, 255, 170, 0.12);
  background: linear-gradient(180deg, rgba(57, 255, 170, 0.06), transparent 70%);
}

.export-kit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
}

.export-kit-label {
  display: grid;
  gap: 0.12rem;
}

.export-kit-label span {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(5, 217, 232, 0.85);
  font-family: var(--font-mono);
}

.export-kit-label strong {
  font-size: 0.95rem;
  color: #eafff5;
  font-weight: 700;
}

.export-kit-pulse {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(57, 255, 170, 0.55);
  animation: exportPulse 1.8s ease-out infinite;
}

@keyframes exportPulse {
  0% { box-shadow: 0 0 0 0 rgba(57, 255, 170, 0.45); }
  70% { box-shadow: 0 0 0 10px rgba(57, 255, 170, 0); }
  100% { box-shadow: 0 0 0 0 rgba(57, 255, 170, 0); }
}

.export-kit-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.export-kit-btn {
  appearance: none;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid rgba(57, 255, 170, 0.28);
  background: rgba(6, 22, 18, 0.92);
  color: #eafff5;
  border-radius: 14px;
  padding: 0.7rem 0.75rem;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.export-kit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(57, 255, 170, 0.65);
  background: rgba(57, 255, 170, 0.12);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
}

.export-kit-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.export-kit-btn.is-loading {
  border-color: rgba(5, 217, 232, 0.75);
  box-shadow: 0 0 18px rgba(5, 217, 232, 0.22);
}

.export-kit-ico {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  font-family: var(--font-brand);
  font-weight: 800;
  font-size: 0.95rem;
  background: rgba(5, 217, 232, 0.14);
  color: #9ef6ff;
}

.export-kit-btn--docx .export-kit-ico { background: rgba(45, 120, 255, 0.2); color: #9ec2ff; }
.export-kit-btn--xlsx .export-kit-ico { background: rgba(34, 180, 90, 0.2); color: #9dffbf; }
.export-kit-btn--pdf .export-kit-ico { background: rgba(255, 80, 80, 0.18); color: #ffb0b0; }
.export-kit-btn--png .export-kit-ico { background: rgba(200, 120, 255, 0.18); color: #e2b8ff; }

.export-kit-meta {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.export-kit-btn-label {
  font-size: 0.86rem;
  font-weight: 750;
}

.export-kit-btn-desc {
  font-size: 0.7rem;
  color: rgba(159, 203, 184, 0.9);
}

.export-kit-btn-ext {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: rgba(5, 217, 232, 0.95);
  letter-spacing: 0.04em;
}

.export-kit-status {
  margin: 0.45rem 0 0;
  font-size: 0.74rem;
  color: #9fcbb8;
  min-height: 0;
}

/* Dock unduh modern — tanpa header/menu besar */
.export-dock {
  padding: 0.55rem 0.7rem 0.65rem;
  border-top: 1px solid rgba(57, 255, 170, 0.12);
  background: rgba(57, 255, 170, 0.04);
}

.export-dock-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.export-pill {
  appearance: none;
  border: 1px solid rgba(57, 255, 170, 0.28);
  background: rgba(8, 24, 19, 0.95);
  color: #eafff5;
  border-radius: 999px;
  padding: 0.42rem 0.85rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.export-pill:hover:not(:disabled) {
  border-color: rgba(57, 255, 170, 0.6);
  background: rgba(57, 255, 170, 0.14);
  transform: translateY(-1px);
}

.export-pill:disabled {
  opacity: 0.55;
  cursor: wait;
}

.export-pill.is-loading {
  border-color: rgba(5, 217, 232, 0.7);
}

.export-pill.is-ready {
  border-color: rgba(57, 255, 170, 0.55);
  background: rgba(57, 255, 170, 0.12);
}

.export-pill--docx.is-ready { border-color: rgba(90, 150, 255, 0.55); }
.export-pill--xlsx.is-ready { border-color: rgba(70, 200, 120, 0.55); }
.export-pill--pdf.is-ready { border-color: rgba(255, 110, 110, 0.55); }
.export-pill--png.is-ready { border-color: rgba(200, 140, 255, 0.55); }

.delivery-file--slim {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border-top: 1px solid rgba(57, 255, 170, 0.1);
}

.delivery-file--slim.is-image {
  grid-template-columns: 56px 1fr auto;
}

.delivery-file--slim .delivery-preview {
  width: 56px;
  height: 56px;
  border-radius: 10px;
}

.delivery-file--slim .delivery-preview img {
  max-height: 56px;
}

.delivery-file--slim .delivery-file-main {
  align-items: center;
}

.delivery-file--slim .delivery-file-details,
.delivery-suite--slim .delivery-head,
.delivery-suite--slim .delivery-chips,
.delivery-suite--slim .delivery-hint,
.delivery-suite--slim .delivery-request,
.delivery-suite--slim .export-kit-head {
  display: none !important;
}

.delivery-dl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.5rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(57, 255, 170, 0.4);
  background: linear-gradient(145deg, #22d392, #14a972);
  color: #04140f;
  font-size: 0.8rem;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
}

.delivery-dl:hover {
  filter: brightness(1.05);
}

@media (max-width: 560px) {
  .export-kit-options {
    grid-template-columns: 1fr;
  }

  .export-dock-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.35rem;
  }

  .export-pill {
    padding: 0.4rem 0.2rem;
    font-size: 0.72rem;
    text-align: center;
  }

  .doc-sheet-line {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }
}

.delivery-file {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: start;
  padding: 0.85rem 1rem;
  border-top: 1px solid rgba(57, 255, 170, 0.1);
}

.delivery-file.is-image {
  grid-template-columns: minmax(120px, 180px) 1fr auto;
}

.delivery-preview {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(57, 255, 170, 0.28);
  background: #061410;
  align-self: stretch;
}

.delivery-preview img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 120px;
  object-fit: cover;
}

.delivery-file-main {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.7rem;
  min-width: 0;
}

.delivery-file-badge {
  display: inline-grid;
  place-items: center;
  min-width: 3rem;
  height: 1.7rem;
  padding: 0 0.45rem;
  border-radius: 8px;
  background: rgba(5, 217, 232, 0.14);
  border: 1px solid rgba(5, 217, 232, 0.28);
  color: #c9f7ff;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.delivery-file-title {
  margin: 0;
  font-weight: 700;
  font-size: 0.95rem;
  color: #eafff5;
  line-height: 1.3;
}

.delivery-file-name {
  margin: 0.2rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: rgba(5, 217, 232, 0.8);
  word-break: break-all;
}

.delivery-file-details {
  margin: 0.4rem 0 0;
  padding-left: 1rem;
  color: #9fcbb8;
  font-size: 0.78rem;
  line-height: 1.4;
}

.delivery-menu {
  position: relative;
}

.delivery-menu-btn {
  appearance: none;
  border: 1px solid rgba(57, 255, 170, 0.35);
  background: linear-gradient(135deg, rgba(57, 255, 170, 0.22), rgba(5, 217, 232, 0.12));
  color: #eafff5;
  border-radius: 999px;
  padding: 0.5rem 0.85rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 0 16px rgba(57, 255, 170, 0.12);
}

.delivery-menu-btn:hover {
  background: linear-gradient(135deg, rgba(57, 255, 170, 0.3), rgba(5, 217, 232, 0.18));
}

.delivery-menu-panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 8;
  min-width: 180px;
  padding: 0.35rem;
  border-radius: 12px;
  border: 1px solid rgba(57, 255, 170, 0.22);
  background: rgba(6, 16, 13, 0.98);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
  display: grid;
  gap: 0.15rem;
}

.delivery-menu-panel[hidden] {
  display: none !important;
}

.delivery-menu-item {
  display: block;
  padding: 0.65rem 0.75rem;
  border-radius: 9px;
  color: #eafff5;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 600;
}

.delivery-menu-item:hover {
  background: rgba(57, 255, 170, 0.1);
}

.message-bubble.has-delivery .md-text {
  font-size: 0.9rem;
  color: #b7dccb;
}

.message.assistant .message-bubble .md-text + .code-block,
.message.assistant .message-bubble .code-block + .md-text,
.message.assistant .message-bubble .code-block + .code-block {
  margin-top: 0.9rem;
}

.message.assistant .message-bubble .inline-code,
.message.user .message-bubble .inline-code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  padding: 0.12rem 0.4rem;
  border-radius: 7px;
  background: rgba(57, 255, 170, 0.12);
  color: var(--accent);
  border: 1px solid rgba(57, 255, 170, 0.18);
  box-shadow: 0 0 12px rgba(57, 255, 170, 0.1);
}

.code-block {
  --code-bg: #06140f;
  --code-line: rgba(57, 255, 170, 0.14);
  --code-ink: #d9ffe9;
  position: relative;
  z-index: 1;
  overflow: hidden;
  border: 0;
  border-radius: 16px;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(57, 255, 170, 0.14), transparent 55%),
    linear-gradient(180deg, #0a1c16, var(--code-bg));
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
  animation: codeReveal 0.45s ease both;
}

.disco-frame.code-disco {
  --disco-radius: 16px;
  --disco-rim: 2px;
  margin-top: 0;
}

.message.assistant .message-bubble .md-text + .disco-frame,
.message.assistant .message-bubble .disco-frame + .md-text,
.message.assistant .message-bubble .disco-frame + .disco-frame {
  margin-top: 0.9rem;
}

.code-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid var(--code-line);
  background: linear-gradient(180deg, rgba(57, 255, 170, 0.07), transparent);
}

.code-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.code-dots {
  display: inline-flex;
  gap: 0.28rem;
}

.code-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: block;
  box-shadow: 0 0 8px currentColor;
}

.code-dots i:nth-child(1) { background: #ff6b6b; color: #ff6b6b; }
.code-dots i:nth-child(2) { background: #ffd166; color: #ffd166; }
.code-dots i:nth-child(3) { background: #39ffaa; color: #39ffaa; }

.code-lang {
  color: rgba(57, 255, 170, 0.85);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.code-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid rgba(57, 255, 170, 0.28);
  border-radius: 999px;
  background: rgba(57, 255, 170, 0.08);
  color: #e8f7f1;
  padding: 0.35rem 0.7rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: var(--font-mono);
  cursor: pointer;
  box-shadow: 0 0 14px rgba(57, 255, 170, 0.1);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.code-copy:hover {
  background: rgba(57, 255, 170, 0.2);
  border-color: rgba(57, 255, 170, 0.55);
  transform: translateY(-1px);
  box-shadow: 0 0 20px rgba(57, 255, 170, 0.25);
}

.code-copy.copied {
  background: rgba(57, 255, 170, 0.22);
  border-color: rgba(57, 255, 170, 0.7);
  color: #b8ffe8;
  box-shadow: 0 0 22px rgba(57, 255, 170, 0.35);
}

.copy-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.code-pre {
  margin: 0;
  padding: 0.95rem 1rem 1.1rem;
  overflow-x: auto;
  background: transparent;
  color: var(--code-ink);
  max-height: min(58vh, 520px);
}

.code-pre code {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.65;
  white-space: pre;
  display: block;
  tab-size: 2;
  text-shadow: 0 0 8px rgba(57, 255, 170, 0.08);
}

.code-pre::-webkit-scrollbar {
  height: 8px;
}

.code-pre::-webkit-scrollbar-thumb {
  background: rgba(57, 255, 170, 0.28);
  border-radius: 999px;
}

.message.error .message-bubble {
  background: linear-gradient(160deg, #2a120c, #1a0c08);
  color: #ffd2bf;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
}

.message.error .bubble-disco {
  background: conic-gradient(
    from var(--disco-angle),
    #ff7a45 0deg,
    #ffd166 90deg,
    #ff4d6d 180deg,
    #ff7a45 270deg,
    #ffd166 360deg
  );
  box-shadow:
    0 0 16px rgba(255, 122, 69, 0.35),
    0 0 28px rgba(255, 77, 109, 0.2);
}

.message.typing .message-bubble {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  min-height: 2.6rem;
  min-width: 78px;
}

.message.typing .message-shell {
  width: max-content;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(57, 255, 170, 0.8);
  animation: pulse 1.1s infinite ease-in-out;
}

.dot:nth-child(2) { animation-delay: 0.15s; }
.dot:nth-child(3) { animation-delay: 0.3s; }

.composer {
  padding: 0.85rem 1.25rem 1.1rem;
  border-top: 1px solid var(--line);
  background: rgba(6, 16, 13, 0.86);
  backdrop-filter: blur(14px);
  box-shadow: 0 -12px 34px rgba(0, 0, 0, 0.28);
}

.composer-bar {
  position: relative;
}

.composer-close {
  display: none;
}

.composer-fab {
  display: none;
}

#chatForm {
  max-width: 820px;
  margin: 0 auto;
}

.composer-frame {
  --disco-rim: 2px;
  --disco-radius: 20px;
  --disco-angle: 0deg;
  position: relative;
  border-radius: var(--disco-radius);
  isolation: isolate;
}

.composer-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.5rem;
  align-items: end;
  padding: 0.55rem;
  border-radius: var(--disco-radius, 20px);
  border: 0;
  background: rgba(5, 16, 13, 0.96);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.35);
}

.btn-attach {
  width: 48px;
  height: 48px;
  min-width: 48px;
  padding: 0;
  border-radius: 14px;
  background: rgba(18, 48, 40, 0.95);
  border: 1px solid rgba(57, 255, 170, 0.22);
  color: #9fcbb8;
  font-size: 1.35rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
}

.btn-attach:hover {
  color: #e9f8f2;
  border-color: rgba(57, 255, 170, 0.45);
}

.attach-preview {
  display: none;
  max-width: 820px;
  margin: 0.45rem auto 0;
  align-items: center;
  gap: 0.7rem;
  padding: 0.5rem 0.65rem;
  border-radius: 14px;
  background: rgba(5, 16, 13, 0.92);
  border: 1px solid rgba(57, 255, 170, 0.2);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
}

.attach-preview.is-open {
  display: flex;
}

.attach-preview[hidden] {
  display: none !important;
}

.attach-preview img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(57, 255, 170, 0.28);
  background: rgba(8, 22, 18, 0.9);
  flex-shrink: 0;
}

.attach-preview-meta {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
}

.attach-preview-copy {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.attach-preview-kicker {
  color: rgba(159, 203, 184, 0.7);
  font-size: 0.68rem;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.attach-preview-name {
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attach-preview-clear {
  flex-shrink: 0;
  border: 1px solid rgba(255, 143, 143, 0.35);
  background: rgba(48, 18, 18, 0.65);
  color: #ffb4b4;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
}

.attach-preview-clear:hover {
  background: rgba(70, 22, 22, 0.85);
  color: #ffe0e0;
}

#messageInput {
  width: 100%;
  resize: none;
  min-height: 48px;
  max-height: 180px;
  padding: 0.85rem 0.9rem;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  line-height: 1.45;
  outline: none;
  box-shadow: none;
}

#messageInput::placeholder {
  color: rgba(159, 203, 184, 0.55);
}

#messageInput:focus {
  border-color: transparent;
  box-shadow: none;
}

.composer-hint {
  max-width: 820px;
  margin: 0.45rem auto 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-family: var(--font-mono);
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn:not(:disabled):hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(145deg, #12352c, #0d2a22);
  color: #e9f8f2;
  border: 1px solid rgba(57, 255, 170, 0.28);
  box-shadow: 0 0 18px rgba(57, 255, 170, 0.12), 0 10px 24px rgba(0, 0, 0, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 0 24px rgba(57, 255, 170, 0.22), 0 12px 28px rgba(0, 0, 0, 0.35);
}

.btn-ghost {
  background: rgba(8, 22, 18, 0.55);
  border: 1px solid rgba(57, 255, 170, 0.18);
  color: var(--ink-soft);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
}

.btn-send {
  background: linear-gradient(145deg, #22d392, #14a972);
  color: #04140f;
  min-width: 96px;
  height: 52px;
  box-shadow: 0 0 22px rgba(57, 255, 170, 0.28), 0 12px 26px rgba(0, 0, 0, 0.35);
}

.btn-send:hover {
  background: linear-gradient(145deg, #39ffaa, #18c980);
  box-shadow: 0 0 30px rgba(57, 255, 170, 0.4), 0 14px 30px rgba(0, 0, 0, 0.4);
}

.btn-icon {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(57, 255, 170, 0.25);
  border-radius: 12px;
  background: rgba(8, 22, 18, 0.8);
  color: var(--accent);
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 0 14px rgba(57, 255, 170, 0.12);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes hackIn {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
    filter: blur(2px);
  }
  60% {
    opacity: 1;
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes terminalBoot {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.97);
    filter: brightness(1.3);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: brightness(1);
  }
}

@keyframes codeReveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 80%, 100% { transform: scale(0.75); opacity: 0.45; }
  40% { transform: scale(1); opacity: 1; }
}

@keyframes markPulse {
  0%, 100% { box-shadow: 0 0 14px rgba(57, 255, 170, 0.2); }
  50% { box-shadow: 0 0 26px rgba(57, 255, 170, 0.4); }
}

@keyframes profileFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes discoAngle {
  to { --disco-angle: 360deg; }
}

@keyframes historyItemAngle {
  to { --item-angle: 360deg; }
}

@keyframes historySweep {
  0% { transform: translateY(-120%); opacity: 0; }
  20% { opacity: 0.9; }
  55% { opacity: 0.55; }
  100% { transform: translateY(220%); opacity: 0; }
}

@keyframes historyBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes profilePulse {
  0%, 100% { opacity: 0.4; transform: scale(0.92); }
  50% { opacity: 0.95; transform: scale(1.08); }
}

@keyframes statusBlink {
  0%, 100% { box-shadow: 0 0 8px rgba(57, 255, 170, 0.55); opacity: 1; }
  50% { box-shadow: 0 0 16px rgba(57, 255, 170, 0.95); opacity: 0.75; }
}

@keyframes pillGlow {
  0%, 100% { box-shadow: 0 0 12px rgba(57, 255, 170, 0.12); }
  50% { box-shadow: 0 0 20px rgba(57, 255, 170, 0.28); }
}

@keyframes typingGlow {
  0%, 100% { box-shadow: 0 0 16px rgba(57, 255, 170, 0.12), 0 14px 30px rgba(0, 0, 0, 0.35); }
  50% { box-shadow: 0 0 28px rgba(57, 255, 170, 0.28), 0 16px 34px rgba(0, 0, 0, 0.4); }
}

@keyframes scanX {
  0% { transform: translateX(-8%); opacity: 0.2; }
  40% { opacity: 0.9; }
  100% { transform: translateX(8%); opacity: 0.25; }
}

@keyframes scanY {
  0%, 100% { transform: translateY(-30%); opacity: 0.25; }
  50% { transform: translateY(30%); opacity: 1; }
}

@keyframes sheen {
  0%, 55%, 100% { transform: translateX(-120%); }
  70% { transform: translateX(120%); }
}

@keyframes gridDrift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 36px 36px, 36px 36px; }
}

@media (max-width: 860px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(88vw, 320px);
    z-index: 40;
    transform: translateX(-105%);
    transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: var(--glow-strong);
    padding-top: max(1rem, env(safe-area-inset-top));
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar.open::before {
    content: "";
    position: fixed;
    inset: 0;
    left: min(88vw, 320px);
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
  }

  .btn-icon {
    display: inline-grid;
    place-items: center;
    width: 2.45rem;
    height: 2.45rem;
    border-radius: 12px;
    border: 1px solid rgba(57, 255, 170, 0.22);
    background: rgba(57, 255, 170, 0.08);
    color: #eafff5;
    font-size: 1.05rem;
    flex: 0 0 auto;
  }

  .main {
    grid-template-rows: auto 1fr;
    height: 100dvh;
    height: 100svh;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 25;
    gap: 0.55rem;
    padding:
      max(0.65rem, env(safe-area-inset-top))
      0.85rem
      0.7rem;
    background: rgba(4, 12, 10, 0.92);
    border-bottom: 1px solid rgba(57, 255, 170, 0.2);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  }

  .topbar-title {
    gap: 0.5rem;
  }

  .topbar-title .profile-wrap--sm {
    --profile-size: 32px;
  }

  .topbar-heading {
    flex: 1;
    min-width: 0;
  }

  .topbar h1 {
    font-size: 1.08rem;
    line-height: 1.15;
    letter-spacing: -0.02em;
  }

  .topbar-sub {
    display: block;
  }

  .topbar .pill {
    display: none;
  }

  .topbar-desk {
    display: none !important;
  }

  .topbar-mob {
    display: inline-grid !important;
  }

  .owner-fab {
    display: none !important;
  }

  .topbar-actions {
    gap: 0.35rem;
    flex: 0 0 auto;
  }

  .forum-notify {
    min-width: 2.75rem;
    min-height: 2.75rem;
    padding: 0;
    border-radius: 14px;
  }

  .forum-notify-label {
    display: none;
  }

  .forum-notify-ico {
    width: 1.25rem;
    height: 1.25rem;
  }

  .forum-unread-badge--notify {
    top: -0.28rem;
    right: -0.28rem;
  }

  .forum-unread-badge--notify .forum-unread-count {
    min-width: 1.45rem;
    height: 1.45rem;
    font-size: 0.68rem;
  }

  .forum-unread-pill {
    padding: 0 0.7rem;
  }

  .forum-unread-pill-cta {
    display: none;
  }

  .chip-new {
    display: inline-grid !important;
    place-items: center;
    height: 2.45rem;
    min-width: 2.45rem;
    border-radius: 12px;
  }

  .chat {
    padding: 1rem 0.85rem 6.5rem;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  .chat::before {
    margin-left: -0.85rem;
    margin-right: -0.85rem;
  }

  .message {
    max-width: 100%;
  }

  .message-bubble {
    padding: 0.9rem 0.95rem;
    font-size: 0.98rem;
    line-height: 1.65;
    letter-spacing: 0.01em;
  }

  .message.assistant .message-bubble {
    background: linear-gradient(160deg, rgba(8, 24, 19, 0.98), rgba(5, 14, 11, 0.97));
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.38);
  }

  .message.assistant .message-bubble .md-text {
    color: #e8fff5;
    font-size: 0.98rem;
    line-height: 1.68;
  }

  .delivery-file,
  .delivery-file.is-image {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .delivery-preview img {
    max-height: 160px;
  }

  .delivery-menu {
    justify-self: start;
  }

  .delivery-menu-panel {
    left: 0;
    right: auto;
  }

  .message-role {
    font-size: 0.72rem;
    margin-bottom: 0.35rem;
  }

  .welcome {
    margin-top: 1.2rem;
    margin-bottom: 1rem;
  }

  .welcome-panel {
    padding: 1.1rem 1rem 1.15rem;
  }

  .welcome-brand {
    font-size: clamp(2.1rem, 12vw, 3rem);
  }

  .welcome-title {
    font-size: 1.25rem;
  }

  .welcome-sub {
    font-size: 0.92rem;
    line-height: 1.55;
  }

  .starter-row {
    gap: 0.45rem;
  }

  .starter {
    font-size: 0.78rem;
    padding: 0.55rem 0.7rem;
  }

  /* Composer: fixed dock, auto-hides when idle */
  .composer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 28;
    padding:
      0.65rem
      0.85rem
      max(0.75rem, env(safe-area-inset-bottom));
    border-top: 1px solid rgba(57, 255, 170, 0.2);
    background:
      linear-gradient(180deg, rgba(6, 16, 13, 0.72), rgba(4, 10, 8, 0.96));
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.42);
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    transition:
      transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1),
      opacity 0.24s ease,
      visibility 0.24s ease;
  }

  .main.composer-collapsed .composer {
    transform: translateY(calc(100% + 1.25rem));
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .composer-hint {
    display: none;
  }

  .composer-close {
    display: grid;
    place-items: center;
    position: absolute;
    top: -0.55rem;
    right: 0.15rem;
    z-index: 3;
    width: 1.85rem;
    height: 1.85rem;
    border: 1px solid rgba(57, 255, 170, 0.25);
    border-radius: 999px;
    background: rgba(6, 16, 13, 0.95);
    color: #9fcbb8;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
  }

  .composer-shell {
    gap: 0.45rem;
    padding: 0.4rem;
    border-radius: 18px;
  }

  #messageInput {
    min-height: 44px;
    max-height: 140px;
    padding: 0.7rem 0.75rem;
    font-size: 16px; /* prevent iOS zoom */
  }

  .btn-send {
    min-height: 44px;
    padding: 0.65rem 0.9rem;
    border-radius: 14px;
  }

  .btn-send span {
    font-size: 0.88rem;
  }

  .composer-fab {
    --disco-angle: 0deg;
    display: inline-flex;
    position: fixed;
    right: max(0.85rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
    z-index: 27;
    border: 0;
    padding: 2px;
    border-radius: 999px;
    background: transparent;
    color: #eafff5;
    cursor: pointer;
    isolation: isolate;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(12px) scale(0.96);
    transition:
      opacity 0.24s ease,
      transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
      visibility 0.24s ease;
  }

  .main.composer-collapsed .composer-fab {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }

  .composer-fab-disco {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    z-index: 0;
    background: conic-gradient(
      from var(--disco-angle),
      #39ffaa,
      #05d9e8,
      #ff2a6d,
      #fee440,
      #39ffaa
    );
    animation: discoAngle 3s linear infinite;
    box-shadow: 0 0 22px rgba(57, 255, 170, 0.28);
  }

  .composer-fab-inner {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.72rem 1rem 0.72rem 0.85rem;
    border-radius: 999px;
    background: linear-gradient(145deg, rgba(8, 22, 18, 0.96), rgba(5, 14, 11, 0.98));
    box-shadow: inset 0 0 0 1px rgba(57, 255, 170, 0.12);
    font-weight: 700;
    font-size: 0.88rem;
  }

  .composer-fab-ico {
    display: grid;
    place-items: center;
    width: 1.55rem;
    height: 1.55rem;
    border-radius: 999px;
    background: rgba(57, 255, 170, 0.14);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.78rem;
  }

  .composer-fab:active .composer-fab-inner {
    transform: scale(0.98);
  }

  .main:not(.composer-collapsed) .chat {
    padding-bottom: 7.5rem;
  }
}

@media (max-width: 420px) {
  .composer-fab-text {
    display: none;
  }

  .composer-fab-inner {
    padding: 0.85rem;
  }

  .topbar h1 {
    font-size: 1rem;
  }

  .topbar-sub {
    font-size: 0.62rem;
  }
}

/* Desktop: composer auto-hide + FAB — pola animasi sama seperti mobile */
@media (min-width: 861px) {
  .topbar-sheet,
  .topbar-mob {
    display: none !important;
  }

  .main {
    overflow: hidden;
  }

  .composer {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 28;
    padding: 0.85rem 1.35rem 1.1rem;
    border-top: 1px solid rgba(57, 255, 170, 0.2);
    background:
      linear-gradient(180deg, rgba(6, 16, 13, 0.78), rgba(4, 10, 8, 0.96));
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 -18px 42px rgba(0, 0, 0, 0.38);
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    transition:
      transform 0.36s cubic-bezier(0.2, 0.8, 0.2, 1),
      opacity 0.26s ease,
      visibility 0.26s ease;
  }

  .main.composer-collapsed .composer {
    transform: translateY(calc(100% + 1.5rem));
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .composer-hint {
    max-width: 820px;
    margin: 0.4rem auto 0;
    opacity: 0.85;
  }

  .composer-close {
    display: grid;
    place-items: center;
    position: absolute;
    top: -0.65rem;
    right: 0.35rem;
    z-index: 3;
    width: 2rem;
    height: 2rem;
    border: 1px solid rgba(57, 255, 170, 0.28);
    border-radius: 999px;
    background: rgba(6, 16, 13, 0.96);
    color: #9fcbb8;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
    transition: transform 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  }

  .composer-close:hover {
    color: #eafff5;
    border-color: rgba(57, 255, 170, 0.55);
    transform: translateY(-1px);
  }

  .composer-fab {
    --disco-angle: 0deg;
    display: inline-flex;
    position: absolute;
    right: 1.35rem;
    bottom: 1.35rem;
    z-index: 27;
    border: 0;
    padding: 2px;
    border-radius: 999px;
    background: transparent;
    color: #eafff5;
    cursor: pointer;
    isolation: isolate;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(14px) scale(0.94);
    transition:
      opacity 0.26s ease,
      transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1),
      visibility 0.26s ease;
  }

  .main.composer-collapsed .composer-fab {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }

  .composer-fab:hover .composer-fab-inner {
    box-shadow:
      inset 0 0 0 1px rgba(57, 255, 170, 0.22),
      0 0 22px rgba(57, 255, 170, 0.18);
    transform: translateY(-1px);
  }

  .composer-fab-disco {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    z-index: 0;
    background: conic-gradient(
      from var(--disco-angle),
      #39ffaa,
      #05d9e8,
      #ff2a6d,
      #fee440,
      #39ffaa
    );
    animation: discoAngle 3s linear infinite;
    box-shadow: 0 0 24px rgba(57, 255, 170, 0.3);
  }

  .composer-fab-inner {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.78rem 1.1rem 0.78rem 0.9rem;
    border-radius: 999px;
    background: linear-gradient(145deg, rgba(8, 22, 18, 0.96), rgba(5, 14, 11, 0.98));
    box-shadow: inset 0 0 0 1px rgba(57, 255, 170, 0.12);
    font-weight: 700;
    font-size: 0.9rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }

  .composer-fab-ico {
    display: grid;
    place-items: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 999px;
    background: rgba(57, 255, 170, 0.14);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.8rem;
  }

  .main:not(.composer-collapsed) .chat {
    padding-bottom: 8.75rem;
    transition: padding-bottom 0.28s ease;
  }

  .main.composer-collapsed .chat {
    padding-bottom: 5.5rem;
    transition: padding-bottom 0.28s ease;
  }

  .attach-preview {
    max-width: 820px;
  }
}

.user-chip {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 0.55rem;
  align-items: center;
  padding: 0.55rem 0.65rem;
  border-radius: 12px;
  border: 1px solid rgba(57, 255, 170, 0.16);
  background: rgba(57, 255, 170, 0.05);
}

.user-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #39ffaa;
  box-shadow: 0 0 10px rgba(57, 255, 170, 0.75);
  animation: statusBlink 1.5s ease-in-out infinite;
}

.user-chip strong {
  display: block;
  font-size: 0.8rem;
  color: #eafff5;
}

.user-chip small {
  display: block;
  margin-top: 0.1rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: rgba(5, 217, 232, 0.72);
}

.user-logout {
  color: #ffb3c7;
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.28rem 0.45rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 42, 109, 0.28);
  background: rgba(255, 42, 109, 0.08);
  transition: background 0.15s ease, transform 0.15s ease;
}

.user-logout:hover {
  background: rgba(255, 42, 109, 0.18);
  transform: translateY(-1px);
}

a.chip {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

/* ===== Auth pages (login / register — slow code rain) ===== */
.auth-body {
  overflow: auto !important;
  min-height: 100dvh;
}

.auth-rain-page {
  background: #03070a;
}

.auth-body .atmosphere {
  pointer-events: none;
}

#authRain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
  pointer-events: none;
  background:
    radial-gradient(1200px 700px at 50% -10%, rgba(57, 255, 170, 0.08), transparent 55%),
    radial-gradient(900px 500px at 100% 100%, rgba(255, 42, 109, 0.07), transparent 50%),
    #03070a;
}

.auth-veil {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(3, 7, 10, 0.2), transparent 18%, transparent 78%, rgba(3, 7, 10, 0.6)),
    repeating-linear-gradient(0deg, transparent 0 2px, rgba(5, 217, 232, 0.025) 2px 3px);
}

.auth-stage {
  position: relative;
  z-index: 2;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.auth-card {
  --disco-angle: 0deg;
  position: relative;
  width: min(440px, 100%);
  border-radius: 22px;
  padding: 2px;
  isolation: isolate;
  animation: terminalBoot 0.65s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  box-shadow:
    0 0 40px rgba(57, 255, 170, 0.12),
    0 0 80px rgba(5, 217, 232, 0.06),
    0 28px 70px rgba(0, 0, 0, 0.55);
}

.auth-disco {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  z-index: 0;
  padding: 2px;
  pointer-events: none;
  background: conic-gradient(
    from var(--disco-angle),
    #39ffaa,
    #05d9e8,
    #9d4edd,
    #ff2a6d,
    #fee440,
    #39ffaa
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: discoAngle 3.5s linear infinite;
  opacity: 0.95;
  box-shadow: 0 0 28px rgba(57, 255, 170, 0.18), 0 0 48px rgba(5, 217, 232, 0.1);
}

.auth-card-inner {
  position: relative;
  z-index: 2;
  overflow: hidden;
  border-radius: 20px;
  padding: 1.35rem 1.25rem 1.2rem;
  background: linear-gradient(145deg, rgba(8, 18, 16, 0.94), rgba(5, 10, 14, 0.96));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: inset 0 0 0 1px rgba(57, 255, 170, 0.1);
}

.auth-scan {
  position: absolute;
  left: 0;
  right: 0;
  top: -40%;
  height: 42%;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(57, 255, 170, 0.06),
    transparent
  );
  animation: authScan 5.5s ease-in-out infinite;
}

@keyframes authScan {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.35;
  }
  50% {
    transform: translateY(280%);
    opacity: 0.7;
  }
}

.auth-brand {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.9rem;
  align-items: center;
  margin-bottom: 1.15rem;
}

.auth-kicker {
  margin: 0 0 0.2rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(5, 217, 232, 0.8);
}

.auth-brand h1 {
  margin: 0;
  font-family: var(--font-brand);
  font-size: 1.55rem;
  letter-spacing: -0.02em;
  color: #eafff5;
}

.auth-sub {
  margin: 0.35rem 0 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.45;
}

.auth-alert {
  margin: 0 0 0.9rem;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 42, 109, 0.35);
  background: rgba(255, 42, 109, 0.1);
  color: #ffd0dc;
  font-size: 0.84rem;
  line-height: 1.4;
}

.auth-alert--ok {
  border-color: rgba(57, 255, 170, 0.35);
  background: rgba(57, 255, 170, 0.1);
  color: #d8fff0;
}

.auth-form {
  display: grid;
  gap: 0.95rem;
  position: relative;
  z-index: 3;
}

.auth-field {
  display: grid;
  gap: 0.4rem;
  position: relative;
  z-index: 3;
}

.auth-field > span {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #7fe7f2;
}

.auth-field input[type="text"],
.auth-field input[type="password"],
.auth-form input.auth-input {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative;
  z-index: 3;
  width: 100%;
  min-height: 48px;
  height: 48px;
  border: 1px solid rgba(57, 255, 170, 0.35) !important;
  border-radius: 12px;
  background: #04110d !important;
  color: #eafff5 !important;
  -webkit-text-fill-color: #eafff5 !important;
  caret-color: #39ffaa;
  font: inherit;
  font-size: 1rem !important;
  line-height: 1.4;
  padding: 0.75rem 0.9rem !important;
  margin: 0;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(5, 217, 232, 0.08);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-field input[type="text"]::placeholder,
.auth-field input[type="password"]::placeholder,
.auth-form input.auth-input::placeholder {
  color: #6f9a88 !important;
  -webkit-text-fill-color: #6f9a88 !important;
  opacity: 1;
}

.auth-field input[type="text"]:focus,
.auth-field input[type="password"]:focus,
.auth-form input.auth-input:focus {
  border-color: rgba(57, 255, 170, 0.65) !important;
  box-shadow: 0 0 0 3px rgba(57, 255, 170, 0.14);
}

.auth-submit {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  width: 100%;
  margin-top: 0.25rem;
  border: 1px solid rgba(57, 255, 170, 0.45);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(57, 255, 170, 0.3), rgba(5, 217, 232, 0.16));
  color: #eafff5;
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  box-shadow: 0 0 22px rgba(57, 255, 170, 0.18);
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.auth-submit-label {
  position: relative;
  z-index: 2;
}

.auth-submit-glow {
  position: absolute;
  inset: -40% -20%;
  z-index: 1;
  background: linear-gradient(
    110deg,
    transparent 35%,
    rgba(255, 255, 255, 0.14) 50%,
    transparent 65%
  );
  animation: authSubmitShine 4.2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes authSubmitShine {
  0%,
  100% {
    transform: translateX(-35%);
    opacity: 0.35;
  }
  50% {
    transform: translateX(35%);
    opacity: 0.85;
  }
}

.auth-submit:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, rgba(57, 255, 170, 0.4), rgba(5, 217, 232, 0.22));
  box-shadow: 0 0 30px rgba(57, 255, 170, 0.28);
}

.auth-submit:active {
  transform: translateY(0);
}

.auth-switch {
  margin: 1rem 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.86rem;
}

.auth-switch a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.auth-switch a:hover {
  text-decoration: underline;
}

.auth-foot {
  margin: 0.75rem 0 0;
  text-align: center;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: rgba(5, 217, 232, 0.45);
}

.auth-kicker span {
  color: rgba(57, 255, 170, 0.7);
}

@media (prefers-reduced-motion: reduce) {
  .auth-scan,
  .auth-submit-glow,
  .auth-disco {
    animation: none !important;
  }

  #authRain {
    display: none;
  }

  .auth-rain-page {
    background:
      radial-gradient(1200px 700px at 50% -10%, rgba(57, 255, 170, 0.08), transparent 55%),
      #03070a;
  }
}
