.prompt-item,
.session-item,
.workflow-item,
.rule-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 11px;
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow-1);
  transition:
    border-color 150ms ease,
    background 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease;
}

.session-item {
  min-height: 58px;
  display: grid;
  gap: 4px;
  align-content: center;
  text-align: left;
}

.session-item span,
.session-item small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-item span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.session-item small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.prompt-item {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 30px;
  gap: 8px;
  height: 118px;
  align-content: start;
  overflow: visible;
  text-align: left;
}

.prompt-icon,
.workflow-icon,
.rule-icon {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-container-high);
  font-size: 17px;
  line-height: 1;
}

.prompt-copy {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.prompt-item:hover,
.session-item:hover,
.workflow-item:hover,
.rule-item:hover {
  border-color: rgba(37, 99, 235, 0.42);
  background: var(--surface-tonal);
  transform: translateY(-1px);
}

.prompt-item:focus-visible {
  outline: 3px solid rgba(245, 158, 11, 0.34);
  outline-offset: 2px;
}

.prompt-item.active {
  border-color: rgba(37, 99, 235, 0.72);
  background:
    linear-gradient(90deg, rgba(37, 99, 235, 0.13), transparent 42%),
    var(--surface);
  box-shadow:
    inset 4px 0 0 var(--primary),
    var(--shadow-2);
}

.session-item.active {
  border-color: rgba(225, 29, 72, 0.46);
  background:
    linear-gradient(90deg, rgba(225, 29, 72, 0.1), transparent 44%),
    var(--surface);
  box-shadow:
    inset 4px 0 0 var(--tertiary),
    var(--shadow-1);
}

.prompt-title {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.35;
}

.prompt-title > span:first-child {
  min-width: 0;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.prompt-command {
  flex: 0 0 auto;
  align-self: start;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  padding: 3px 7px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  font-weight: 800;
}

.prompt-use,
.rule-item p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.prompt-use {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.prompt-actions {
  position: relative;
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}

.prompt-menu-button {
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}

.prompt-menu-button:hover,
.prompt-menu-button[aria-expanded="true"] {
  border-color: rgba(37, 99, 235, 0.28);
  background: var(--primary-soft);
  color: var(--primary-dark);
  box-shadow: none;
}

.prompt-menu {
  position: absolute;
  z-index: 20;
  top: 34px;
  right: 0;
  width: 48px;
  display: none;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-3);
}

.prompt-menu.open {
  display: grid;
  gap: 4px;
}

.prompt-menu button {
  min-height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}

.prompt-menu button:hover {
  background: var(--surface-tonal);
  color: var(--primary-dark);
  box-shadow: none;
  transform: none;
}

.workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 18px 20px 20px;
  overflow: hidden;
}

.app-view {
  min-width: 0;
  min-height: 0;
  flex: 1;
}

.app-view[hidden] {
  display: none;
}

.chat-view {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.topbar,
.command-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.topbar {
  min-height: 60px;
  border: 1px solid rgba(220, 228, 238, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  padding: 10px 12px 10px 16px;
  box-shadow: var(--shadow-1);
  backdrop-filter: blur(16px);
}

.topbar > div:first-child {
  min-width: 0;
}

.topbar h2 {
  max-width: 820px;
}

.top-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  align-items: center;
}

.ghost {
  min-height: 38px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--primary-dark);
  border: 1px solid rgba(220, 228, 238, 0.95);
  box-shadow: none;
}

.icon-command {
  width: 38px;
  min-width: 38px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  line-height: 1;
  text-align: center;
}

.top-actions .icon-command {
  width: 40px;
  min-width: 40px;
}

.mac-connection-indicator {
  width: 40px;
  min-width: 40px;
  height: 38px;
  padding: 0;
  position: relative;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(220, 228, 238, 0.95);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--primary-dark);
  cursor: pointer;
}

