/* FE/v4/styles.css */

:root {
  --v4-bg: #120f1a;
  --v4-bg-soft: #1c1728;
  --v4-bg-card: rgba(255, 255, 255, 0.08);
  --v4-bg-card-strong: rgba(255, 255, 255, 0.13);
  --v4-border: rgba(255, 255, 255, 0.14);
  --v4-border-strong: rgba(255, 255, 255, 0.24);
  --v4-text: #f7f1ff;
  --v4-text-muted: rgba(247, 241, 255, 0.72);
  --v4-text-subtle: rgba(247, 241, 255, 0.52);
  --v4-accent: #d9a8ff;
  --v4-accent-strong: #f0d1ff;
  --v4-danger: #ff8f9f;
  --v4-danger-bg: rgba(255, 95, 120, 0.16);
  --v4-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  --v4-radius-lg: 24px;
  --v4-radius-md: 18px;
  --v4-radius-sm: 12px;
  --v4-safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.v4-screen {
  min-height: 100dvh;
  width: 100%;
  margin: 0 auto;
  color: var(--v4-text);
  background:
    radial-gradient(circle at 18% 8%, rgba(217, 168, 255, 0.20), transparent 34%),
    radial-gradient(circle at 82% 2%, rgba(137, 111, 255, 0.18), transparent 30%),
    linear-gradient(180deg, #191225 0%, var(--v4-bg) 48%, #0d0b12 100%);
}

.v4-screen button {
  border: 0;
}

/* =========================
   Lobby
========================= */

.v4-lobby-screen {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 18px calc(22px + var(--v4-safe-bottom));
}

.v4-lobby-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--v4-border);
  border-radius: var(--v4-radius-lg);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: var(--v4-shadow);
}

.v4-lobby-hero__eyebrow,
.v4-room-header__eyebrow,
.v4-settings-header__eyebrow {
  margin: 0 0 6px;
  color: var(--v4-accent);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.v4-lobby-hero__title {
  margin: 0;
  font-size: clamp(2.1rem, 12vw, 3.8rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.v4-lobby-hero__description {
  margin: 10px 0 0;
  color: var(--v4-text-muted);
  line-height: 1.7;
}

.v4-lobby-hero__portrait {
  display: flex;
  justify-content: center;
}

.v4-lobby-hero__portrait-inner {
  display: grid;
  place-items: center;
  width: min(62vw, 230px);
  aspect-ratio: 1 / 1.22;
  border: 1px solid var(--v4-border);
  border-radius: 999px 999px 34px 34px;
  color: rgba(255, 255, 255, 0.42);
  background:
    radial-gradient(circle at 50% 24%, rgba(240, 209, 255, 0.22), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
}

.v4-lobby-status,
.v4-settings-card {
  padding: 20px;
  border: 1px solid var(--v4-border);
  border-radius: var(--v4-radius-lg);
  background: var(--v4-bg-card);
}

.v4-lobby-status__label,
.v4-current-consultation__label,
.v4-consultation-history__label {
  margin: 0 0 8px;
  color: var(--v4-accent);
  font-size: 0.8rem;
  font-weight: 700;
}

.v4-lobby-status__title {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.35;
}

.v4-lobby-status__description {
  margin: 10px 0 18px;
  color: var(--v4-text-muted);
  line-height: 1.7;
}

.v4-lobby-status__primary-button,
.v4-lobby-actions__button,
.v4-settings-actions__button,
.v4-empty-state__primary-button,
.v4-empty-state__secondary-button,
.v4-consultation-history__new-button,
.v4-current-consultation__history-button,
.v4-message-input__send-button,
.v4-dialog__cancel-button,
.v4-dialog__danger-button {
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--v4-text);
  background: var(--v4-bg-card-strong);
}

.v4-lobby-status__primary-button,
.v4-lobby-actions__button.is-primary,
.v4-settings-actions__button.is-primary,
.v4-empty-state__primary-button,
.v4-consultation-history__new-button,
.v4-message-input__send-button {
  color: #1d1129;
  background: linear-gradient(180deg, var(--v4-accent-strong), var(--v4-accent));
  font-weight: 700;
}

.v4-lobby-actions,
.v4-settings-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* =========================
   Room header
========================= */

 .v4-room-screen {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.v4-room-header,
.v4-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--v4-border);
  background: rgba(18, 15, 26, 0.82);
  backdrop-filter: blur(18px);
}

.v4-room-header__main,
.v4-settings-header {
  min-width: 0;
}

.v4-room-header__main,
.v4-settings-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.v4-room-header__back-button,
.v4-settings-header__back-button,
.v4-room-header__settings-button,
.v4-room-error__close {
  flex: 0 0 auto;
  min-width: 40px;
  min-height: 40px;
  border-radius: 999px;
  color: var(--v4-text);
  background: var(--v4-bg-card);
}

.v4-room-header__settings-button {
  padding: 0 14px;
  font-size: 0.88rem;
}

.v4-room-header__text,
.v4-settings-header__text {
  min-width: 0;
}

.v4-room-header__title,
.v4-settings-header__title {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
}

.v4-room-header__description,
.v4-settings-header__description {
  margin: 4px 0 0;
  color: var(--v4-text-muted);
  font-size: 0.88rem;
}

/* =========================
   Room shell
========================= */

.v4-room-shell {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  padding: 12px 14px calc(14px + var(--v4-safe-bottom));
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

.v4-room-shell__segment {
  flex: 0 0 auto;
}

.v4-room-shell__body {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 12px;
  overflow: hidden;
}

.v4-room-segment {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--v4-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.v4-room-segment__button {
  min-height: 40px;
  border-radius: 999px;
  color: var(--v4-text-muted);
  background: transparent;
  font-weight: 700;
}

.v4-room-segment__button.is-active {
  color: #1d1129;
  background: var(--v4-accent-strong);
}

.v4-room-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 143, 159, 0.34);
  border-radius: var(--v4-radius-sm);
  color: #ffd8df;
  background: var(--v4-danger-bg);
}

.v4-room-error__text {
  min-width: 0;
  line-height: 1.5;
}

/* =========================
   Current consultation
========================= */

.v4-current-consultation,
.v4-consultation-history {
  display: flex;
  flex: 1;
  min-height: 0;
  width: 100%;
  flex-direction: column;
  border: 1px solid var(--v4-border);
  border-radius: var(--v4-radius-lg);
  background: rgba(255, 255, 255, 0.065);
  overflow: hidden;
}

.v4-current-consultation__header,
.v4-consultation-history__header {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--v4-border);
}

.v4-current-consultation__title-block,
.v4-consultation-history__title-block {
  min-width: 0;
}

.v4-current-consultation__title,
.v4-consultation-history__title {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.35;
}

.v4-current-consultation__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 8px;
  color: var(--v4-text-subtle);
  font-size: 0.78rem;
}

.v4-current-consultation__history-button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 8px 12px;
  font-size: 0.82rem;
}

.v4-current-consultation__body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.v6-current-consultation__input {
  flex: 0 0 auto;
  border-top: 1px solid var(--v4-border);
}

/* =========================
   Message list
========================= */

.v4-message-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  padding: 16px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

.v4-message-list--empty {
  justify-content: center;
}

.v4-message-list__empty-card {
  padding: 18px;
  border: 1px dashed var(--v4-border-strong);
  border-radius: var(--v4-radius-md);
  text-align: center;
  background: rgba(255, 255, 255, 0.04);
}

.v4-message-list__empty-title {
  margin: 0;
  font-weight: 700;
}

.v4-message-list__empty-description {
  margin: 8px 0 0;
  color: var(--v4-text-muted);
  line-height: 1.6;
}

.v4-message {
  display: flex;
  flex-direction: column;
  max-width: 95%;
}

.v4-message.is-user {
  align-self: flex-end;
  align-items: flex-end;
}

.v4-message.is-assistant,
.v4-message.is-unknown {
  align-self: flex-start;
  align-items: flex-start;
}

.v4-message__meta {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
  color: var(--v4-text-subtle);
  font-size: 0.74rem;
}

.v4-message__bubble {
  max-width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 18px;
  line-height: 1.7;
  word-break: break-word;
  white-space: normal;
}

.v4-message.is-user .v4-message__bubble {
  border-bottom-right-radius: 6px;
  color: #1d1129;
  background: var(--v4-accent-strong);
}

.v4-message.is-assistant .v4-message__bubble {
  border-bottom-left-radius: 6px;
  background: rgba(255, 255, 255, 0.11);
}

.v4-message.is-pending .v4-message__bubble {
  color: var(--v4-text-muted);
}

/* =========================
   Message input
========================= */

.v4-message-input {
  padding: 10px;
  background: rgba(18, 15, 26, 0.72);
}

.v4-message-input__button-area {
  display: flex;
  flex-direction: column;
  margin-left: 6px;
}

.v4-message-input__tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--v4-text-subtle);
  font-size: 0.76rem;
}

.v4-message-input__toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* .v4-message-input__main {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
} */
.v4-message-input__main {
  display: flex;
}

.v4-message-input__send-button {
  min-width: 72px;
  min-height: 46px;
}

/* =========================
   History
========================= */

.v4-consultation-history__description {
  margin: 8px 0 0;
  color: var(--v4-text-muted);
  line-height: 1.6;
}

.v4-consultation-history__new-button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.v4-consultation-history__summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--v4-border);
  color: var(--v4-text-subtle);
  font-size: 0.78rem;
}

.v4-consultation-history__list {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  overflow-y: auto;
}

.v4-consultation-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: stretch;
  border: 1px solid var(--v4-border);
  border-radius: var(--v4-radius-md);
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.v4-consultation-card.is-active {
  border-color: rgba(240, 209, 255, 0.64);
  background: rgba(217, 168, 255, 0.13);
}

.v4-consultation-card__main {
  min-width: 0;
  padding: 14px;
  text-align: left;
  color: var(--v4-text);
  background: transparent;
}

.v4-consultation-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.v4-consultation-card__title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.35;
}

.v4-consultation-card__badge {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  color: #1d1129;
  background: var(--v4-accent-strong);
  font-size: 0.7rem;
  font-weight: 700;
}

.v4-consultation-card__summary {
  margin: 8px 0 0;
  color: var(--v4-text-muted);
  line-height: 1.55;
  font-size: 0.88rem;
}

.v4-consultation-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 10px;
  color: var(--v4-text-subtle);
  font-size: 0.74rem;
}

.v4-consultation-card__actions {
  display: flex;
  align-items: stretch;
  border-left: 1px solid var(--v4-border);
}

.v4-consultation-card__delete-button {
  min-width: 58px;
  padding: 0 10px;
  color: var(--v4-danger);
  background: rgba(255, 255, 255, 0.045);
}

/* =========================
   Empty state
========================= */

.v4-empty-state {
  display: grid;
  place-items: center;
  gap: 14px;
  width: 100%;
  min-height: 280px;
  padding: 28px 20px;
  text-align: center;
}

.v4-empty-state__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--v4-border);
  border-radius: 50%;
  color: var(--v4-accent);
  background: rgba(255, 255, 255, 0.06);
}

.v4-empty-state__title {
  margin: 0;
  font-size: 1.2rem;
}

.v4-empty-state__description {
  max-width: 30em;
  margin: 10px auto 0;
  color: var(--v4-text-muted);
  line-height: 1.7;
}

.v4-empty-state__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

/* =========================
   Dialog
========================= */

.v4-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(8px);
}

.v4-dialog {
  width: min(100%, 420px);
  padding: 20px;
  border: 1px solid var(--v4-border-strong);
  border-radius: var(--v4-radius-lg);
  color: var(--v4-text);
  background: #1c1728;
  box-shadow: var(--v4-shadow);
}

.v4-dialog__title {
  margin: 0;
  font-size: 1.18rem;
}

.v4-dialog__description {
  margin: 12px 0 0;
  color: var(--v4-text-muted);
  line-height: 1.7;
}

.v4-dialog__target {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--v4-border);
  border-radius: var(--v4-radius-sm);
  background: rgba(255, 255, 255, 0.06);
}

.v4-dialog__target-label {
  color: var(--v4-text-subtle);
  font-size: 0.72rem;
}

.v4-dialog__target-title {
  font-weight: 700;
}

.v4-dialog__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.v4-dialog__danger-button {
  color: #321018;
  background: linear-gradient(180deg, #ffc1cb, var(--v4-danger));
  font-weight: 700;
}

/* =========================
   Settings
========================= */

.v4-settings-card {
  margin: 0 14px;
}

.v4-settings-card__title {
  margin: 0 0 14px;
  font-size: 1.1rem;
}

.v4-settings-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.v4-settings-list__item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--v4-border);
}

.v4-settings-list__item:last-child {
  border-bottom: 0;
}

.v4-settings-list dt {
  color: var(--v4-text-muted);
}

.v4-settings-list dd {
  margin: 0;
  text-align: right;
  font-weight: 700;
}

.v4-settings-notes {
  margin: 0;
  padding-left: 1.2em;
  color: var(--v4-text-muted);
  line-height: 1.8;
}

.v4-settings-actions {
  padding: 0 14px;
}

/* =========================
   Desktop containment
========================= */

@media (min-width: 768px) {
  body {
    background: #08070c;
  }

  .v4-screen {
    max-width: 760px;
    min-height: 100dvh;
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.42);
  }

  .v4-lobby-screen {
    padding-inline: 24px;
  }

  .v4-lobby-hero {
    grid-template-columns: 1.15fr 0.85fr;
    align-items: center;
  }

  .v4-room-shell {
    padding-inline: 18px;
  }

  .v4-message {
    max-width: 95%;
  }
}

@media (max-width: 420px) {
  .v4-current-consultation__header,
  .v4-consultation-history__header {
    flex-direction: column;
  }

  .v4-current-consultation__history-button,
  .v4-consultation-history__new-button {
    width: 100%;
  }

  .v4-consultation-card {
    grid-template-columns: 1fr;
  }

  .v4-consultation-card__actions {
    border-left: 0;
    border-top: 1px solid var(--v4-border);
  }

  .v4-consultation-card__delete-button {
    width: 100%;
    min-height: 38px;
  }
}


