/* Gemini-only IF Mode & Interactive Status Card (Quiet-Luxury Minimalist) */

/* ── Topbar IF pill (strictly shown only for resident === "gemini") ── */
.ys-if-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 10px;
  margin-right: 4px;
  border-radius: 999px;
  border: 1px solid rgba(120, 113, 102, 0.22);
  background: rgba(255, 255, 255, 0.52);
  color: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.ys-if-pill[hidden] {
  display: none !important;
}
.ys-if-pill:hover {
  border-color: rgba(182, 141, 76, 0.55);
  background: rgba(255, 255, 255, 0.82);
}
.ys-if-pill.is-active {
  border-color: rgba(182, 141, 76, 0.65);
  background: rgba(182, 141, 76, 0.13);
  color: #8c6628;
}
.ys-if-pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(140, 134, 124, 0.45);
  flex-shrink: 0;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.ys-if-pill.is-active .ys-if-pill-dot {
  background: #c59b52;
  box-shadow: 0 0 6px rgba(197, 155, 82, 0.65);
}

/* ── Floating Popover Panel ── */
.ys-if-popover {
  position: fixed;
  top: 56px;
  right: 14px;
  width: min(300px, calc(100vw - 28px));
  z-index: 950;
  border-radius: 14px;
  border: 1px solid rgba(120, 113, 102, 0.18);
  background: rgba(252, 251, 248, 0.94);
  color: #24211c;
  box-shadow: 0 14px 36px rgba(20, 18, 14, 0.12);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  overflow: hidden;
  font-size: 13px;
}
.ys-if-popover[hidden] {
  display: none !important;
}
.ys-if-pop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 10px;
  border-bottom: 1px solid rgba(120, 113, 102, 0.12);
}
.ys-if-pop-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7c7468;
}
.ys-if-pop-badge {
  font-size: 11px;
  color: #9b7333;
  letter-spacing: 0.03em;
}
.ys-if-pop-section {
  padding: 10px 12px;
}
.ys-if-pop-section + .ys-if-pop-section {
  border-top: 1px solid rgba(120, 113, 102, 0.12);
}
.ys-if-card-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ys-if-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.ys-if-option:hover {
  background: rgba(120, 113, 102, 0.06);
}
.ys-if-option.is-selected {
  border-color: rgba(182, 141, 76, 0.48);
  background: rgba(182, 141, 76, 0.09);
}
.ys-if-option-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.ys-if-option-name {
  font-size: 13px;
  font-weight: 500;
  color: inherit;
}
.ys-if-option-sub {
  font-size: 11px;
  color: #847c70;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ys-if-option-tag {
  font-size: 11px;
  color: #9b7333;
  flex-shrink: 0;
}
.ys-if-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ys-if-btn {
  flex: 1;
  height: 32px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid rgba(120, 113, 102, 0.22);
  background: transparent;
  color: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}
.ys-if-btn:hover {
  border-color: rgba(182, 141, 76, 0.55);
  background: rgba(182, 141, 76, 0.07);
}
.ys-if-btn.is-confirm {
  border-color: rgba(182, 141, 76, 0.8);
  background: rgba(182, 141, 76, 0.16);
  color: #8c6628;
  font-weight: 500;
}
.ys-if-btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.ys-if-pop-note {
  margin-top: 7px;
  font-size: 11px;
  line-height: 1.45;
  color: #847c70;
}