.mac-connection-icon { font-size: 18px; line-height: 1; }
.mac-connection-dot {
  width: 7px;
  height: 7px;
  position: absolute;
  top: 7px;
  right: 7px;
  border-radius: 50%;
  background: #94a3b8;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
}
.mac-connection-indicator.is-connected .mac-connection-dot { background: #22c55e; }
.mac-connection-indicator.is-login_required .mac-connection-dot { background: #f59e0b; }
.mac-connection-indicator.is-disconnected .mac-connection-dot,
.mac-connection-indicator.is-error .mac-connection-dot { background: #ef4444; }
.mac-connection-indicator.is-checking .mac-connection-dot,
.mac-connection-indicator.is-refreshing .mac-connection-dot { background: #3b82f6; }
.mac-connection-indicator:hover { border-color: rgba(37, 99, 235, 0.35); }

.ghost:hover {
  background: #ffffff;
  color: var(--primary-dark);
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.1);
}

#feedbackBtn {
  color: #b45309;
}

#feedbackBtn:hover {
  background: var(--tertiary-soft);
  border-color: rgba(245, 158, 11, 0.34);
  color: #92400e;
}

.command-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid rgba(220, 228, 238, 0.78);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: var(--shadow-1);
  overflow: visible;
  padding: 8px;
  backdrop-filter: blur(14px);
}

.command-pill {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 62px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  text-align: left;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.command-pill:hover {
  background: #ffffff;
  border-color: rgba(37, 99, 235, 0.24);
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.07);
  transform: translateY(-1px);
}

.pill-icon {
  font-size: 18px;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(220, 228, 238, 0.88);
  border-radius: var(--radius);
  background: #ffffff;
  transition: all 0.25s ease;
}

.command-pill:hover .pill-icon {
  transform: translateY(-1px);
}

.command-pill:nth-child(1) .pill-icon { background: rgba(37, 99, 235, 0.08); color: var(--primary); }
.command-pill:nth-child(2) .pill-icon { background: rgba(22, 163, 184, 0.1); color: var(--secondary); }
.command-pill:nth-child(3) .pill-icon { background: rgba(18, 165, 111, 0.1); color: var(--success); }
.command-pill:nth-child(4) .pill-icon { background: rgba(37, 99, 235, 0.08); color: var(--primary-dark); }
.command-pill:nth-child(5) .pill-icon { background: rgba(245, 158, 11, 0.12); color: #b45309; }

.command-pill:nth-child(1):hover { border-color: rgba(37, 99, 235, 0.3); }
.command-pill:nth-child(2):hover { border-color: rgba(22, 163, 184, 0.32); }
.command-pill:nth-child(3):hover { border-color: rgba(18, 165, 111, 0.32); }
.command-pill:nth-child(4):hover { border-color: rgba(37, 99, 235, 0.24); }
.command-pill:nth-child(5):hover { border-color: rgba(245, 158, 11, 0.32); }

.pill-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pill-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pill-value {
  font-size: 13px;
  font-weight: 900;
  color: var(--ink);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Topbar Profile Selector */
.topbar-profile-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid rgba(220, 228, 238, 0.95);
  border-radius: 999px;
  padding: 4px 8px 4px 10px;
  margin-right: 6px;
  transition: all 0.2s ease;
}

.topbar-profile-pill:hover {
  border-color: rgba(37, 99, 235, 0.35);
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.08);
}

.topbar-profile-pill .profile-icon {
  font-size: 14px;
}

.topbar-profile-select {
  border: none;
  background: transparent;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
  padding: 0 16px 0 0;
  cursor: pointer;
  outline: none;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-profile-btn {
  width: 24px;
  height: 24px;
  min-height: 24px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  display: inline-grid;
  place-items: center;
  padding: 0;
  font-size: 11px;
  box-shadow: none;
  transition: all 0.15s ease;
  cursor: pointer;
}

.topbar-profile-btn:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
  border-color: rgba(37, 99, 235, 0.25);
  transform: scale(1.08);
}

.sidebar-section.section-focus {
  border-radius: var(--radius);
  outline: 3px solid rgba(245, 158, 11, 0.34);
  outline-offset: 4px;
}