/* =========================
   v4 Lobby Restore from v2
   - Background
   - Lilith stage
   - Header / Main / Footer
   - Tap reaction / mini talk
========================= */

.v4-home-screen {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(214, 180, 122, 0.16), transparent 34%),
    linear-gradient(180deg, #1a1230 0%, #221538 42%, #1a132d 100%);
}

.v4-home-background {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image: url("./assets/Hermes-Home-BG-001.webp");
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  opacity: 0.95;
}

.v4-home-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(
      180deg,
      rgba(18, 12, 28, 0.22) 0%,
      rgba(18, 12, 28, 0.10) 28%,
      rgba(18, 12, 28, 0.42) 100%
    );
}

.v4-home-header {
  position: relative;
  z-index: 5;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding-top: 18px;
  pointer-events: none;
}

.v4-home-brand {
  color: #f3ddb0;
  font-family: "Times New Roman", serif;
  font-size: 34px;
  line-height: 1;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.v4-home-subtitle {
  color: rgba(246, 230, 198, 0.92);
  font-size: 15px;
  letter-spacing: 0.08em;
}

.v4-home-stage {
  position: relative;
  z-index: 5;
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  align-items: flex-end;
  justify-content: center;
  padding: 8px 18px 0;
}

.v4-home-character-wrap {
  position: relative;
  display: flex;
  width: 100%;
  max-width: 430px;
  height: 100%;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}

.v4-home-character-button {
  appearance: none;
  border: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
}

.v4-home-character {
  display: block;
  width: min(88vw, 360px);
  max-height: 80vh;
  object-fit: contain;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.32));
  user-select: none;
  -webkit-user-drag: none;
}

.v4-home-bubble-wrap {
  position: absolute;
  left: 40%;
  top: 50%;
  z-index: 8;
  width: min(56vw, 250px);
  transform: translateX(-128px);
}

.v4-home-bubble {
  border: 1px solid rgba(132, 108, 168, 0.18);
  border-radius: 18px;
  padding: 14px 14px 12px;
  color: #1e1530;
  background: rgba(255, 250, 255, 0.94);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}

.v4-home-bubble-text {
  font-size: 16px;
  line-height: 1.55;
  white-space: normal;
}

.v4-home-bubble-link {
  appearance: none;
  border: 0;
  margin-top: 10px;
  padding: 0;
  color: #6749a0;
  background: transparent;
  font-size: 13px;
  cursor: pointer;
}

.v4-home-bottom-panel {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(16px + var(--v4-safe-bottom));
  z-index: 10;
  padding: 14px 14px 16px;
  border: 1px solid rgba(255, 235, 205, 0.14);
  border-radius: 22px;
  background:
    linear-gradient(
      180deg,
      rgba(255, 248, 255, 0.16),
      rgba(255, 248, 255, 0.08)
    );
  box-shadow:
    0 12px 24px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px);
}

.v4-home-nameplate {
  margin-bottom: 10px;
  color: rgba(248, 232, 200, 0.96);
  font-size: 18px;
  letter-spacing: 0.08em;
  text-align: center;
}

.v4-home-status {
  display: grid;
  gap: 3px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 235, 205, 0.10);
  border-radius: 16px;
  background: rgba(19, 13, 31, 0.24);
}

.v4-home-status__label {
  color: rgba(246, 230, 198, 0.70);
  font-size: 12px;
}

.v4-home-status__title {
  overflow: hidden;
  color: rgba(255, 247, 234, 0.96);
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.v4-home-primary-button,
.v4-home-secondary-button {
  appearance: none;
  min-height: 46px;
  border-radius: 999px;
  cursor: pointer;
}

.v4-home-primary-button {
  border: 1px solid rgba(241, 220, 181, 0.32);
  padding: 0 20px;
  color: #fff7ea;
  background:
    linear-gradient(
      180deg,
      rgba(93, 55, 143, 0.92),
      rgba(64, 35, 102, 0.94)
    );
  box-shadow: 0 8px 20px rgba(50, 26, 81, 0.35);
  font-size: 16px;
  font-weight: 700;
}

.v4-home-secondary-button {
  border: 1px solid rgba(255, 235, 205, 0.18);
  padding: 0 16px;
  color: #fff7ea;
  background: rgba(19, 13, 31, 0.38);
}

.v4-home-mini-talk {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.v4-home-mini-talk-input {
  flex: 1;
  min-width: 0;
  min-height: 42px;
  border: 1px solid rgba(255, 235, 205, 0.18);
  border-radius: 999px;
  padding: 0 16px;
  outline: none;
  color: #f7f0ff;
  background: rgba(19, 13, 31, 0.42);
}

.v4-home-mini-talk-input::placeholder {
  color: rgba(247, 240, 255, 0.50);
}

.v4-home-mini-talk-input:focus {
  border-color: rgba(243, 221, 176, 0.42);
  box-shadow: 0 0 0 3px rgba(243, 221, 176, 0.10);
}

.v4-home-mini-talk-button {
  appearance: none;
  min-height: 42px;
  border: 1px solid rgba(241, 220, 181, 0.20);
  border-radius: 999px;
  padding: 0 16px;
  color: #fff7ea;
  background: rgba(76, 46, 118, 0.9);
  cursor: pointer;
}

@media (max-width: 420px) {
  .v4-home-header {
    padding-top: 16px;
  }

  .v4-home-brand {
    font-size: 32px;
  }

  .v4-home-character {
    width: min(92vw, 350px);
  }

  .v4-home-bubble-wrap {
    left: 42%;
    top: 48%;
    width: min(62vw, 238px);
    transform: translateX(-122px);
  }

  .v4-home-bottom-panel {
    left: 12px;
    right: 12px;
    bottom: calc(12px + var(--v4-safe-bottom));
    padding: 13px 13px 15px;
  }

  .v4-home-actions {
    grid-template-columns: 1fr 74px;
  }

  .v4-home-secondary-button {
    padding-inline: 12px;
  }

  .v4-home-mini-talk {
    gap: 8px;
  }

  .v4-home-mini-talk-button {
    padding-inline: 12px;
  }
}



/* =========================
   v4 Place Header Restore from v2
   - 3 column header
   - Gold centered title
   - Stable left / center / right layout
========================= */

.v4-place-header {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(100px, 180px) minmax(0, 1fr) minmax(100px, 180px);
  align-items: center;
  gap: 10px;
  padding: 12px 16px 11px;
  border-bottom: 1px solid rgba(255, 235, 205, 0.12);
  background:
    linear-gradient(
      180deg,
      rgba(24, 17, 35, 0.94),
      rgba(15, 11, 22, 0.86)
    );
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(16px);
}

.v4-place-header__side {
  display: flex;
  align-items: center;
  min-width: 0;
}

.v4-place-header__side--left {
  justify-content: flex-start;
}

.v4-place-header__side--right {
  justify-content: flex-end;
}

.v4-place-header__center {
  min-width: 0;
  text-align: center;
}

.v4-place-header__eyebrow {
  margin: 0 0 3px;
  color: rgba(246, 230, 198, 0.74);
  font-family: "Times New Roman", serif;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  line-height: 1;
  text-transform: uppercase;
}

.v4-place-header__title {
  margin: 0;
  overflow: hidden;
  color: #f3ddb0;
  font-family: "Times New Roman", serif;
  font-size: 1.72rem;
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow:
    0 2px 10px rgba(0, 0, 0, 0.38),
    0 0 18px rgba(243, 221, 176, 0.14);
}

.v4-place-header__description {
  margin: 5px 0 0;
  overflow: hidden;
  color: rgba(246, 230, 198, 0.74);
  font-size: 0.78rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v4-place-header__button,
.v4-room-header__back-button,
.v4-room-header__settings-button,
.v4-settings-header__back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(255, 235, 205, 0.18);
  border-radius: 999px;
  color: #fff7ea;
  background:
    linear-gradient(
      180deg,
      rgba(255, 248, 255, 0.11),
      rgba(255, 248, 255, 0.055)
    );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 6px 16px rgba(0, 0, 0, 0.14);
  font-size: 0.88rem;
  white-space: nowrap;
  transition:
    border-color 140ms ease,
    background 140ms ease,
    transform 140ms ease;
}

.v4-place-header__button:hover,
.v4-room-header__back-button:hover,
.v4-room-header__settings-button:hover,
.v4-settings-header__back-button:hover {
  border-color: rgba(243, 221, 176, 0.36);
  background:
    linear-gradient(
      180deg,
      rgba(255, 248, 255, 0.16),
      rgba(255, 248, 255, 0.075)
    );
}

.v4-place-header__button:active,
.v4-room-header__back-button:active,
.v4-room-header__settings-button:active,
.v4-settings-header__back-button:active {
  transform: scale(0.97);
}

.v4-place-header__spacer {
  display: block;
  width: 76px;
  height: 40px;
}

/* Override older room/settings header rules */

.v4-room-header__main,
.v4-settings-header {
  min-width: 0;
}

.v4-room-header__text,
.v4-settings-header__text,
.v4-room-header__eyebrow,
.v4-room-header__title,
.v4-room-header__description,
.v4-settings-header__eyebrow,
.v4-settings-header__title,
.v4-settings-header__description {
  all: unset;
}

/* Small screen tuning */

@media (max-width: 420px) {
  .v4-place-header {
    grid-template-columns: minmax(76px, 92px) minmax(0, 1fr) minmax(76px, 92px);
    gap: 7px;
    padding: 10px 11px 10px;
  }

  .v4-place-header__button,
  .v4-room-header__back-button,
  .v4-room-header__settings-button,
  .v4-settings-header__back-button {
    min-width: 72px;
    min-height: 38px;
    padding: 0 10px;
    font-size: 0.82rem;
  }

  .v4-place-header__spacer {
    width: 72px;
    height: 38px;
  }

  .v4-place-header__eyebrow {
    font-size: 0.68rem;
  }

  .v4-place-header__title {
    font-size: 1.44rem;
  }

  .v4-place-header__description {
    margin-top: 4px;
    font-size: 0.70rem;
  }
}



/* =========================
   v4 Phase 4 Folder UI
   - Folder list
   - Folder consultation list
   - Unclassified group
   - Folder delete dialog notice
========================= */

/* =========================
   Folder list view
========================= */

.v4-folder-list-view {
  display: flex;
  flex: 1;
  min-height: 0;
  width: 100%;
  flex-direction: column;
  border: 1px solid var(--v4-border-soft);
  border-radius: var(--v4-radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.083), rgba(255, 255, 255, 0.048));
  box-shadow: var(--v4-shadow-room);
  overflow: hidden;
}

.v4-folder-list-view__header {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 15px 13px;
  border-bottom: 1px solid var(--v4-border-soft);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02));
}

.v4-folder-list-view__title-block {
  min-width: 0;
}

.v4-folder-list-view__label {
  margin: 0 0 8px;
  color: rgba(239, 208, 255, 0.84);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.10em;
}

.v4-folder-list-view__title {
  margin: 0;
  color: var(--v4-text);
  font-size: 1.08rem;
  line-height: 1.35;
  letter-spacing: 0.01em;
}

.v4-folder-list-view__description {
  margin: 8px 0 0;
  color: var(--v4-text-subtle);
  line-height: 1.6;
  font-size: 0.88rem;
}

.v4-folder-list-view__new-consultation-button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 235, 205, 0.20);
  border-radius: 999px;
  color: #21132e;
  background:
    linear-gradient(180deg, #f7e4ff 0%, var(--v4-accent-strong) 100%);
  box-shadow:
    0 8px 20px rgba(215, 166, 255, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.56);
  font-weight: 700;
  white-space: nowrap;
}

.v4-folder-list-view__create {
  flex: 0 0 auto;
  padding: 12px 14px;
  border-bottom: 1px solid var(--v4-border-soft);
  background: rgba(255, 255, 255, 0.025);
}

.v4-folder-list-view__list {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 50% 0%, rgba(215, 166, 255, 0.04), transparent 30%);
}

/* =========================
   Folder create form
========================= */

.v4-folder-create {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.v4-folder-create__input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  outline: none;
  color: var(--v4-text);
  background: rgba(255, 255, 255, 0.085);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.v4-folder-create__input::placeholder {
  color: var(--v4-text-subtle);
}

.v4-folder-create__input:focus {
  border-color: rgba(240, 209, 255, 0.72);
  box-shadow: 0 0 0 3px rgba(217, 168, 255, 0.14);
}

.v4-folder-create__button {
  min-width: 68px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(255, 235, 205, 0.20);
  border-radius: 999px;
  color: #21132e;
  background:
    linear-gradient(180deg, #f7e4ff 0%, var(--v4-accent-strong) 100%);
  font-weight: 700;
  white-space: nowrap;
}

/* =========================
   Folder item
========================= */

.v4-folder-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: stretch;
  border: 1px solid rgba(255, 255, 255, 0.105);
  border-radius: var(--v4-radius-md);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.078), rgba(255, 255, 255, 0.047));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
  overflow: hidden;
  transition:
    border-color 140ms ease,
    background 140ms ease,
    transform 140ms ease;
}

.v4-folder-item:active {
  transform: scale(0.992);
}

.v4-folder-item.is-virtual {
  border-color: rgba(243, 221, 176, 0.20);
  background:
    linear-gradient(180deg, rgba(243, 221, 176, 0.105), rgba(255, 255, 255, 0.045));
}

.v4-folder-item.is-active {
  border-color: rgba(239, 208, 255, 0.52);
  background:
    linear-gradient(180deg, rgba(215, 166, 255, 0.18), rgba(255, 255, 255, 0.065));
}

.v4-folder-item__main {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  min-width: 0;
  width: 100%;
  padding: 14px;
  text-align: left;
  color: var(--v4-text);
  background: transparent;
}