/* ── Regex-Rendered Status Card inside Messages ── */
.ys-if-card {
  margin-top: 12px;
  border-radius: 12px;
  border: 1px solid rgba(182, 141, 76, 0.32);
  background: rgba(250, 248, 243, 0.72);
  color: #2c2822;
  overflow: hidden;
  font-size: 12.5px;
  line-height: 1.55;
}
.ys-if-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid rgba(182, 141, 76, 0.16);
  cursor: pointer;
  user-select: none;
}
.ys-if-card-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #8e692c;
}
.ys-if-card-title::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #c59b52;
}
.ys-if-card-meta {
  font-size: 11px;
  color: #847b6e;
  margin-left: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 58%;
}
.ys-if-card-chevron {
  font-size: 11px;
  color: #9b8e7b;
  transition: transform 0.2s ease;
}
.ys-if-card.is-collapsed .ys-if-card-chevron {
  transform: rotate(-90deg);
}
.ys-if-card.is-collapsed .ys-if-card-body {
  display: none;
}
.ys-if-tabs {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 12px;
  border-bottom: 1px solid rgba(120, 113, 102, 0.12);
}
.ys-if-tab {
  position: relative;
  padding: 7px 2px;
  border: 0;
  background: transparent;
  color: #857d71;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.18s ease;
}
.ys-if-tab:hover {
  color: #3a342c;
}
.ys-if-tab.is-active {
  color: #8e692c;
}
.ys-if-tab.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1.5px;
  background: #c59b52;
}
.ys-if-panel {
  display: none;
  padding: 10px 12px 11px;
}
.ys-if-panel.is-active {
  display: block;
}
.ys-if-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}
.ys-if-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.ys-if-key {
  flex: 0 0 46px;
  font-size: 11px;
  color: #8e8475;
  letter-spacing: 0.04em;
}
.ys-if-val {
  flex: 1;
  min-width: 0;
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}
.ys-if-os {
  margin-top: 8px;
  padding: 8px 10px;
  border-left: 2px solid rgba(197, 155, 82, 0.65);
  background: rgba(197, 155, 82, 0.06);
  border-radius: 0 8px 8px 0;
  font-size: 12px;
  color: #4b4338;
}
.ys-if-group + .ys-if-group {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px dashed rgba(120, 113, 102, 0.18);
}
.ys-if-group-name {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #8e692c;
  margin-bottom: 5px;
}
.ys-if-chat-line {
  font-size: 12px;
  padding: 2px 0;
}
.ys-if-chat-line strong {
  font-weight: 600;
  color: #3f382e;
  margin-right: 4px;
}
.ys-if-loot-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.ys-if-loot-list li {
  position: relative;
  padding-left: 12px;
  font-size: 12px;
}
.ys-if-loot-list li::before {
  content: "·";
  position: absolute;
  left: 2px;
  color: #c59b52;
  font-weight: 700;
}

/* ── Dark Mode Harmony ── */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .ys-if-pill {
    border-color: rgba(212, 198, 175, 0.2);
    background: rgba(24, 24, 27, 0.62);
  }
  html:not([data-theme="light"]) .ys-if-pill.is-active {
    border-color: rgba(208, 173, 108, 0.65);
    background: rgba(208, 173, 108, 0.16);
    color: #e2c285;
  }
  html:not([data-theme="light"]) .ys-if-popover {
    border-color: rgba(212, 198, 175, 0.16);
    background: rgba(22, 22, 25, 0.94);
    color: #edeae3;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.45);
  }
  html:not([data-theme="light"]) .ys-if-card {
    border-color: rgba(208, 173, 108, 0.28);
    background: rgba(22, 21, 19, 0.78);
    color: #e6e1d7;
  }
  html:not([data-theme="light"]) .ys-if-card-title,
  html:not([data-theme="light"]) .ys-if-tab.is-active,
  html:not([data-theme="light"]) .ys-if-group-name,
  html:not([data-theme="light"]) .ys-if-pop-badge,
  html:not([data-theme="light"]) .ys-if-option-tag {
    color: #dec084;
  }
  html:not([data-theme="light"]) .ys-if-os {
    color: #d6cfc2;
    background: rgba(208, 173, 108, 0.08);
  }
  html:not([data-theme="light"]) .ys-if-chat-line strong {
    color: #f0ebe0;
  }
}

html[data-theme="dark"] .ys-if-pill {
  border-color: rgba(212, 198, 175, 0.2);
  background: rgba(24, 24, 27, 0.62);
}
html[data-theme="dark"] .ys-if-pill.is-active {
  border-color: rgba(208, 173, 108, 0.65);
  background: rgba(208, 173, 108, 0.16);
  color: #e2c285;
}
html[data-theme="dark"] .ys-if-popover {
  border-color: rgba(212, 198, 175, 0.16);
  background: rgba(22, 22, 25, 0.94);
  color: #edeae3;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.45);
}
html[data-theme="dark"] .ys-if-card {
  border-color: rgba(208, 173, 108, 0.28);
  background: rgba(22, 21, 19, 0.78);
  color: #e6e1d7;
}
html[data-theme="dark"] .ys-if-card-title,
html[data-theme="dark"] .ys-if-tab.is-active,
html[data-theme="dark"] .ys-if-group-name,
html[data-theme="dark"] .ys-if-pop-badge,
html[data-theme="dark"] .ys-if-option-tag {
  color: #dec084;
}
html[data-theme="dark"] .ys-if-os {
  color: #d6cfc2;
  background: rgba(208, 173, 108, 0.08);
}
html[data-theme="dark"] .ys-if-chat-line strong {
  color: #f0ebe0;
}
