/* Ask AI workspace — left AI rail + conversation pane */

.workspace {
  display: flex;
  flex: 1;
  min-height: 0;
  min-width: 0;
}

.ai-rail {
  width: 52px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 0 12px;
  background: #f8f9fa;
  border-right: 1px solid var(--line);
}

.rail-chats {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.rail-item {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.rail-close {
  position: absolute;
  top: 0;
  right: 0;
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: #5f6368;
  color: #fff;
  display: none;
  place-items: center;
  cursor: pointer;
  padding: 0;
  z-index: 1;
}

.rail-item:hover .rail-close {
  display: grid;
}

.rail-close:hover {
  background: #202124;
}

.rail-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--icon);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.rail-btn:hover {
  background: #e8eaed;
}

.rail-btn.active {
  background: #e8f0fe;
}

.rail-btn.is-loading {
  opacity: 0.7;
}

.rail-btn .ask-ai-icon,
.rail-icon {
  display: grid;
  place-items: center;
}

.rail-icon svg,
.rail-btn .ask-ai-icon {
  width: 20px;
  height: 20px;
  display: block;
}

.workspace-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.workspace-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 6px 0 14px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--line);
}

.workspace-title {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.workspace-head > .tool-btn {
  flex-shrink: 0;
}

.panel-stage[hidden],
.provider-pane[hidden] {
  display: none !important;
}

.panel-stage {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 16px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ask-home-head {
  text-align: center;
  margin-bottom: 4px;
}

.welcome-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: #e8f0fe;
  display: grid;
  place-items: center;
}

.ask-home-head h2 {
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 6px;
}

.ask-home-head p {
  font-size: 14px;
  color: var(--muted);
}

.composer-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.composer-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.suggest-row,
.ask-with {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.skill-card {
  border: 1px solid #e6e8eb;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.skill-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 6px;
}

.skill-card-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #80868b;
}

.skill-all {
  border: 0;
  background: transparent;
  color: #1e8e3e;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}

.skill-all:hover {
  text-decoration: underline;
}

.skill-list {
  display: flex;
  flex-direction: column;
}

.skill-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: var(--text);
}

.skill-row:hover,
.skill-row.active,
.skill-picker-item.active,
.skill-picker-item:hover {
  background: #f6fbf7;
}

.skill-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #e6f4ea;
  color: #1e8e3e;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.skill-icon svg {
  display: block;
}

.skill-copy {
  flex: 1;
  min-width: 0;
}

.skill-title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
}

.skill-desc {
  display: block;
  font-size: 12px;
  color: #80868b;
  line-height: 1.35;
  margin-top: 1px;
}

.skill-cmd {
  flex-shrink: 0;
  font-size: 12px;
  color: #1e8e3e;
  font-family: ui-monospace, Consolas, monospace;
}

.ask-prompt-wrap {
  position: relative;
}

.skill-picker {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 4;
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(32, 33, 36, 0.16);
  overflow: auto;
  max-height: 220px;
}

.skill-picker[hidden] {
  display: none !important;
}

.skill-picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.skill-picker-empty {
  padding: 12px;
  font-size: 12px;
  color: #80868b;
  text-align: center;
}

#askPrompt {
  width: 100%;
  min-height: 76px;
  max-height: 140px;
  padding: 10px 12px;
  border: 1px solid #dadce0;
  border-radius: 12px;
  resize: vertical;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  outline: none;
}

#askPrompt:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.ask-with-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px 0 8px;
  border: 1px solid #dadce0;
  border-radius: 16px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.ask-with-chip:hover {
  background: #f6f8fc;
}

.ask-with-chip.selected {
  border-color: #1a73e8;
  background: #e8f0fe;
  color: #174ea6;
}

.ask-with-chip.unavailable {
  opacity: 0.45;
  cursor: not-allowed;
}

.ask-check {
  width: 12px;
  font-size: 12px;
  font-weight: 700;
}

.provider-tab-icon {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
}

.provider-tab-icon svg {
  display: block;
}

.ask-cta {
  height: 36px;
  border: 0;
  border-radius: 18px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.ask-cta:hover:not(:disabled) {
  background: #1557c0;
}

.ask-cta:disabled {
  background: #dadce0;
  color: #80868b;
  cursor: default;
}

.provider-pane {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.provider-chat {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.provider-compose {
  position: relative;
  flex-shrink: 0;
  padding: 4px 12px 12px;
}

.provider-box {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 8px 8px 8px 12px;
  background: #f1f3f4;
  border-radius: 22px;
}

.provider-box:focus-within {
  background: #fff;
  box-shadow: 0 0 0 2px var(--accent);
}

#providerDraft {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  resize: none;
  font-size: 14px;
  line-height: 20px;
  max-height: 88px;
  color: var(--text);
}

.provider-send {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.provider-send:hover:not(:disabled) {
  background: #1557c0;
}

.provider-send:disabled {
  background: #dadce0;
  color: #80868b;
  cursor: default;
}

.provider-empty,
.provider-error {
  font-size: 13px;
  color: #80868b;
  text-align: center;
  padding: 24px 8px;
}

.provider-error {
  color: #c5221f;
  background: #fce8e6;
  border-radius: 10px;
  padding: 10px 12px;
}

.msg {
  display: flex;
  gap: 8px;
  max-width: 100%;
  animation: rise 0.18s ease-out;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.msg.user {
  justify-content: flex-end;
}

.msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e8f0fe;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.msg-avatar.chatgpt {
  background: #e8f8f2;
}

.msg-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 86%;
}

.bubble {
  max-width: 86%;
  padding: 10px 12px;
  border-radius: 18px;
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg-col .bubble {
  max-width: 100%;
}

.msg.ai .bubble {
  background: #f1f3f4;
  border-radius: 4px 18px 18px 18px;
}

.msg.user .bubble {
  background: #1a73e8;
  color: #fff;
  border-radius: 18px 4px 18px 18px;
}

.typing {
  display: flex;
  gap: 4px;
  padding: 12px 14px;
}

.typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #80868b;
  animation: blink 1.2s infinite;
}

.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes blink {
  0%, 80%, 100% { opacity: 0.25; }
  40% { opacity: 1; }
}