.v4-folder-item__icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(239, 208, 255, 0.22);
  border-radius: 13px;
  color: var(--v4-accent-strong);
  background:
    radial-gradient(circle, rgba(215, 166, 255, 0.16), rgba(255, 255, 255, 0.055));
  font-size: 1.05rem;
}

.v4-folder-item.is-virtual .v4-folder-item__icon {
  border-color: rgba(243, 221, 176, 0.28);
  color: #f3ddb0;
  background:
    radial-gradient(circle, rgba(243, 221, 176, 0.18), rgba(255, 255, 255, 0.055));
}

.v4-folder-item__body {
  min-width: 0;
}

.v4-folder-item__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.v4-folder-item__title {
  margin: 0;
  overflow: hidden;
  color: var(--v4-text);
  font-size: 1rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v4-folder-item__active-badge {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  color: #21132e;
  background:
    linear-gradient(180deg, #f7e4ff 0%, var(--v4-accent-strong) 100%);
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.v4-folder-item__meta {
  margin: 8px 0 0;
  color: var(--v4-text-subtle);
  font-size: 0.78rem;
}

.v4-folder-item__actions {
  display: flex;
  align-items: stretch;
  border-left: 1px solid var(--v4-border-soft);
}

.v4-folder-item__delete-button {
  min-width: 58px;
  padding: 0 10px;
  color: #ffc2cc;
  background: rgba(255, 143, 159, 0.055);
  transition:
    color 140ms ease,
    background 140ms ease;
}

.v4-folder-item__delete-button:hover {
  color: #ffe1e6;
  background: rgba(255, 143, 159, 0.12);
}

.v4-folder-list-view__empty-folder-note {
  padding: 16px;
  border: 1px dashed var(--v4-border-strong);
  border-radius: var(--v4-radius-md);
  color: var(--v4-text-muted);
  background: rgba(255, 255, 255, 0.04);
  text-align: center;
}

.v4-folder-list-view__empty-folder-note p {
  margin: 0;
  line-height: 1.65;
}

.v4-folder-list-view__empty-folder-note p + p {
  margin-top: 6px;
}

/* =========================
   Folder consultation list
========================= */

.v4-folder-consultation-list {
  display: flex;
  flex: 1;
  min-height: 0;
  width: 100%;
  flex-direction: column;
  border: 1px solid var(--v4-border-soft);
  border-radius: var(--v4-radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.083), rgba(255, 255, 255, 0.048));
  box-shadow: var(--v4-shadow-room);
  overflow: hidden;
}

.v4-folder-consultation-list__header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  flex: 0 0 auto;
  padding: 13px 14px;
  border-bottom: 1px solid var(--v4-border-soft);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02));
}

.v4-folder-consultation-list__back-button,
.v4-folder-consultation-list__new-button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(255, 235, 205, 0.16);
  border-radius: 999px;
  color: #fff7ea;
  background:
    linear-gradient(
      180deg,
      rgba(255, 248, 255, 0.11),
      rgba(255, 248, 255, 0.055)
    );
  font-size: 0.82rem;
  white-space: nowrap;
}

.v4-folder-consultation-list__new-button {
  color: #21132e;
  background:
    linear-gradient(180deg, #f7e4ff 0%, var(--v4-accent-strong) 100%);
  font-weight: 700;
}

.v4-folder-consultation-list__title-block {
  min-width: 0;
  text-align: center;
}

.v4-folder-consultation-list__label {
  margin: 0 0 4px;
  color: rgba(239, 208, 255, 0.78);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.10em;
}

.v4-folder-consultation-list__title {
  margin: 0;
  overflow: hidden;
  color: var(--v4-text);
  font-size: 1.05rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v4-folder-consultation-list__description {
  margin: 5px 0 0;
  overflow: hidden;
  color: var(--v4-text-subtle);
  font-size: 0.76rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v4-folder-consultation-list__summary {
  display: flex;
  flex: 0 0 auto;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--v4-border-soft);
  color: var(--v4-text-subtle);
  font-size: 0.78rem;
}

.v4-folder-consultation-list__body {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 50% 0%, rgba(215, 166, 255, 0.04), transparent 30%);
}

/* =========================
   Folder consultation empty
========================= */

.v4-folder-consultation-list__empty {
  display: grid;
  place-items: center;
  gap: 12px;
  min-height: 280px;
  padding: 28px 18px;
  text-align: center;
}

.v4-folder-consultation-list__empty-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(239, 208, 255, 0.28);
  border-radius: 50%;
  color: var(--v4-accent-strong);
  background:
    radial-gradient(circle, rgba(215, 166, 255, 0.20), rgba(255, 255, 255, 0.06));
}

.v4-folder-consultation-list__empty-title {
  margin: 0;
  color: var(--v4-text);
  font-size: 1.08rem;
  line-height: 1.45;
}

.v4-folder-consultation-list__empty-description {
  max-width: 28em;
  margin: 0;
  color: var(--v4-text-muted);
  line-height: 1.7;
}

.v4-folder-consultation-list__empty-button {
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 235, 205, 0.20);
  border-radius: 999px;
  color: #21132e;
  background:
    linear-gradient(180deg, #f7e4ff 0%, var(--v4-accent-strong) 100%);
  font-weight: 700;
}

/* =========================
   Folder delete dialog notice
========================= */

.v4-dialog__notice {
  margin-top: 14px;
  padding: 11px 12px;
  border: 1px solid rgba(243, 221, 176, 0.18);
  border-radius: var(--v4-radius-sm);
  color: rgba(255, 247, 234, 0.88);
  background: rgba(243, 221, 176, 0.075);
}

.v4-dialog__notice p {
  margin: 0;
  line-height: 1.65;
  font-size: 0.86rem;
}

.v4-dialog__target-note {
  color: var(--v4-text-subtle);
  font-size: 0.82rem;
}

/* =========================
   Phase 4 small-screen tuning
========================= */

@media (max-width: 420px) {
  .v4-folder-list-view__header {
    flex-direction: column;
    align-items: stretch;
  }

  .v4-folder-list-view__new-consultation-button {
    min-height: 28px;
    padding: 6px;
    width: 100%;
  }

  .v4-folder-create {
    grid-template-columns: 1fr 64px;
  }

  .v4-folder-create__button {
    min-width: 64px;
    padding-inline: 10px;
  }

  .v4-folder-item {
    grid-template-columns: 1fr;
  }

  .v4-folder-item__actions {
    border-left: 0;
    border-top: 1px solid var(--v4-border-soft);
  }

  .v4-folder-item__delete-button {
    width: 100%;
    min-height: 38px;
  }

  .v4-folder-item__header {
    gap: 6px;
  }

  .v4-folder-item__active-badge {
    align-self: flex-start;
  }

  .v4-folder-consultation-list__header {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .v4-folder-consultation-list__title-block {
    text-align: left;
  }

  .v4-folder-consultation-list__back-button,
  .v4-folder-consultation-list__new-button {
    width: 100%;
  }

  .v4-folder-consultation-list__description {
    white-space: normal;
  }
}


/* =========================
   v4 Phase 4 Folder Rename
========================= */

.v4-folder-item__actions {
  display: grid;
  grid-template-columns: auto;
  min-width: 70px;
}

.v4-folder-item__rename-button,
.v4-folder-item__delete-button {
  min-width: 70px;
  padding: 0 10px;
  font-size: 0.78rem;
}

.v4-folder-item__rename-button {
  color: rgba(255, 247, 234, 0.92);
  background: rgba(255, 255, 255, 0.055);
  border-bottom: 1px solid var(--v4-border-soft);
  transition:
    color 140ms ease,
    background 140ms ease;
}

.v4-folder-item__rename-button:hover {
  color: #fff7ea;
  background: rgba(255, 255, 255, 0.10);
}

@media (max-width: 420px) {
  .v4-folder-item__actions {
    grid-template-columns: 1fr 1fr;
    min-width: 0;
  }

  .v4-folder-item__rename-button,
  .v4-folder-item__delete-button {
    width: 100%;
    min-height: 40px;
  }

  .v4-folder-item__rename-button {
    border-bottom: 0;
    border-right: 1px solid var(--v4-border-soft);
  }
}


/* =========================
   v4 Phase 4 Consultation Rename
========================= */

.v4-consultation-card__actions {
  display: grid;
  grid-template-columns: auto;
  min-width: 70px;
}

.v4-consultation-card__rename-button,
.v4-consultation-card__delete-button {
  min-width: 70px;
  padding: 0 10px;
  font-size: 0.78rem;
}

.v4-consultation-card__rename-button {
  color: rgba(255, 247, 234, 0.92);
  background: rgba(255, 255, 255, 0.055);
  border-bottom: 1px solid var(--v4-border-soft);
  transition:
    color 140ms ease,
    background 140ms ease;
}

.v4-consultation-card__rename-button:hover {
  color: #fff7ea;
  background: rgba(255, 255, 255, 0.10);
}

.v4-current-consultation__actions {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 8px;
}

.v4-current-consultation__rename-button {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--v4-border-soft);
  border-radius: 999px;
  color: rgba(255, 247, 234, 0.92);
  background: rgba(255, 255, 255, 0.075);
  font-size: 0.82rem;
  white-space: nowrap;
}

.v4-current-consultation__rename-button:hover {
  color: #fff7ea;
  background: rgba(255, 255, 255, 0.10);
}

@media (max-width: 420px) {
  .v4-consultation-card__actions {
    grid-template-columns: 1fr 1fr;
    min-width: 0;
  }

  .v4-consultation-card__rename-button,
  .v4-consultation-card__delete-button {
    width: 100%;
    min-height: 40px;
  }

  .v4-consultation-card__rename-button {
    border-bottom: 0;
    border-right: 1px solid var(--v4-border-soft);
  }

  .v4-current-consultation__actions {
    flex-direction: row;
  }

  .v4-current-consultation__rename-button,
  .v4-current-consultation__history-button {
    flex: 1;
    width: auto;
  }
}


/* =========================
   v4 Phase 4 Folder Header Rename
========================= */

.v4-folder-consultation-list__actions {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 8px;
}

.v4-folder-consultation-list__rename-button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(255, 235, 205, 0.16);
  border-radius: 999px;
  color: rgba(255, 247, 234, 0.92);
  background:
    linear-gradient(
      180deg,
      rgba(255, 248, 255, 0.11),
      rgba(255, 248, 255, 0.055)
    );
  font-size: 0.82rem;
  white-space: nowrap;
}

.v4-folder-consultation-list__rename-button:hover {
  color: #fff7ea;
  background: rgba(255, 255, 255, 0.10);
}

@media (max-width: 420px) {
  .v4-folder-consultation-list__actions {
    width: 100%;
    flex-direction: row;
  }

  .v4-folder-consultation-list__rename-button,
  .v4-folder-consultation-list__new-button {
    flex: 1;
    width: auto;
  }
}


/* =========================
   v4 Phase 4 Consultation Move
========================= */

.v4-consultation-card__move {
  display: grid;
  gap: 4px;
  min-width: 112px;
  padding: 8px 8px;
  border-bottom: 1px solid var(--v4-border-soft);
  background: rgba(255, 255, 255, 0.035);
}

.v4-consultation-card__move-label {
  color: var(--v4-text-subtle);
  font-size: 0.68rem;
  line-height: 1;
}

.v4-consultation-card__move-select {
  width: 100%;
  min-width: 0;
  min-height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 0 8px;
  color: var(--v4-text);
  background: rgba(18, 15, 26, 0.86);
  font-size: 0.76rem;
  outline: none;
}

.v4-consultation-card__move-select:focus {
  border-color: rgba(240, 209, 255, 0.72);
  box-shadow: 0 0 0 3px rgba(217, 168, 255, 0.14);
}

@media (max-width: 420px) {
  .v4-consultation-card__move {
    grid-column: 1 / -1;
    min-width: 0;
    padding: 9px 10px;
  }

  .v4-consultation-card__move-select {
    min-height: 34px;
  }
}


/* =========================
   v4 Phase 5 Common UI
   - Action menu
   - Dialog shell helpers
   - Add card
   - Status badge
   - Target preview
   - Warning block
========================= */

/* Action menu */

.v4-action-menu-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.v4-action-menu-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 235, 205, 0.16);
  border-radius: 999px;
  color: rgba(255, 247, 234, 0.92);
  background:
    linear-gradient(
      180deg,
      rgba(255, 248, 255, 0.11),
      rgba(255, 248, 255, 0.055)
    );
  font-size: 1.2rem;
  line-height: 1;
}

.v4-action-menu-button:hover,
.v4-action-menu-button.is-open {
  color: #fff7ea;
  border-color: rgba(243, 221, 176, 0.36);
  background:
    linear-gradient(
      180deg,
      rgba(255, 248, 255, 0.16),
      rgba(255, 248, 255, 0.075)
    );
}

.v4-action-menu {
  position: absolute;
  top: calc(100% + 6px);
  z-index: 50;
  display: grid;
  min-width: 164px;
  padding: 6px;
  border: 1px solid rgba(255, 235, 205, 0.16);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(33, 23, 46, 0.98), rgba(23, 17, 32, 0.98));
  box-shadow:
    0 14px 32px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px);
}

.v4-action-menu--right {
  right: 0;
}

.v4-action-menu--left {
  left: 0;
}

.v4-action-menu__item {
  min-height: 38px;
  border: 0;
  border-radius: 10px;
  padding: 0 11px;
  color: rgba(255, 247, 234, 0.92);
  background: transparent;
  font-size: 0.86rem;
  text-align: left;
}

.v4-action-menu__item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.v4-action-menu__item.is-danger {
  color: #ffc2cc;
}

.v4-action-menu__item.is-danger:hover {
  color: #ffe1e6;
  background: rgba(255, 143, 159, 0.12);
}

.v4-action-menu__item:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

/* Dialog shell */

.v4-dialog-shell {
  max-height: min(680px, calc(100dvh - 32px));
  overflow: hidden;
}

.v4-dialog__close-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--v4-border-soft);
  border-radius: 999px;
  color: rgba(255, 247, 234, 0.86);
  background: rgba(255, 255, 255, 0.065);
}

.v4-dialog__body {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  overflow-y: auto;
}

.v4-dialog__confirm-button {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid rgba(255, 235, 205, 0.20);
  border-radius: 999px;
  color: #21132e;
  background:
    linear-gradient(180deg, #f7e4ff 0%, var(--v4-accent-strong) 100%);
  font-weight: 700;
}

/* Target preview */

.v4-target-preview-card {
  display: grid;
  gap: 4px;
  padding: 12px 13px;
  border: 1px solid var(--v4-border-soft);
  border-radius: var(--v4-radius-sm);
  background: rgba(255, 255, 255, 0.055);
}

.v4-target-preview-card__label {
  color: var(--v4-text-subtle);
  font-size: 0.74rem;
}

.v4-target-preview-card__title {
  overflow: hidden;
  color: var(--v4-text);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v4-target-preview-card__meta,
.v4-target-preview-card__note {
  color: var(--v4-text-muted);
  font-size: 0.82rem;
}

/* Warning block */

.v4-warning-block {
  padding: 11px 12px;
  border-radius: var(--v4-radius-sm);
  line-height: 1.65;
}

.v4-warning-block--warning {
  border: 1px solid rgba(243, 221, 176, 0.18);
  color: rgba(255, 247, 234, 0.90);
  background: rgba(243, 221, 176, 0.075);
}

.v4-warning-block--danger {
  border: 1px solid rgba(255, 143, 159, 0.22);
  color: #ffe1e6;
  background: rgba(255, 143, 159, 0.085);
}

.v4-warning-block__title {
  display: block;
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.v4-warning-block__message {
  margin: 0;
  font-size: 0.86rem;
}

/* Add card */

.v4-add-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  width: 100%;
  min-height: 72px;
  align-items: center;
  padding: 14px;
  border: 1px dashed rgba(243, 221, 176, 0.28);
  border-radius: var(--v4-radius-md);
  color: rgba(255, 247, 234, 0.92);
  background:
    linear-gradient(180deg, rgba(243, 221, 176, 0.075), rgba(255, 255, 255, 0.035));
  text-align: left;
}

.v4-add-card:hover {
  border-color: rgba(243, 221, 176, 0.46);
  background:
    linear-gradient(180deg, rgba(243, 221, 176, 0.12), rgba(255, 255, 255, 0.05));
}

.v4-add-card__icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(243, 221, 176, 0.28);
  border-radius: 50%;
  color: #f3ddb0;
  background: rgba(243, 221, 176, 0.10);
  font-size: 1.25rem;
}

.v4-add-card__body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.v4-add-card__title {
  color: var(--v4-text);
  font-weight: 700;
}

.v4-add-card__description {
  color: var(--v4-text-muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

/* Status badge */

.v4-status-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.v4-status-badge--default {
  color: #21132e;
  background:
    linear-gradient(180deg, #f7e4ff 0%, var(--v4-accent-strong) 100%);
}

.v4-status-badge--subtle {
  color: rgba(255, 247, 234, 0.84);
  background: rgba(255, 255, 255, 0.085);
}

.v4-status-badge--warning {
  color: #2f210b;
  background: #f3ddb0;
}

.v4-status-badge--danger {
  color: #3a1018;
  background: #ffc2cc;
}

@media (max-width: 420px) {
  .v4-action-menu {
    min-width: 156px;
  }

  .v4-dialog-shell {
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
  }

  .v4-add-card {
    min-height: 68px;
  }
}

/* =========================
   v4 Phase 5 Consultation Card Action Menu
========================= */

.v4-consultation-card {
  position: relative;
}

.v4-consultation-card__main {
  padding-right: 54px;
}

.v4-consultation-card__actions {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  display: flex;
  min-width: 0;
}

.v4-consultation-card__actions .v4-action-menu-container {
  display: inline-flex;
}

/* Phase 4 move select / old side buttons cleanup */

.v4-consultation-card__move {
  display: none;
}

.v4-consultation-card__rename-button,
.v4-consultation-card__delete-button {
  display: none;
}

/* =========================
   v4 Phase 5 Move Dialog
========================= */

.v4-move-dialog__options {
  display: grid;
  gap: 8px;
}

.v4-move-dialog__option {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  width: 100%;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--v4-border-soft);
  border-radius: var(--v4-radius-sm);
  color: var(--v4-text);
  background: rgba(255, 255, 255, 0.055);
  text-align: left;
}

.v4-move-dialog__option:hover {
  border-color: rgba(243, 221, 176, 0.28);
  background: rgba(255, 255, 255, 0.085);
}

.v4-move-dialog__option.is-selected {
  border-color: rgba(239, 208, 255, 0.52);
  background:
    linear-gradient(180deg, rgba(215, 166, 255, 0.18), rgba(255, 255, 255, 0.065));
}

.v4-move-dialog__option-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.v4-move-dialog__option-name {
  overflow: hidden;
  color: var(--v4-text);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v4-move-dialog__option-description {
  color: var(--v4-text-subtle);
  font-size: 0.82rem;
}

.v4-move-dialog__option-check {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  color: #21132e;
  background:
    linear-gradient(180deg, #f7e4ff 0%, var(--v4-accent-strong) 100%);
  font-size: 0.85rem;
  font-weight: 700;
}

.v4-dialog__inline-error {
  margin: 0;
  padding: 10px 11px;
  border: 1px solid rgba(255, 143, 159, 0.22);
  border-radius: var(--v4-radius-sm);
  color: #ffe1e6;
  background: rgba(255, 143, 159, 0.085);
  font-size: 0.86rem;
  line-height: 1.55;
}

@media (max-width: 420px) {
  .v4-consultation-card__main {
    padding-right: 50px;
  }

  .v4-consultation-card__actions {
    top: 9px;
    right: 9px;
  }

  .v4-move-dialog__option {
    padding: 11px;
  }
}


/* =========================
   v4 Phase 5 Action Menu Clipping Fix
========================= */

.v4-consultation-card {
  overflow: visible;
}

.v4-consultation-card__actions {
  z-index: 30;
}

.v4-consultation-card__actions .v4-action-menu {
  z-index: 80;
}

/* =========================
   v4 Phase 5 Action Menu Opaque / Layer Fix
========================= */

.v4-consultation-card {
  position: relative;
  z-index: 1;
}

.v4-consultation-card.is-menu-open {
  z-index: 60;
}

.v4-consultation-card.is-menu-open .v4-action-menu-container {
  z-index: 90;
}

.v4-consultation-card.is-menu-open .v4-action-menu {
  z-index: 100;
}

/* Make action menu visually opaque and prevent lower controls from showing through */

.v4-action-menu {
  background: #171120;
  border-color: rgba(243, 221, 176, 0.26);
  box-shadow:
    0 16px 38px rgba(0, 0, 0, 0.46),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: none;
  pointer-events: auto;
}

.v4-action-menu__item {
  background: #171120;
}

.v4-action-menu__item:hover {
  background: #261b35;
}

.v4-action-menu__item.is-danger:hover {
  background: #39202a;
}

/* =========================
   v4 Phase 5 Current Consultation Action Menu
========================= */

.v4-current-consultation__header {
  position: relative;
}

.v4-current-consultation__actions {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: flex-end;
  z-index: 40;
}

.v4-current-consultation__actions .v4-action-menu-container {
  z-index: 90;
}

.v4-current-consultation__actions .v4-action-menu {
  z-index: 100;
}

/* Hide old Phase 4 buttons if any remain in DOM */

.v4-current-consultation__rename-button,
.v4-current-consultation__history-button {
  display: none;
}

@media (max-width: 420px) {
  .v4-current-consultation__header {
    gap: 10px;
  }

  .v4-current-consultation__actions {
    align-self: flex-start;
  }
}

/* =========================
   v4 Phase 5 Folder Action Menu
========================= */

.v4-folder-item {
  position: relative;
  overflow: visible;
  z-index: 1;
}

.v4-folder-item.is-menu-open {
  z-index: 60;
}

.v4-folder-item__main {
  padding-right: 54px;
}

.v4-folder-item__actions {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 30;
  display: flex;
  min-width: 0;
  border-left: 0;
}

.v4-folder-item__actions .v4-action-menu-container {
  z-index: 90;
}

.v4-folder-item__actions .v4-action-menu {
  z-index: 100;
}

/* Hide old Phase 4 folder side buttons if any remain */

.v4-folder-item__rename-button,
.v4-folder-item__delete-button {
  display: none;
}

/* Folder header action menu */

.v4-folder-consultation-list__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 42px;
}

.v4-folder-consultation-list__actions .v4-action-menu-container {
  z-index: 90;
}

.v4-folder-consultation-list__actions .v4-action-menu {
  z-index: 100;
}

/* Hide old Phase 4 header buttons if any remain */

.v4-folder-consultation-list__rename-button,
.v4-folder-consultation-list__new-button {
  display: none;
}

@media (max-width: 420px) {
  .v4-folder-item__main {
    padding-right: 50px;
  }

  .v4-folder-item__actions {
    top: 9px;
    right: 9px;
  }

  .v4-folder-consultation-list__actions {
    justify-content: flex-start;
  }
}

/* =========================
   v4 Phase 5 Create Dialog / AddCard Migration
========================= */

/* Hide old folder create form if any remains */

.v4-folder-list-view__create,
.v4-folder-create {
  display: none;
}

/* Create dialog */

.v4-create-dialog__field {
  display: grid;
  gap: 7px;
}

.v4-create-dialog__label {
  color: var(--v4-text-subtle);
  font-size: 0.82rem;
  font-weight: 700;
}

.v4-create-dialog__input {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  outline: none;
  color: var(--v4-text);
  background: rgba(255, 255, 255, 0.085);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.v4-create-dialog__input::placeholder {
  color: var(--v4-text-subtle);
}

.v4-create-dialog__input:focus {
  border-color: rgba(240, 209, 255, 0.72);
  box-shadow: 0 0 0 3px rgba(217, 168, 255, 0.14);
}

.v4-create-dialog__helper {
  margin: 0;
  color: var(--v4-text-muted);
  font-size: 0.84rem;
  line-height: 1.6;
}

/* AddCard spacing in folder / consultation lists */

.v4-folder-list-view__list > .v4-add-card,
.v4-folder-consultation-list__body > .v4-add-card {
  flex: 0 0 auto;
}

.v4-folder-consultation-list__body > .v4-add-card {
  margin-top: 2px;
}

/* Old empty button no longer used */

.v4-folder-consultation-list__empty-button {
  display: none;
}

/* =========================
   v4 Phase 5 Rename Dialog
========================= */

.v4-rename-dialog__field {
  display: grid;
  gap: 7px;
}

.v4-rename-dialog__label {
  color: var(--v4-text-subtle);
  font-size: 0.82rem;
  font-weight: 700;
}

.v4-rename-dialog__input {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  outline: none;
  color: var(--v4-text);
  background: rgba(255, 255, 255, 0.085);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.v4-rename-dialog__input::placeholder {
  color: var(--v4-text-subtle);
}

.v4-rename-dialog__input:focus {
  border-color: rgba(240, 209, 255, 0.72);
  box-shadow: 0 0 0 3px rgba(217, 168, 255, 0.14);
}

/* =========================
   v4 Phase 5 Delete Dialog
========================= */

.v4-delete-dialog .v4-target-preview-card {
  border-color: rgba(255, 143, 159, 0.18);
  background: rgba(255, 143, 159, 0.055);
}

.v4-delete-dialog .v4-dialog__body {
  gap: 13px;
}

.v4-delete-dialog .v4-dialog__danger-button {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid rgba(255, 143, 159, 0.32);
  border-radius: 999px;
  color: #3a1018;
  background: #ffc2cc;
  font-weight: 700;
}

.v4-delete-dialog .v4-dialog__danger-button:hover {
  background: #ffe1e6;
}

.v4-delete-dialog .v4-dialog__danger-button:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

/* =========================
   v4 Phase 5 Settings Screen Tuning
========================= */

 .v4-settings-screen {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.v4-settings-header {
  flex: 0 0 auto;
  padding: 16px;
  border: 1px solid var(--v4-border-soft);
  border-radius: var(--v4-radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.083), rgba(255, 255, 255, 0.048));
  box-shadow: var(--v4-shadow-room);
}

.v4-settings-header__label,
.v4-settings-section__label {
  margin: 0 0 8px;
  color: rgba(239, 208, 255, 0.84);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.v4-settings-header__title,
.v4-settings-section__title {
  margin: 0;
  color: var(--v4-text);
  line-height: 1.35;
}

.v4-settings-header__title {
  font-size: 1.35rem;
}

.v4-settings-section__title {
  font-size: 1.05rem;
}

.v4-settings-header__description,
.v4-settings-section__description {
  margin: 8px 0 0;
  color: var(--v4-text-subtle);
  font-size: 0.88rem;
  line-height: 1.65;
}

.v4-settings-section-block {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0 6px;
}

.v4-settings-section {
  flex: 0 0 auto;
  margin-top: 6px;
  padding: 14px;
  border: 1px solid var(--v4-border-soft);
  border-radius: var(--v4-radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.066), rgba(255, 255, 255, 0.038));
  box-shadow: var(--v4-shadow-room);
}

.v4-settings-section--developer {
  flex: 1 1 auto;
  min-height: 0;
}

.v4-settings-placeholder {
  margin-top: 12px;
  padding: 12px;
  border: 1px dashed var(--v4-border-strong);
  border-radius: var(--v4-radius-sm);
  color: var(--v4-text-muted);
  background: rgba(255, 255, 255, 0.035);
  line-height: 1.65;
}

.v4-settings-placeholder p {
  margin: 0;
}

.v4-settings-dev-grid {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

/* .v4-settings-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 11px;
  border: 1px solid var(--v4-border-soft);
  border-radius: var(--v4-radius-sm);
  background: rgba(255, 255, 255, 0.045);
} */
 .v4-settings-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 11px;
  border: 1px solid var(--v4-border-soft);
  border-radius: var(--v4-radius-sm);
  background: rgba(255, 255, 255, 0.045);
}

.v4-settings-item__body {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.v4-settings-item__label {
  color: var(--v4-text);
  font-size: 0.86rem;
  font-weight: 700;
}

.v4-settings-item__description {
  color: var(--v4-text-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.v4-settings-item__value {
  overflow: hidden;
  padding: 5px 8px;
  border-radius: 999px;
  color: rgba(255, 247, 234, 0.88);
  background: rgba(255, 255, 255, 0.075);
  font-family:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    "Liberation Mono",
    "Courier New",
    monospace;
  font-size: 0.74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v4-settings-footer {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 4px 0 0;
}

.v4-settings-screen__nav-button {
  min-height: 44px;
  border: 1px solid rgba(255, 235, 205, 0.16);
  border-radius: 999px;
  color: #fff7ea;
  background:
    linear-gradient(
      180deg,
      rgba(255, 248, 255, 0.11),
      rgba(255, 248, 255, 0.055)
    );
  font-weight: 700;
}

.v4-settings-screen__nav-button:hover {
  border-color: rgba(243, 221, 176, 0.34);
  background:
    linear-gradient(
      180deg,
      rgba(255, 248, 255, 0.16),
      rgba(255, 248, 255, 0.075)
    );
}

@media (max-width: 420px) {
  .v4-settings-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .v4-settings-item__value {
    width: fit-content;
  }
}

/* =========================
   v4 Phase 5 Settings Header Layout Fix
========================= */

.v4-settings-hero {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 72px;
  align-items: center;
  min-height: 116px;
  padding: 18px 20px;
  border: 1px solid var(--v4-border-soft);
  border-radius: var(--v4-radius-lg);
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.083),
      rgba(255, 255, 255, 0.048)
    );
  box-shadow: var(--v4-shadow-room);
}

.v4-settings-hero__side {
  min-width: 0;
  min-height: 44px;
}

.v4-settings-hero__center {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-width: 0;
  text-align: center;
}

.v4-settings-hero__eyebrow {
  margin: 0;
  color: rgba(239, 208, 255, 0.84);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.v4-settings-hero__title {
  margin: 0;
  color: var(--v4-text);
  font-size: 1.8rem;
  line-height: 1.25;
}

.v4-settings-hero__description {
  max-width: 56ch;
  margin: 0;
  color: var(--v4-text-subtle);
  font-size: 0.92rem;
  line-height: 1.65;
}

@media (max-width: 420px) {
  .v4-settings-hero {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    min-height: auto;
    padding: 16px 14px;
  }

  .v4-settings-hero__title {
    font-size: 1.45rem;
  }

  .v4-settings-hero__description {
    font-size: 0.86rem;
  }
}

/* =========================
   v4 Phase 5 Dialog Close Button Removal
========================= */

.v4-dialog__header {
  justify-content: center;
  text-align: center;
}

.v4-dialog__title {
  width: 100%;
  text-align: center;
}

.v4-dialog__close-button {
  display: none;
}


/* =========================
   v4 Phase 5 Duplicate Label Cleanup
========================= */

.v4-current-consultation__folder-name {
  margin: 0 0 8px;
  width: fit-content;
  max-width: 100%;
  overflow: hidden;
  padding: 4px 9px;
  border: 1px solid rgba(243, 221, 176, 0.20);
  border-radius: 999px;
  color: rgba(255, 247, 234, 0.88);
  background: rgba(243, 221, 176, 0.075);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Safety: if old duplicate labels remain in DOM, hide them */

.v4-folder-list-view__label,
.v4-folder-consultation-list__label {
  display: none;
}


/* =========================
   v4 Phase 6 Network Access Toggle
========================= */

.v4-message-input-bar__network-toggle {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid rgba(255, 235, 205, 0.16);
  border-radius: 999px;
  color: rgba(255, 247, 234, 0.78);
  background: rgba(255, 255, 255, 0.055);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.v4-message-input-bar__network-toggle:hover {
  border-color: rgba(243, 221, 176, 0.32);
  color: rgba(255, 247, 234, 0.92);
  background: rgba(255, 255, 255, 0.08);
}

.v4-message-input-bar__network-toggle.is-active {
  border-color: rgba(176, 225, 255, 0.44);
  color: #e9f7ff;
  background: rgba(94, 181, 255, 0.16);
}

.v4-message-input-bar__network-toggle:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.v4-message-input-bar__network-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 247, 234, 0.34);
}

.v4-message-input-bar__network-toggle.is-active
  .v4-message-input-bar__network-dot {
  background: #8ed7ff;
  box-shadow: 0 0 10px rgba(142, 215, 255, 0.62);
}

@media (max-width: 420px) {
  .v4-message-input-bar__network-toggle {
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.72rem;
  }
}


/* =========================
   v4 Small Screen UI Adjustment
   Lobby simple bottom panel
========================= */

.v4-home-bottom-panel--simple {
  display: flex;
  gap: 20px;
  margin: 0 auto;
  padding: 10px 14px 14px;
}

.v4-home-bottom-panel--simple .v4-home-primary-button {
  width: min(100%, 360px);
  min-height: 42px;
  justify-self: center;
  padding: 0 18px;
  font-size: 0.96rem;
}

.v4-home-bottom-panel--simple .v4-home-secondary-button,
.v4-home-bottom-panel--simple .v4-home-status,
.v4-home-bottom-panel--simple .v4-home-mini-talk {
  display: none;
}
/* v4 Theme 1-A: assistant response mode label */
.v4-message__response-mode {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 2px 7px;
  border: 1px solid rgba(255, 247, 234, 0.16);
  border-radius: 999px;
  color: var(--v4-text-subtle);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.68rem;
  line-height: 1.3;
  white-space: nowrap;
}

.v4-message__response-mode.is-network {
  border-color: rgba(184, 231, 255, 0.28);
  background: rgba(116, 196, 255, 0.10);
}

.v4-message__response-mode.is-network-failed {
  border-color: rgba(255, 214, 153, 0.28);
  background: rgba(255, 194, 102, 0.10);
}

/* =========================
   v4 Theme 1-B: Markdown message body
========================= */
.v4-message-markdown {
  line-height: 1.75;
  overflow-wrap: anywhere;
  word-break: normal;
}

.v4-message-markdown > *:first-child {
  margin-top: 0;
}

.v4-message-markdown > *:last-child {
  margin-bottom: 0;
}

.v4-message-markdown p {
  margin: 0.55em 0;
}

.v4-message-markdown h1,
.v4-message-markdown h2,
.v4-message-markdown h3,
.v4-message-markdown h4 {
  margin: 0.95em 0 0.42em;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.v4-message-markdown h1 {
  font-size: 1.18rem;
}

.v4-message-markdown h2 {
  font-size: 1.08rem;
}

.v4-message-markdown h3,
.v4-message-markdown h4 {
  font-size: 1rem;
}

.v4-message-markdown ul,
.v4-message-markdown ol {
  margin: 0.55em 0;
  padding-left: 1.35em;
}

.v4-message-markdown li {
  margin: 0.25em 0;
  padding-left: 0.1em;
}

.v4-message-markdown strong {
  font-weight: 700;
}

.v4-message-markdown code {
  padding: 0.1em 0.34em;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.88em;
  background: rgba(0, 0, 0, 0.22);
}

.v4-message-markdown__pre {
  max-width: 100%;
  margin: 0.7em 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  overflow-x: auto;
  color: rgba(255, 247, 234, 0.94);
  background: rgba(0, 0, 0, 0.28);
  -webkit-overflow-scrolling: touch;
}

.v4-message-markdown__pre code,
.v4-message-markdown code.v4-message-markdown__code-block {
  display: block;
  min-width: max-content;
  padding: 0;
  border: 0;
  border-radius: 0;
  line-height: 1.62;
  white-space: pre;
  overflow-wrap: normal;
  word-break: normal;
  background: transparent;
}

.v4-message-markdown a {
  color: rgba(207, 228, 255, 0.98);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  overflow-wrap: anywhere;
}

.v4-message-markdown blockquote {
  margin: 0.7em 0;
  padding: 0.1em 0 0.1em 0.85em;
  border-left: 3px solid rgba(255, 247, 234, 0.24);
  color: var(--v4-text-muted);
  background: rgba(255, 255, 255, 0.04);
}

.v4-message-markdown blockquote p {
  margin: 0.42em 0;
}

.v4-message-markdown__hr {
  margin: 0.85em 0;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

@media (max-width: 420px) {
  .v4-message__meta {
    flex-wrap: wrap;
  }

  .v4-message-markdown {
    line-height: 1.68;
  }

  .v4-message-markdown h1 {
    font-size: 1.08rem;
  }

  .v4-message-markdown h2 {
    font-size: 1.02rem;
  }

  .v4-message-markdown h3,
  .v4-message-markdown h4 {
    font-size: 0.96rem;
  }

  .v4-message-markdown ul,
  .v4-message-markdown ol {
    padding-left: 1.15em;
  }

  .v4-message-markdown__pre {
    padding: 10px;
  }
}

/* =========================
   v4 Theme 2 POC-1 Voice Input
========================= */

.v4-message-input-bar__voice-button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid rgba(255, 235, 205, 0.16);
  border-radius: 999px;
  color: rgba(255, 247, 234, 0.78);
  background: rgba(255, 255, 255, 0.055);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.v4-message-input-bar__voice-button:hover {
  border-color: rgba(243, 221, 176, 0.32);
  color: rgba(255, 247, 234, 0.92);
  background: rgba(255, 255, 255, 0.08);
}

.v4-message-input-bar__voice-button.is-active {
  border-color: rgba(255, 205, 147, 0.46);
  color: #fff1da;
  background: rgba(255, 172, 88, 0.16);
}

.v4-message-input-bar__voice-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.v4-message-input-bar__voice-icon {
  font-size: 0.9rem;
  line-height: 1;
}

.v4-message-input__voice-status {
  margin: 8px 0 0;
  color: var(--v4-text-subtle);
  font-size: 0.74rem;
  line-height: 1.5;
}

.v4-message-input__voice-status.is-listening,
.v4-message-input__voice-status.is-transcribing {
  color: rgba(255, 241, 218, 0.86);
}

.v4-message-input__voice-status.is-completed {
  color: rgba(191, 237, 216, 0.92);
}

.v4-message-input__voice-status.is-failed,
.v4-message-input__voice-status.is-unsupported,
.v4-message-input__voice-status.is-permission_denied {
  color: rgba(255, 194, 194, 0.92);
}

/* =========================
   v4 Theme 2 POC-1.5 Continuous Voice Input
========================= */

.v4-message-input__voice-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.v4-message-input__voice-preview {
  margin: 8px 0 0;
  padding: 9px 11px;
  border: 1px solid rgba(255, 235, 205, 0.12);
  border-radius: 12px;
  color: rgba(255, 247, 234, 0.82);
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.78rem;
  line-height: 1.55;
  max-height: 128px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.v4-message-input__voice-preview-label {
  margin: 0 0 4px;
  color: rgba(255, 247, 234, 0.58);
  font-size: 0.7rem;
  font-weight: 700;
}

.v4-message-input__voice-preview-text {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.v4-message-input__voice-preview-text.is-interim {
  margin-top: 4px;
  color: rgba(255, 247, 234, 0.52);
}

/* =========================
   v4 Theme 2 Formal Voice Input UI
   案E': 二層グループ型 + 安全オーバーレイプレビュー型
========================= */

.v4-message-input {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: rgba(18, 15, 26, 0.72);
}

.v6-message-input__send-group {
  position: relative;
  display: grid;
  gap: 8px;
  /* padding: 9px; */
}

.v6-message-input__compose-group {
  overflow: visible;
  gap: 6px;
  display: flex;
  flex-direction: column;
}

.v4-message-input__group {
  display: flex;
  gap: 6px;
}

.v4-message-input__group-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(239, 208, 255, 0.86);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
}

.v4-message-input__group-number {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  color: #21132e;
  background: linear-gradient(180deg, #f7e4ff 0%, var(--v4-accent-strong) 100%);
  font-size: 0.76rem;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(217, 168, 255, 0.18);
}

.v4-message-input__voice-add-button {
  display: inline-flex;
  width: 100%;
  max-width: 140px;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(243, 221, 176, 0.22);
  border-radius: 999px;
  color: rgba(255, 247, 234, 0.94);
  background:
    linear-gradient(180deg, rgba(255, 248, 255, 0.12), rgba(255, 248, 255, 0.055));
  font-weight: 700;
  transition:
    border-color 140ms ease,
    background 140ms ease,
    transform 140ms ease;
}

.v4-message-input__voice-add-button:hover:not(:disabled) {
  border-color: rgba(243, 221, 176, 0.40);
  background:
    linear-gradient(180deg, rgba(255, 248, 255, 0.17), rgba(255, 248, 255, 0.085));
}

.v4-message-input__voice-add-button:active:not(:disabled) {
  transform: scale(0.99);
}

.v4-message-input__voice-add-icon {
  color: var(--v4-accent-strong);
  font-size: 1.08rem;
  line-height: 1;
}

.v4-message-input__voice-add-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v6-message-input__textarea {
  width: 100%;
  min-height: 48px;
  max-height: 132px;
  padding: 12px 13px;
  border: 1px solid var(--v4-border);
  border-radius: 16px;
  outline: none;
  overflow-y: auto;
  resize: none;
  color: var(--v4-text);
  background: rgba(255, 255, 255, 0.09);
  line-height: 1.55;
}

.v6-message-input__textarea::placeholder {
  color: var(--v4-text-subtle);
}

.v6-message-input__textarea:focus {
  border-color: rgba(240, 209, 255, 0.72);
  box-shadow: 0 0 0 3px rgba(217, 168, 255, 0.14);
}

.v4-message-input__send-helper {
  margin: -2px 0 0;
  color: var(--v4-text-subtle);
  font-size: 0.72rem;
  line-height: 1.35;
  text-align: center;
}

.v4-message-input__send-actions {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(94px, 1fr);
  gap: 8px;
  align-items: stretch;
}

.v4-message-input__send-actions .v4-message-input-bar__network-toggle,
.v4-message-input__send-actions .v4-message-input__send-button {
  width: 100%;
  min-height: 42px;
}

.v6-message-input__send-group.is-disabled {
  opacity: 0.56;
}

.v6-message-input__send-group.is-disabled .v4-message-input__send-helper {
  color: rgba(255, 247, 234, 0.52);
}

.v4-message-input__voice-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  color: rgba(239, 208, 255, 0.88);
  font-size: 0.76rem;
  line-height: 1.45;
  text-align: center;
}

.v4-message-input__voice-status.is-completed::before {
  content: "✓";
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  color: #21132e;
  background: var(--v4-accent-strong);
  font-size: 0.72rem;
  font-weight: 800;
}

.v4-message-input__voice-status.is-failed,
.v4-message-input__voice-status.is-permission_denied,
.v4-message-input__voice-status.is-unsupported {
  color: #ffd8df;
}

.v4-voice-backdrop {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(0, 0, 0, 0.42);
  pointer-events: auto;
}

.v4-voice-overlay {
  position: absolute;
  left: 9px;
  right: 9px;
  top: -20px;
  z-index: 901;
  display: grid;
  gap: 9px;
  border: 1px solid rgba(239, 208, 255, 0.36);
  border-radius: 18px;
  padding: 10px;
  color: var(--v4-text);
  background: #21172f;
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.v4-voice-overlay__header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.v4-voice-overlay__listening-mark {
  flex: 0 0 auto;
  color: var(--v4-accent-strong);
  font-size: 0.75rem;
  letter-spacing: -0.08em;
  opacity: 0.92;
}

.v4-voice-overlay__status {
  flex: 1 1 auto;
  min-width: 0;
  color: rgba(255, 247, 234, 0.88);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
}

.v4-voice-overlay__stop-button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(243, 221, 176, 0.28);
  border-radius: 999px;
  color: #fff7ea;
  background:
    linear-gradient(180deg, rgba(115, 79, 158, 0.96), rgba(74, 47, 112, 0.98));
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
  font-weight: 800;
}

.v4-voice-overlay__body {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 14px;
  padding: 9px;
  background: rgba(255, 255, 255, 0.065);
}

.v4-voice-overlay__label {
  margin: 0;
  color: rgba(239, 208, 255, 0.92);
  font-size: 0.74rem;
  font-weight: 800;
}

.v4-voice-overlay__preview {
  max-height: 112px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.v4-voice-overlay__preview-text,
.v4-voice-overlay__preview-empty {
  margin: 0;
  overflow-wrap: anywhere;
  color: rgba(255, 247, 234, 0.92);
  font-size: 0.88rem;
  line-height: 1.6;
}

.v4-voice-overlay__preview-text.is-interim {
  color: rgba(255, 247, 234, 0.58);
}

.v4-voice-overlay__preview-empty {
  color: var(--v4-text-subtle);
}

.v4-voice-overlay__note {
  margin: 2px 0 0;
  color: rgba(255, 247, 234, 0.58);
  font-size: 0.70rem;
  line-height: 1.45;
}

/* Hide legacy POC voice preview/actions if stale DOM or old CSS remains. */
.v4-message-input__voice-actions,
.v4-message-input__voice-preview {
  display: none;
}


/* v6 request POC1: consultation summary action */
.v6-current-consultation__request-action {
  padding: 0 16px 12px;
}

.v6-request-summary-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background: rgba(12, 10, 18, 0.72);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.v6-request-summary-action__body {
  min-width: 0;
}

.v6-request-summary-action__eyebrow {
  margin-bottom: 4px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.62);
}

.v6-request-summary-action__description {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.84);
}

.v6-request-summary-action__error {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: #ffd1d1;
}

.v6-request-summary-action__button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.v6-request-summary-action__button:disabled {
  cursor: default;
  opacity: 0.7;
}

.v6-request-summary-action--done {
  border-color: rgba(166, 255, 214, 0.28);
}

.v6-request-summary-action--failed {
  border-color: rgba(255, 160, 160, 0.34);
}

@media (max-width: 720px) {
  .v6-request-summary-action {
    align-items: stretch;
    flex-direction: column;
  }

  .v6-request-summary-action__button {
    width: 100%;
  }
}

/* v6 POC1: request reports and request detail */
.v6-lobby-reports {
  width: min(100%, 420px);
  margin: 0 auto 14px;
}

.v6-lobby-reports__more {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.82rem;
  text-align: center;
}

.v6-lobby-report-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 18px;
  background: rgba(18, 20, 38, 0.72);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(12px);
  color: #fff;
  text-align: left;
}

.v6-lobby-report-card__eyebrow {
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.v6-lobby-report-card__title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.35;
}

.v6-lobby-report-card__meta {
  display: grid;
  gap: 6px;
  margin: 0;
  font-size: 0.82rem;
}

.v6-lobby-report-card__meta-row {
  display: grid;
  grid-template-columns: 5.5em minmax(0, 1fr);
  gap: 8px;
}

.v6-lobby-report-card__meta dt {
  color: rgba(255, 255, 255, 0.64);
}

.v6-lobby-report-card__meta dd {
  min-width: 0;
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
  overflow-wrap: anywhere;
}

.v6-lobby-report-card__button {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #1b1b2f;
  font-weight: 700;
  cursor: pointer;
}

.v6-lobby-report-card__button:hover {
  background: #fff;
}

.v6-request-detail-screen {
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  background: linear-gradient(180deg, #16172b 0%, #24243d 50%, #10101f 100%);
  color: #fff;
}

.v6-request-detail {
  width: min(100%, 880px);
  height: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  overflow: hidden;
}

.v6-request-detail__header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
}

.v6-request-detail__main {
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: grid;
  gap: 16px;
  padding-right: 2px;
}

.v6-request-detail__eyebrow {
  margin: 0 0 6px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
}

.v6-request-detail__header h1 {
  margin: 0;
  font-size: clamp(1.35rem, 4vw, 2rem);
  line-height: 1.25;
}

.v6-request-detail__status {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.v6-request-detail__error {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 92, 92, 0.16);
  color: #ffdada;
}

.v6-request-detail-meta,
.v6-request-detail-section {
  margin: 0;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
}

.v6-request-detail-meta {
  display: grid;
  gap: 8px;
}

.v6-request-detail-meta__row {
  display: grid;
  grid-template-columns: 6em minmax(0, 1fr);
  gap: 10px;
}

.v6-request-detail-meta dt {
  color: rgba(255, 255, 255, 0.62);
}

.v6-request-detail-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.v6-request-detail-section h2 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.v6-request-detail-empty {
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
}

.v6-request-step-list {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.v6-request-step-list__item {
  display: grid;
  grid-template-columns: 2.4em minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
}

.v6-request-step-list__order {
  display: inline-grid;
  place-items: center;
  width: 2em;
  height: 2em;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  font-weight: 700;
}

.v6-request-step-list__title {
  min-width: 0;
  overflow-wrap: anywhere;
}

.v6-request-step-list__status {
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.8rem;
  white-space: nowrap;
}

.v6-request-artifact-preview__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.v6-request-artifact-preview__title {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.82rem;
}

.v6-request-artifact-preview__body {
  max-height: min(58dvh, 620px);
  overflow-y: auto;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  color: #202036;
}

.v6-request-detail__actions {
  display: grid;
  gap: 10px;
  padding-bottom: env(safe-area-inset-bottom);
}

.v6-request-detail__button,
.v6-request-detail__back {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.92);
  color: #191a2e;
  font-weight: 700;
  cursor: pointer;
}

.v6-request-detail__button--secondary,
.v6-request-detail__back {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

@media (max-width: 640px) {
  .v6-request-detail__header {
    display: grid;
  }

  .v6-request-detail-meta__row,
  .v6-lobby-report-card__meta-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .v6-request-step-list__item {
    grid-template-columns: 2.2em minmax(0, 1fr);
  }

  .v6-request-step-list__status {
    grid-column: 2;
  }

  .v6-request-artifact-preview__body {
    max-height: 56dvh;
  }
}

/* v6.1 request lifecycle / translated status UI */
.v6-screen-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  opacity: 0.72;
}

.v6-request-status-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 0.25rem 0.72rem;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.v6-lobby-request-status-card,
.v6-request-list-panel,
.v6-request-card,
.v6-request-detail {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(16, 16, 24, 0.72);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.v6-lobby-request-status-card {
  padding: 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.v6-lobby-request-status-card h2,
.v6-request-card__title,
.v6-request-list-header h1,
.v6-request-detail__header h1 {
  margin: 0;
}

.v6-lobby-request-status-card p,
.v6-request-card__description,
.v6-request-detail__description,
.v6-request-list-header p {
  margin: 0.35rem 0 0;
  line-height: 1.7;
}

.v6-lobby-request-status-card__meta {
  font-size: 0.78rem;
  opacity: 0.72;
}

.v6-lobby-request-status-card__actions,
.v6-request-card__actions,
.v6-request-list-actions,
.v6-request-detail__actions,
.v6-request-detail-secondary-actions,
.v6-request-next-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.8rem;
}

.v6-lobby-request-status-link {
  display: flex;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.v6-lobby-request-status-card__button,
.v6-lobby-request-status-link__button,
.v6-request-card__button,
.v6-request-list-actions__button,
.v6-request-list-empty__button,
.v6-request-detail__button,
.v6-request-detail__back {
  border: 0;
  border-radius: 999px;
  padding: 0.72rem 1rem;
  font-weight: 700;
  cursor: pointer;
}

.v6-lobby-request-status-card__button--secondary,
.v6-request-detail__button--secondary {
  opacity: 0.9;
}

.v6-request-list-screen,
.v6-request-detail-screen {
  min-height: 100%;
  overflow: hidden;
}

.v6-request-list-panel,
.v6-request-detail {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow: hidden;
}

.v6-request-list {
  display: grid;
  gap: 1rem;
}

.v6-request-card {
  padding: 1rem;
}

.v6-request-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.v6-request-card__type {
  font-size: 0.78rem;
  opacity: 0.72;
}

.v6-request-card__meta,
.v6-request-detail-meta {
  display: grid;
  gap: 0.45rem;
  margin: 0.8rem 0;
}

.v6-request-card__meta div,
.v6-request-detail-meta__row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.v6-request-card__meta dt,
.v6-request-detail-meta dt {
  opacity: 0.72;
}

.v6-request-card__meta dd,
.v6-request-detail-meta dd {
  margin: 0;
  text-align: right;
}

.v6-request-list-empty,
.v6-request-list-status,
.v6-request-list-error,
.v6-request-detail-empty,
.v6-request-detail__error {
  border-radius: 14px;
  padding: 0.85rem;
  background: rgba(255, 255, 255, 0.08);
}

.v6-request-detail__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.v6-request-detail-section,
.v6-request-next-actions {
  min-width: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 1rem;
}

.v6-request-step-list {
  display: grid;
  gap: 0.55rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.v6-request-step-list__item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.65rem;
  align-items: center;
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  background: rgba(255, 255, 255, 0.07);
}

.v6-request-step-list__symbol {
  font-weight: 800;
}

.v6-request-attention-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 0.22rem 0.62rem;
  font-size: 0.76rem;
  font-weight: 700;
  background: rgba(255, 223, 128, 0.18);
  border: 1px solid rgba(255, 223, 128, 0.36);
}

.v6-request-attention-badge--seen {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  opacity: 0.82;
}

.v6-request-deleted-consultation-note,
.v6-request-card-note {
  border-radius: 12px;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.9rem;
  line-height: 1.6;
  opacity: 0.9;
}

.v6-request-action-button-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.v6-request-summary-action--multi {
  align-items: stretch;
}

.v6-request-card__type {
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.8rem;
}

/* v6.3 request delete / clickable card minimal styles */
.v6-request-card {
  cursor: pointer;
}

.v6-request-card:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.72);
  outline-offset: 3px;
}

.v6-request-card button {
  cursor: pointer;
}

.v6-request-delete-button {
  border: 1px solid rgba(255, 120, 120, 0.45);
  background: rgba(255, 80, 80, 0.08);
}

.v6-request-delete-button:hover {
  background: rgba(255, 80, 80, 0.16);
}

.v6-request-attention-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.76rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.1);
}

.v6-request-attention-badge--seen {
  opacity: 0.78;
}

.v6-request-detail-danger-zone {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 120, 120, 0.24);
  background: rgba(255, 80, 80, 0.06);
}

.v6-request-detail-danger-zone h2 {
  margin-top: 0;
}

/* v6.3 Phase 2: request list operation menu */
.v6-request-card__badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  min-width: 0;
}

.v6-request-card-menu {
  margin-left: auto;
  flex: 0 0 auto;
  z-index: 3;
}

.v6-request-card-menu__button {
  min-width: 2.35rem;
  min-height: 2.35rem;
}

.v6-request-card-menu__items {
  min-width: 11rem;
}

.v6-request-card.is-menu-open {
  z-index: 4;
}

.v6-request-card .v4-action-menu__item {
  text-align: left;
}

/* v6.3 Phase 3: request UI refinement */
.v6-request-summary-action {
  padding: 0;
  gap: 0.75rem;
}

.v6-request-summary-action__eyebrow {
  font-size: 0.70rem;
}

.v6-request-summary-action__description {
  font-size: 0.78rem;
  line-height: 1.5;
}

.v6-request-action-button-list {
  gap: 0.45rem;
}

.v6-request-summary-action__button {
  min-height: 36px;
  padding: 0 0.78rem;
  font-size: 0.78rem;
}

.v6-request-summary-action__button--ready {
  border-color: rgba(255, 236, 180, 0.34);
  background: rgba(255, 220, 140, 0.12);
}

.v6-request-summary-action__button--done {
  border-color: rgba(166, 255, 214, 0.26);
  background: rgba(166, 255, 214, 0.10);
}

.v6-request-summary-action__button--running {
  border-color: rgba(160, 204, 255, 0.28);
  background: rgba(160, 204, 255, 0.10);
}

.v6-request-detail__header {
  align-items: center;
  padding: 0.95rem 1rem;
}

.v6-request-detail__header .v6-request-status-badge {
  flex: 0 0 auto;
}

.v6-request-detail__description {
  font-size: 0.92rem;
  opacity: 0.88;
}

.v6-request-detail-meta {
  padding: 0.85rem 0.95rem;
  font-size: 0.86rem;
}

.v6-request-next-actions {
  padding: 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
}

.v6-request-next-actions h2,
.v6-request-detail-danger-zone h2 {
  margin: 0 0 0.6rem;
  font-size: 0.92rem;
}

.v6-request-next-actions__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.v6-request-next-actions__buttons .v6-request-detail__button:first-child:not(.v6-request-detail__button--secondary) {
  background: rgba(255, 255, 255, 0.94);
  color: #191a2e;
}

.v6-request-detail-danger-zone {
  margin-top: 0;
  padding: 0.82rem 0.95rem;
  border-color: rgba(255, 160, 160, 0.18);
  background: rgba(255, 80, 80, 0.035);
}

.v6-request-detail-danger-zone p {
  margin: 0 0 0.65rem;
  font-size: 0.84rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.72);
}

.v6-request-detail__button--danger-subtle {
  min-height: 38px;
  border: 1px solid rgba(255, 130, 130, 0.28);
  background: rgba(255, 90, 90, 0.075);
  color: rgba(255, 235, 235, 0.92);
}

.v6-request-detail__button--danger-subtle:hover {
  background: rgba(255, 90, 90, 0.13);
}

.v6-request-step-list__item {
  padding: 0.55rem 0.68rem;
}

.v6-request-step-list__order,
.v6-request-step-list__symbol {
  opacity: 0.86;
}

.v6-request-step-list__status {
  font-size: 0.76rem;
}


/* v6.3 UX adjustment: request detail header/footer action placement */
.v6-request-detail-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  padding: 0.82rem 0.92rem;
  backdrop-filter: blur(14px);
}

.v6-request-detail-header__left,
.v6-request-detail-header__center,
.v6-request-detail-header__right {
  min-width: 0;
}

.v6-request-detail-header__center {
  text-align: center;
}

.v6-request-detail-header__right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
}

.v6-request-detail__nav-button {
  min-height: 2.35rem;
  max-width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 0 0.78rem;
  background: rgba(255, 255, 255, 0.10);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v6-request-detail-menu {
  position: relative;
  flex: 0 0 auto;
  z-index: 12;
}

.v6-request-detail-menu__button {
  min-width: 2.35rem;
  min-height: 2.35rem;
}

.v6-request-detail-footer {
  position: sticky;
  bottom: 0;
  z-index: 8;
  margin-top: 0.25rem;
  padding: 0.75rem 0 0;
  padding-bottom: env(safe-area-inset-bottom);
  background: linear-gradient(
    180deg,
    rgba(16, 16, 24, 0),
    rgba(16, 16, 24, 0.86) 32%,
    rgba(16, 16, 24, 0.96)
  );
}

.v6-request-detail-footer .v6-request-next-actions__buttons {
  margin-top: 0;
}

.v6-request-detail-footer .v6-request-detail__button {
  width: 100%;
}



/* v6.3-1 request lifecycle / translated status UI */
.v6-request-list-panel {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(16, 16, 24, 0.72);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.22);
}

.v6-request-list-header h1 {
  margin: 0;
}

.v6-request-list-header p {
  margin: 0.35rem 0 0;
  line-height: 1.7;
}

.v6-request-list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.8rem;
}

.v6-request-list-actions__button,
.v6-request-list-empty__button {
  border: 0;
  border-radius: 999px;
  padding: 0.72rem 1rem;
  font-weight: 700;
  cursor: pointer;
}

.v6-request-list-screen {
  height: 100dvh;
  min-height: 100dvh;
  padding-bottom: 1rem;
  overflow: hidden;
}

.v6-request-list-panel {
  width: min(100%, 880px);
  height: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.v6-request-list-main {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 1rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-right: 0.15rem;
}

/* .v6-request-list-header--three-column {
  display: grid;
  grid-template-columns: minmax(4.75rem, 1fr) minmax(0, 1.45fr) minmax(4.75rem, 1fr);
  gap: 0.75rem;
  align-items: center;
} */
 .v6-request-list-header--three-column {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
}

.v6-request-list-header__center {
  min-width: 0;
  text-align: center;
}

.v6-request-list-header__center .v6-screen-kicker,
.v6-request-list-header__center h1,
.v6-request-list-header__center p {
  margin-left: auto;
  margin-right: auto;
}

.v6-request-list-header__center p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.v6-request-list-header__side {
  display: flex;
  align-items: center;
  min-width: 0;
}

.v6-request-list-header__side--left {
  justify-content: flex-start;
}

.v6-request-list-header__side--right {
  justify-content: flex-end;
}

.v6-request-list-header__nav {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 0.56rem 0.82rem;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.v6-request-list-header__subpart {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}


.v6-request-filter-tabs {
  width: 100%;
  display: flex;
  gap: 0.5rem;
}

.v6-request-filter-tab {
  flex: 1;
  border-radius: 999px;
  padding: 0.45rem 0.82rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.v6-request-filter-tab.is-active {
  background: rgba(255, 255, 255, 0.18);
  font-weight: 700;
}

.v6-request-list {
  display: grid;
  gap: 1rem;
}

.v6-request-card {
  padding: 1rem;
}

.v6-request-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.v6-request-card__type {
  font-size: 0.78rem;
  opacity: 0.72;
}

.v6-request-card__meta {
  display: grid;
  gap: 0.45rem;
  margin: 0.8rem 0;
}

.v6-request-card__meta div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.v6-request-card__meta dt {
  opacity: 0.72;
}

.v6-request-card__meta dd {
  margin: 0;
  text-align: right;
}

.v6-request-list-empty,
.v6-request-list-status,
.v6-request-list-error {
  border-radius: 14px;
  padding: 0.85rem;
  background: rgba(255, 255, 255, 0.08);
}

/* v6.3 UX adjustment: collapsible request action panel in consultation footer */
.v6-current-consultation__request-action {
  padding: 0 16px 10px;
}

.v6-request-summary-action {
  display: block;
  padding: 0;
  overflow: hidden;
}

.v6-request-summary-action__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 42px;
  padding: 0.68rem 0.82rem;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.v6-request-summary-action__summary::-webkit-details-marker {
  display: none;
}

.v6-request-summary-action__summary::after {
  content: "開く";
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 0.22rem 0.58rem;
  color: rgba(255, 255, 255, 0.74);
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.72rem;
  font-weight: 700;
}

.v6-request-summary-action[open] .v6-request-summary-action__summary::after {
  content: "閉じる";
}

.v6-request-summary-action__summary-text {
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.94);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.v6-request-summary-action__summary-hint {
  min-width: 0;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v6-request-summary-action__panel {
  display: grid;
  padding: 0 0.82rem 0.82rem;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
}

.v6-request-summary-action__body {
  padding-top: 0.65rem;
}

.v6-request-action-button-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.v6-request-summary-action__button {
  width: 100%;
  min-width: 0;
  text-align: center;
  white-space: nowrap;
}


/* =========================
   v6 Voice Input Modal
   HTML構造に依存しない中央表示
========================= */

.v6-voice-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 18px;
  pointer-events: auto;
}

.v6-voice-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(0, 0, 0, 0.54);
  backdrop-filter: blur(6px);
}

.v6-voice-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  width: min(100%, 600px);
  max-height: min(72dvh, 520px);
  overflow: hidden;
  border: 1px solid rgba(239, 208, 255, 0.36);
  border-radius: 20px;
  padding: 12px;
  color: var(--v4-text);
  background: #21172f;
  box-shadow:
    0 24px 62px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.v6-voice-dialog__header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.v6-voice-dialog__listening-mark {
  flex: 0 0 auto;
  color: var(--v4-accent-strong);
  font-size: 0.75rem;
  letter-spacing: -0.08em;
  opacity: 0.92;
}

.v6-voice-dialog__status {
  flex: 1 1 auto;
  min-width: 0;
  color: rgba(255, 247, 234, 0.9);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.4;
}

.v6-voice-dialog__stop-button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(243, 221, 176, 0.28);
  border-radius: 999px;
  color: #fff7ea;
  background:
    linear-gradient(180deg, rgba(115, 79, 158, 0.96), rgba(74, 47, 112, 0.98));
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
  font-weight: 800;
}

.v6-voice-dialog__body {
  display: grid;
  gap: 7px;
  min-height: 0;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 14px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.065);
}

.v6-voice-dialog__label {
  margin: 0;
  color: rgba(239, 208, 255, 0.92);
  font-size: 0.76rem;
  font-weight: 800;
}

.v6-voice-dialog__preview {
  min-height: 72px;
  max-height: 220px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.v6-voice-dialog__preview-text,
.v6-voice-dialog__preview-empty {
  margin: 0;
  overflow-wrap: anywhere;
  color: rgba(255, 247, 234, 0.92);
  font-size: 0.9rem;
  line-height: 1.65;
}

.v6-voice-dialog__preview-text.is-interim {
  color: rgba(255, 247, 234, 0.58);
}

.v6-voice-dialog__preview-empty {
  color: var(--v4-text-subtle);
}

.v6-voice-dialog__note {
  margin: 0;
  color: rgba(255, 247, 234, 0.58);
  font-size: 0.72rem;
  line-height: 1.45;
}
/* v6.1 Artifact reuse */
.v6-source-artifacts-summary__list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.v6-source-artifacts-summary__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(92, 76, 58, 0.16);
  border-radius: 14px;
  background: rgba(255, 252, 247, 0.72);
}

.v6-source-artifacts-summary__item small {
  color: rgba(72, 57, 43, 0.66);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

/* v6.2 Artifact revision */
.v6-target-artifacts-summary__list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.v6-target-artifacts-summary__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(92, 76, 58, 0.16);
  border-radius: 14px;
  background: rgba(255, 252, 247, 0.72);
}

.v6-target-artifacts-summary__item small {
  color: rgba(72, 57, 43, 0.66);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.v6-updated-version-preview__body {
  margin-top: 12px;
}

.v6-revision-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(25, 17, 34, 0.48);
  backdrop-filter: blur(6px);
}

.v6-revision-dialog {
  display: grid;
  gap: 14px;
  width: min(100%, 560px);
  max-height: min(82dvh, 680px);
  overflow-y: auto;
  border: 1px solid rgba(92, 76, 58, 0.20);
  border-radius: 22px;
  padding: 18px;
  color: var(--v4-text);
  background: #1c1728;
  box-shadow: 0 28px 80px rgba(30, 20, 42, 0.34);
}

.v6-revision-dialog__header {
  display: grid;
  gap: 6px;
}

.v6-revision-dialog__header h2,
.v6-revision-dialog__header p {
  margin: 0;
}

.v6-revision-dialog__header p,
.v6-revision-dialog__target {
  color: var(--v4-text-subtle);
  font-size: 0.88rem;
  line-height: 1.65;
}

.v6-revision-dialog__target {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(92, 76, 58, 0.08);
}

.v6-revision-dialog__textarea {
  min-height: 140px;
  resize: vertical;
  width: 100%;
  border: 1px solid rgba(92, 76, 58, 0.22);
  border-radius: 16px;
  padding: 12px;
  color: var(--v4-text);
  background: rgba(55, 55, 55, 0.9);
  font: inherit;
  line-height: 1.65;
}

.v6-revision-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

/* v6.3 revision review */
.v6-revision-review,
.v6-version-history {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.v6-revision-review__pane {
  min-width: 0;
  max-width: 100%;
  margin-top: 1rem;
}

.v6-revision-review__pane h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.v6-revision-review__body {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

.v6-revision-review__body pre,
.v6-revision-review__body table {
  max-width: 100%;
  overflow-x: auto;
}

.v6-revision-review__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.v6-version-history__list {
  display: grid;
  gap: 0.5rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.v6-version-history__item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.v6-version-history__badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-size: 0.8rem;
  line-height: 1.4;
}

/* v6.4 Artifact Markdown download */
.v6-request-artifact-preview__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 8px 0 10px;
  flex-wrap: wrap;
}

.v6-artifact-download-button {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.92);
  font: inherit;
  font-size: 0.84rem;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.v6-artifact-download-button:hover,
.v6-artifact-download-button:focus-visible {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.42);
  outline: none;
}

.v6-artifact-download-button:active {
  transform: translateY(1px);
}

/* v7.0 Artifact list/detail screens */
.v7-screen {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  color: #f8f1ff;
  background: radial-gradient(circle at top, rgba(107, 74, 145, 0.22), transparent 34%), #120f1a;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.v7-artifact-detail-screen {
  grid-template-rows: auto 1fr auto;
}

.v7-screen-header {
  min-height: 56px;
  display: grid;
  grid-template-columns: minmax(88px, 1fr) minmax(0, 2fr) minmax(88px, 1fr);
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(18, 15, 26, 0.9);
  backdrop-filter: blur(10px);
}

.v7-screen-header__button {
  justify-self: start;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 8px 12px;
  color: #f8f1ff;
  background: rgba(255, 255, 255, 0.08);
  font: inherit;
  cursor: pointer;
}

.v7-screen-header__title {
  margin: 0;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v7-screen-main {
  overflow: auto;
  padding: 16px;
}

.v7-artifact-list-main {
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
}

.v7-artifact-list {
  display: grid;
  gap: 12px;
}

.v7-artifact-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.075);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
  cursor: pointer;
}

.v7-artifact-card:hover,
.v7-artifact-card:focus-visible {
  border-color: rgba(215, 185, 255, 0.42);
  outline: none;
  background: rgba(255, 255, 255, 0.105);
}

.v7-artifact-card__title {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.45;
}

.v7-artifact-card__badges,
.v7-artifact-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.v7-artifact-card__type,
.v7-artifact-card__status,
.v7-artifact-card__pending {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.11);
}

.v7-artifact-card__pending,
.v7-artifact-card__status--warning {
  background: rgba(255, 209, 102, 0.2);
}

.v7-artifact-card__meta {
  color: rgba(248, 241, 255, 0.68);
  font-size: 0.82rem;
}

.v7-artifact-state {
  margin: 48px auto;
  max-width: 560px;
  padding: 22px;
  border-radius: 18px;
  text-align: center;
  color: rgba(248, 241, 255, 0.78);
  background: rgba(255, 255, 255, 0.07);
}

.v7-artifact-state--error {
  color: #ffe4e9;
  background: rgba(180, 40, 72, 0.22);
}

.v7-artifact-detail-main {
  padding: 14px;
}

.v7-artifact-detail {
  max-width: 880px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.v7-artifact-meta,
.v7-related-requests {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  padding: 12px;
  color: rgba(248, 241, 255, 0.72);
  background: rgba(255, 255, 255, 0.055);
}

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

.v7-artifact-meta dt {
  font-size: 0.72rem;
  color: rgba(248, 241, 255, 0.55);
}

.v7-artifact-meta dd {
  margin: 2px 0 0;
  font-size: 0.88rem;
}

.v7-artifact-meta__pending {
  margin: 10px 0 0;
  color: #ffe3a3;
  font-size: 0.88rem;
}

.v7-artifact-content {
  min-height: 48vh;
  min-width: 0;
  padding: 18px;
  border-radius: 18px;
  color: #1f1a28;
  background: rgba(255, 252, 247, 0.96);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
}

.v7-artifact-markdown {
  color: #1f1a28;
}

.v7-artifact-markdown a {
  color: #6b3fc7;
}

.v7-related-requests h2 {
  margin: 0 0 6px;
  font-size: 0.95rem;
}

.v7-related-requests__hint {
  margin: 0 0 10px;
  color: rgba(248, 241, 255, 0.56);
  font-size: 0.82rem;
}

.v7-related-requests__list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.v7-related-request-card {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #f8f1ff;
  background: rgba(255, 255, 255, 0.07);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.v7-related-request-card:hover,
.v7-related-request-card:focus-visible {
  border-color: rgba(255, 227, 163, 0.42);
  background: rgba(255, 255, 255, 0.105);
  transform: translateY(-1px);
  outline: none;
}

.v7-related-request-card--attention {
  border-color: rgba(255, 227, 163, 0.48);
  background: rgba(255, 227, 163, 0.09);
}

.v7-related-request-card__body {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.v7-related-request-card__title {
  overflow: hidden;
  color: #f8f1ff;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v7-related-request-card__labels {
  overflow: hidden;
  color: rgba(248, 241, 255, 0.74);
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v7-related-request-card__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  color: rgba(248, 241, 255, 0.58);
  font-size: 0.76rem;
}

.v7-related-request-card__arrow {
  color: rgba(255, 227, 163, 0.78);
  font-size: 1rem;
}

.v7-screen-footer {
  padding: 10px 14px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(18, 15, 26, 0.92);
}

.v7-primary-action-button {
  width: min(100%, 520px);
  min-height: 44px;
  display: block;
  margin: 0 auto;
  border: 0;
  border-radius: 999px;
  color: #1f1830;
  background: #f2d7ff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 640px) {
  .v7-screen-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 50px;
    padding: 8px 10px;
  }

  .v7-screen-header__button {
    padding: 7px 10px;
    font-size: 0.84rem;
  }

  .v7-screen-header__title {
    font-size: 0.92rem;
  }

  .v7-screen-main {
    padding: 10px;
  }

  .v7-artifact-card {
    padding: 13px;
  }

  .v7-artifact-meta__grid {
    grid-template-columns: 1fr;
  }

  .v7-artifact-content {
    min-height: 52vh;
    padding: 14px;
    border-radius: 15px;
  }

  .v7-related-request-card {
    align-items: flex-start;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .v7-related-request-card__title,
  .v7-related-request-card__labels {
    white-space: normal;
  }
}

/* v7.0.1 Artifact logical delete UI */
.v7-artifact-card {
  position: relative;
}

.v7-artifact-card__actions {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
}

.v7-artifact-card__actions .v4-action-menu-container,
.v7-artifact-detail-menu.v4-action-menu-container {
  position: relative;
}

.v7-artifact-card__actions .v4-action-menu,
.v7-artifact-detail-menu .v4-action-menu {
  min-width: 11rem;
}

.v7-artifact-detail--deleted .v7-artifact-state--deleted {
  text-align: left;
}

.v7-artifact-state__meta {
  font-size: 0.85rem;
  opacity: 0.75;
}

/* v7.1 Artifact detail action area / history summary */
.v7-artifact-history-summary,
.v7-artifact-action-area {
  margin: 12px 0;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
}

.v7-artifact-history-summary h2,
.v7-artifact-action-area h2 {
  margin: 0 0 8px;
  color: rgba(248, 241, 255, 0.92);
  font-size: 0.95rem;
}

.v7-artifact-history-summary__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px 12px;
  margin: 0;
}

.v7-artifact-history-summary__grid div {
  min-width: 0;
}

.v7-artifact-history-summary dt {
  color: rgba(248, 241, 255, 0.58);
  font-size: 0.72rem;
}

.v7-artifact-history-summary dd {
  margin: 3px 0 0;
  color: rgba(248, 241, 255, 0.88);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.v7-artifact-history-summary__pending {
  margin: 10px 0 0;
  color: rgba(255, 227, 163, 0.92);
  font-size: 0.84rem;
  line-height: 1.55;
}

.v7-artifact-action-area {
  background: rgba(242, 215, 255, 0.055);
}

.v7-artifact-action-area__header p {
  margin: 0 0 12px;
  color: rgba(248, 241, 255, 0.62);
  font-size: 0.84rem;
  line-height: 1.55;
}

.v7-artifact-action-area__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.v7-artifact-action-area__button {
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid rgba(242, 215, 255, 0.24);
  border-radius: 999px;
  color: rgba(248, 241, 255, 0.94);
  background: rgba(255, 255, 255, 0.07);
  font: inherit;
  font-size: 0.86rem;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.v7-artifact-action-area__button:hover,
.v7-artifact-action-area__button:focus-visible {
  border-color: rgba(242, 215, 255, 0.58);
  background: rgba(242, 215, 255, 0.13);
  transform: translateY(-1px);
  outline: none;
}

@media (max-width: 640px) {
  .v7-artifact-history-summary,
  .v7-artifact-action-area {
    margin: 10px 0;
    padding: 12px;
    border-radius: 14px;
  }

  .v7-artifact-history-summary__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .v7-artifact-action-area__actions {
    flex-direction: column;
  }

  .v7-artifact-action-area__button {
    width: 100%;
    min-height: 36px;
    padding: 8px 11px;
    text-align: left;
  }
}

/* v7.2 Artifact import dialog */
.v7-screen-header__button--right {
  justify-self: end;
}

.v7-artifact-upload-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(5, 4, 10, 0.66);
  backdrop-filter: blur(8px);
}

.v7-artifact-upload-dialog {
  width: min(100%, 520px);
  max-height: min(86vh, 680px);
  overflow-y: auto;
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  color: #f8f1ff;
  background: rgba(24, 19, 34, 0.98);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
}

.v7-artifact-upload-dialog__header h2 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.v7-artifact-upload-dialog__header p,
.v7-artifact-upload-field__hint {
  margin: 0;
  color: rgba(248, 241, 255, 0.65);
  font-size: 0.84rem;
  line-height: 1.55;
}

.v7-artifact-upload-field {
  display: grid;
  gap: 7px;
}

.v7-artifact-upload-field label,
.v7-artifact-upload-field__label {
  color: rgba(248, 241, 255, 0.86);
  font-size: 0.86rem;
  font-weight: 650;
}


.v7-artifact-upload-file-control {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
}

.v7-artifact-upload-native-file {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.v7-artifact-upload-file-button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: #1f1830;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.v7-artifact-upload-file-button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.62;
}

.v7-artifact-upload-file-status {
  min-width: 0;
  overflow: hidden;
  color: rgba(248, 241, 255, 0.9);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v7-artifact-upload-file-status--empty {
  color: rgba(248, 241, 255, 0.58);
  font-weight: 500;
}

.v7-artifact-upload-field input[type="text"],
.v7-artifact-upload-field input[type="file"] {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  padding: 10px 11px;
  color: #f8f1ff;
  background: rgba(255, 255, 255, 0.08);
  font: inherit;
}

.v7-artifact-upload-field input[type="file"] {
  padding: 9px;
}

.v7-artifact-upload-field .v7-artifact-upload-native-file {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.v7-artifact-upload-error {
  padding: 10px 12px;
  border-radius: 12px;
  color: #ffe4e9;
  background: rgba(180, 40, 72, 0.24);
  font-size: 0.86rem;
  line-height: 1.55;
}

.v7-artifact-upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.v7-artifact-upload-submit,
.v7-artifact-upload-cancel {
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 8px 15px;
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}

.v7-artifact-upload-submit {
  color: #1f1830;
  background: #f2d7ff;
  font-weight: 700;
}

.v7-artifact-upload-cancel {
  color: #f8f1ff;
  background: rgba(255, 255, 255, 0.07);
}

.v7-artifact-upload-submit:disabled,
.v7-artifact-upload-cancel:disabled,
.v7-artifact-upload-field input:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

@media (max-width: 640px) {
  .v7-artifact-upload-dialog-backdrop {
    align-items: start;
    padding: 12px;
  }

  .v7-artifact-upload-dialog {
    max-height: calc(100vh - 24px);
    padding: 14px;
    border-radius: 16px;
  }

  .v7-artifact-upload-file-control {
    align-items: stretch;
    flex-direction: column;
  }

  .v7-artifact-upload-file-button {
    width: 100%;
  }

  .v7-artifact-upload-file-status {
    white-space: normal;
  }

  .v7-artifact-upload-actions {
    flex-direction: column;
  }

  .v7-artifact-upload-submit,
  .v7-artifact-upload-cancel {
    width: 100%;
    text-align: center;
  }
}

/* ---- v8 Workspace minimal UI ---- */
.v8-workspace-screen {
  background: linear-gradient(180deg, rgba(28, 20, 42, 0.96), rgba(15, 12, 24, 0.98));
  color: #f7f1ff;
}

.v8-workspace-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  overflow-y: auto;
}

.v8-workspace-hero,
.v8-panel,
.v8-workspace-create,
.v8-empty,
.v8-error {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
}

.v8-workspace-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.7fr);
  gap: 14px;
  padding: 18px;
}

.v8-workspace-hero--compact {
  display: block;
}

.v8-kicker {
  margin: 0 0 4px;
  color: #d7b7ff;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
}

.v8-workspace-hero h1,
.v8-workspace-create h2,
.v8-panel h2,
.v8-empty h2 {
  margin: 0 0 8px;
}

.v8-lilith-guide {
  border-radius: 16px;
  padding: 14px;
  background: rgba(214, 178, 255, 0.12);
}

.v8-workspace-create,
.v8-panel,
.v8-empty,
.v8-error {
  padding: 14px;
}

.v8-workspace-create {
  display: grid;
  gap: 10px;
}

.v8-workspace-create label,
.v8-task-form,
.v8-link-form {
  display: grid;
  gap: 6px;
}

.v8-workspace-create input,
.v8-workspace-create textarea,
.v8-task-form input,
.v8-link-form input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 10px 12px;
  color: #f7f1ff;
  background: rgba(0, 0, 0, 0.22);
}

.v8-primary,
.v8-task-form button,
.v8-link-form button,
.v8-task-item button,
.v8-link-remove {
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  color: #241832;
  background: #e6ccff;
  cursor: pointer;
}

.v8-workspace-list {
  display: grid;
  gap: 12px;
}

.v8-workspace-card__button,
.v8-mini-item > button:first-child {
  width: 100%;
  text-align: left;
  color: inherit;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.v8-workspace-card {
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255,255,255,0.06);
}

.v8-workspace-card__header,
.v8-mini-item,
.v8-task-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.v8-workspace-card__header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.v8-workspace-status {
  display: inline-flex;
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(255,255,255,0.12);
  color: #eedfff;
  font-size: 0.78rem;
}

.v8-workspace-card__meta,
.v8-muted,
.v8-mini-item span {
  color: rgba(247,241,255,0.7);
  font-size: 0.86rem;
}

.v8-workspace-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.v8-task-list,
.v8-mini-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 12px 0 0;
  list-style: none;
}

.v8-task-form {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
}

.v8-link-form {
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 10px;
}

.v8-error {
  color: #ffd6d6;
  border-color: rgba(255, 120, 120, 0.35);
  background: rgba(120, 20, 20, 0.25);
}

@media (max-width: 640px) {
  .v8-workspace-main {
    padding: 12px;
  }

  .v8-workspace-hero,
  .v8-grid,
  .v8-task-form,
  .v8-link-form {
    grid-template-columns: 1fr;
  }

  .v8-workspace-card__header,
  .v8-mini-item,
  .v8-task-item {
    align-items: stretch;
    flex-direction: column;
  }
}
