/*
 * 0si.ai visual layer: icons, pressed feedback, loading/live states, logo fallback,
 * empty states, toast, boot screen and reduced motion. Loaded right after styles.css.
 * Keep selectors at or above the specificity of the styles.css rules they refine.
 */

:root {
  --icon-sm: 16px;
  --icon-md: 20px;
  --icon-lg: 24px;
  --icon-xl: 40px;
  --press-scale: 0.97;
  --press-opacity: 0.85;
  --press-duration: 100ms;
  --focus-ring: rgba(77, 148, 255, 0.85);
  --live-color: #4d94ff;
  --skeleton-base: rgba(255, 255, 255, 0.06);
  --skeleton-sheen: rgba(255, 255, 255, 0.07);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------------------
 * 1. Icons: one stroke weight, sizes on the 16/20/24/40 scale where layout allows.
 * ------------------------------------------------------------------------- */

.icon {
  stroke-width: 2;
}

.social-action .icon,
.desktop-subscription-crest .icon,
.subscription-crest .icon,
.desktop-subscription-panel li .icon,
.subscription-benefit-card li .icon {
  stroke-width: 2;
}

.icon-button .icon,
.bottom-nav .icon,
.subpage-back .icon,
.terms-link-card > .icon,
.promotion-entitlement-icon .icon,
.mobile-subscription-close .icon {
  width: var(--icon-lg);
  height: var(--icon-lg);
}

.search-field .icon,
.ai-head .icon,
.social-pill .icon,
.settings-subpage-icon .icon,
.subscription-benefit-card li .icon,
.desktop-subscription-panel li .icon {
  width: var(--icon-md);
  height: var(--icon-md);
}

.social-action .icon,
.terms-index-note .icon,
.my-menu-row > .icon,
.my-menu-row-trail .icon,
.my-profile-summary > .icon,
.setting-row.settings-nav-row > .icon {
  width: var(--icon-sm);
  height: var(--icon-sm);
}

.subscription-crest .icon,
.desktop-subscription-crest .icon {
  width: var(--icon-xl);
  height: var(--icon-xl);
}

@media (max-width: 979px) {
  .bottom-nav .icon,
  .icon-button .icon {
    width: var(--icon-md);
    height: var(--icon-md);
  }

  .social-action .icon {
    width: var(--icon-sm);
    height: var(--icon-sm);
  }
}

/* Favourites use a star everywhere; filled when saved. Likes keep the heart. */
.favorite-toggle.active,
.detail-favorite.active {
  background: rgba(247, 184, 75, 0.14);
  color: var(--yellow);
}

.favorite-toggle.active .icon,
.detail-favorite.active .icon,
.bottom-nav button.active[data-view="favorites"] .icon,
.desktop-nav button.active[data-view="favorites"] .icon {
  fill: currentColor;
}

/* ---------------------------------------------------------------------------
 * 2. Pressed feedback (tap highlight is disabled globally) and focus rings.
 * ------------------------------------------------------------------------- */

.primary-action,
.secondary-action,
.chip,
.tab-chip,
.signal-filter-chip,
.feed-market-option,
.icon-button,
.bottom-nav button,
.social-action,
.social-pill,
.my-menu-row,
.setting-row.interactive,
.subscription-plan-tabs button,
.desktop-subscription-tabs button,
.subscription-period-card,
.desktop-subscription-price-card {
  transition:
    transform var(--press-duration) ease,
    opacity var(--press-duration) ease;
}

.primary-action:active:not(:disabled),
.secondary-action:active:not(:disabled),
.chip:active:not(:disabled),
.tab-chip:active:not(:disabled),
.signal-filter-chip:active:not(:disabled),
.feed-market-option:active:not(:disabled),
.icon-button:active:not(:disabled),
.bottom-nav button:active,
.social-action:not(.passive):active,
.social-pill:active,
.subscription-plan-tabs button:active,
.desktop-subscription-tabs button:active {
  transform: scale(var(--press-scale));
  opacity: var(--press-opacity);
}

/* Full-width rows and plan cards shrink less so the edge does not visibly jump. */
.my-menu-row:active:not(:disabled),
.setting-row.interactive:active,
.subscription-period-card:active:not(:disabled),
.desktop-subscription-price-card:active:not(:disabled) {
  transform: scale(0.985);
  opacity: var(--press-opacity);
}

.primary-action:focus-visible,
.secondary-action:focus-visible,
.chip:focus-visible,
.tab-chip:focus-visible,
.signal-filter-chip:focus-visible,
.feed-market-option:focus-visible,
.icon-button:focus-visible,
.bottom-nav button:focus-visible,
.social-action:focus-visible,
.social-pill:focus-visible,
.my-menu-row:focus-visible,
.subscription-plan-tabs button:focus-visible,
.desktop-subscription-tabs button:focus-visible,
.subscription-period-card:focus-visible,
.desktop-subscription-price-card:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.setting-row.interactive:focus-within:has(input:focus-visible) {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------------------
 * 3. Feed loading skeleton (same geometry as .disclosure-row).
 * ------------------------------------------------------------------------- */

.disclosure-list > .feed-skeleton,
.feed-skeleton {
  display: block;
  padding: 0;
  text-align: left;
}

.feed-skeleton-row {
  display: grid;
  gap: 10px;
  min-height: 104px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.feed-skeleton-head {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.feed-skeleton-title {
  display: grid;
  gap: 8px;
}

.skeleton-block {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--skeleton-base);
}

.skeleton-block::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, var(--skeleton-sheen), transparent);
  transform: translateX(-100%);
  animation: osiSkeletonSheen 1.4s ease-in-out infinite;
}

.skeleton-logo {
  width: 46px;
  height: 46px;
  border-radius: 50%;
}

.skeleton-line {
  height: 12px;
  border-radius: 6px;
}

.skeleton-line.is-short { width: 38%; height: 14px; }
.skeleton-line.is-long { width: 78%; }
.skeleton-line.is-full { width: 94%; }
.skeleton-line.is-mid { width: 62%; }

.feed-skeleton-row:nth-child(3n) .skeleton-line.is-long { width: 66%; }
.feed-skeleton-row:nth-child(3n + 1) .skeleton-line.is-mid { width: 48%; }

@keyframes osiSkeletonSheen {
  to { transform: translateX(100%); }
}

@media (max-width: 979px) {
  .feed-skeleton-row {
    min-height: 76px;
    padding: 12px 0 14px;
  }

  .feed-skeleton-head {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .skeleton-logo {
    width: 38px;
    height: 38px;
  }
}

@media (min-width: 980px) {
  .desktop-app .feed-skeleton-row {
    min-height: 0;
    padding: 12px 20px;
  }

  .desktop-app .feed-skeleton-head {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 9px;
  }

  .desktop-app .skeleton-logo {
    width: 32px;
    height: 32px;
  }
}

/* ---------------------------------------------------------------------------
 * 4. Live feed: realtime row highlight, LIVE indicator, analysing pulse, like pop.
 * ------------------------------------------------------------------------- */

.disclosure-row[data-live-inserted] {
  position: relative;
}

.disclosure-row[data-live-inserted]::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: rgba(77, 148, 255, 0.13);
  pointer-events: none;
  opacity: 0;
  animation: osiLiveRowHighlight 1.2s ease-out both;
}

@media (max-width: 979px) {
  .native-app .disclosure-row[data-live-inserted]::after {
    left: -10px;
    right: -10px;
    border-radius: 12px;
  }
}

@keyframes osiLiveRowHighlight {
  0% { opacity: 0; }
  14% { opacity: 1; }
  100% { opacity: 0; }
}

.feed-live-indicator {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 7px 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: #80868f;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
  line-height: 1;
  white-space: nowrap;
  transition: color 0.3s ease, background-color 0.3s ease;
}

.feed-live-indicator.is-live {
  background: rgba(77, 148, 255, 0.12);
  color: var(--live-color);
}

.feed-live-dot {
  position: relative;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.feed-live-indicator.is-live .feed-live-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: currentColor;
  animation: osiLivePulse 1.8s ease-out infinite;
}

@keyframes osiLivePulse {
  0% { transform: scale(1); opacity: 0.55; }
  80%, 100% { transform: scale(2.8); opacity: 0; }
}

.mobile-title-line > .feed-live-indicator {
  margin-left: -6px;
  margin-right: auto;
}

.desktop-feed-heading > .feed-live-indicator {
  align-self: center;
}

/* Narrow phones: keep the full title by showing only the live dot. */
@media (max-width: 359px) {
  .mobile-title-line > .feed-live-indicator {
    padding: 0 7px;
  }

  .mobile-title-line .feed-live-label,
  .mobile-title-line .plan-status-prefix {
    display: none;
  }
}

.analysis-status-badge:not(.terminal):not(.awaiting_source) {
  gap: 5px;
}

.analysis-status-badge:not(.terminal):not(.awaiting_source)::before {
  content: "";
  flex: 0 0 auto;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: osiBadgePulse 1.6s ease-in-out infinite;
}

@keyframes osiBadgePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.social-action .icon,
.social-pill .icon {
  transform-origin: 50% 50%;
}

/* ---------------------------------------------------------------------------
 * 5. Stock logos: neutral placeholder while loading, coloured initials on failure.
 * ------------------------------------------------------------------------- */

.stock-logo.image:not(.is-loaded) {
  background: #2a2c35;
}

.stock-logo.image.is-loaded {
  background: #fff;
}

.stock-logo.image img {
  transition: opacity 0.16s ease;
}

.stock-logo.image:not(.is-loaded) img {
  opacity: 0;
}

.stock-logo.logo-tint-0:not(.image) { background: #3451b2; }
.stock-logo.logo-tint-1:not(.image) { background: #1d6fb8; }
.stock-logo.logo-tint-2:not(.image) { background: #0f7b8a; }
.stock-logo.logo-tint-3:not(.image) { background: #2f8045; }
.stock-logo.logo-tint-4:not(.image) { background: #b4541a; }
.stock-logo.logo-tint-5:not(.image) { background: #b83a3a; }
.stock-logo.logo-tint-6:not(.image) { background: #a23a72; }
.stock-logo.logo-tint-7:not(.image) { background: #6a45c2; }

.stock-logo[class*="logo-tint-"]:not(.image) {
  border-color: rgba(255, 255, 255, 0.1);
}

/* Row text rules (.row-main span) otherwise turn the initials grey and 15px. */
.stock-logo:not(.image):not(.kakao) {
  color: #fff;
}

.stock-logo:not(.image) > span {
  color: inherit;
  font-size: inherit;
  line-height: 1;
}

.stock-logo.logo-initials-long:not(.image) > span {
  font-size: 0.82em;
  letter-spacing: -0.02em;
}

/* ---------------------------------------------------------------------------
 * 6. Empty and error states with line art.
 * ------------------------------------------------------------------------- */

.empty-art {
  display: block;
  flex: 0 0 auto;
  width: 76px;
  height: 76px;
  color: #7c8494;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.empty-art-halo {
  fill: currentColor;
  fill-opacity: 0.07;
  stroke: currentColor;
  stroke-opacity: 0.2;
  stroke-width: 1.5;
}

.empty-art-glyph {
  stroke-width: 1.45;
}

.empty-art-spark {
  stroke-width: 2;
  stroke-opacity: 0.5;
}

.empty-art-dot {
  fill: currentColor;
  fill-opacity: 0.35;
  stroke: none;
}

.empty-state.empty-state-art {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 36px 12px;
}

.empty-state.empty-state-art p {
  max-width: 300px;
  color: var(--muted-2);
  line-height: 1.5;
  word-break: keep-all;
  text-wrap: balance;
}

.empty-state.empty-state-art .secondary-action {
  width: auto;
  min-height: 44px;
  margin-top: 2px;
  padding: 0 22px;
  font-size: 15px;
}

.stock-search-empty.empty-state-art {
  gap: 6px;
  padding: 16px 8px;
}

.stock-search-empty .empty-art {
  width: 52px;
  height: 52px;
}

.stock-search-empty p {
  font-size: 14px;
}

.inquiry-empty .empty-art {
  margin-bottom: -4px;
}

.blocked-users-empty.has-art {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 28px 4px;
  text-align: center;
}

.blocked-users-empty.has-art p {
  margin: 0;
}

.load-error .empty-art {
  width: 88px;
  height: 88px;
  margin: 0 auto 18px;
}

.load-error .primary-action {
  margin-top: 22px;
}

@media (min-width: 980px) {
  .empty-art {
    width: 84px;
    height: 84px;
  }

  .stock-search-empty .empty-art {
    width: 52px;
    height: 52px;
  }
}

/* ---------------------------------------------------------------------------
 * 7. Toast: leading status icon, up to two lines, no single-line ellipsis.
 * ------------------------------------------------------------------------- */

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(calc(100vw - 32px), 440px);
  padding: 12px 18px 12px 14px;
  border-radius: 22px;
  overflow: hidden;
  text-align: left;
  text-overflow: clip;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.toast > * {
  pointer-events: none;
}

.toast-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: #2f6fdb;
}

.toast-icon .icon {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

.toast[data-kind="success"] .toast-icon { color: #0f9960; }
.toast[data-kind="error"] .toast-icon { color: #d6334a; }

.toast-text {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.35;
}

/* ---------------------------------------------------------------------------
 * 8. Boot: logo stays where the native splash put it (176px visible wordmark),
 *    with a thin indeterminate bar below instead of a spinner swap.
 * ------------------------------------------------------------------------- */

.boot > div,
.native-capacitor .boot > div {
  position: relative;
  transform: none;
  animation: osiBootFade 0.4s ease both;
}

.native-capacitor .boot > div {
  animation: none;
}

.boot .boot-logo,
.native-capacitor .boot .boot-logo {
  display: block;
  /* The SVG viewBox pads the wordmark: 264px renders the 176px-wide visible logo. */
  width: 264px;
  height: auto;
  max-width: none;
  filter: none;
  transform: translateX(-1.5px);
}

.boot .boot-progress,
.native-capacitor .boot .boot-progress {
  display: block;
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  width: 88px;
  height: 2px;
  margin-left: -44px;
  border: 0;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  opacity: 0;
  animation: bootProgressFade 0.24s ease 0.3s forwards;
}

.boot .boot-progress::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 40%;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.78);
  animation: bootProgressSlide 1.15s cubic-bezier(0.45, 0, 0.25, 1) infinite;
}

@keyframes bootProgressFade {
  to { opacity: 1; }
}

@keyframes bootProgressSlide {
  from { transform: translateX(-100%); }
  to { transform: translateX(250%); }
}

@keyframes osiBootFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------------------------------------------------------------------------
 * 9. Brand assets.
 * ------------------------------------------------------------------------- */

img.brand-logo.brand-logo-white {
  filter: none;
}

/* WebP hero with PNG fallback: browsers without image-set type() drop these
   declarations and keep the PNG rules from styles.css. */
.landing-image-hero {
  background:
    linear-gradient(180deg, rgba(247, 250, 255, 0.99) 0%, rgba(247, 250, 255, 0.88) 30%, rgba(247, 250, 255, 0.28) 66%, rgba(247, 250, 255, 0) 100%),
    image-set(url("/static/images/landing-hero-fintech-v1.webp") type("image/webp"), url("/static/images/landing-hero-fintech-v1.png") type("image/png")) center bottom / cover no-repeat;
}

@media (max-width: 979px) {
  .landing-image-hero {
    background:
      linear-gradient(180deg, rgba(247, 250, 255, 0.99) 0%, rgba(247, 250, 255, 0.88) 38%, rgba(247, 250, 255, 0.2) 70%, rgba(247, 250, 255, 0) 100%),
      image-set(url("/static/images/landing-hero-fintech-v1.webp") type("image/webp"), url("/static/images/landing-hero-fintech-v1.png") type("image/png")) center bottom / auto 58% no-repeat;
  }
}

/* ---------------------------------------------------------------------------
 * 10. Reduced motion: no slides, pulses, shimmer or smooth scrolling.
 * ------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html,
  body {
    scroll-behavior: auto !important;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }

  .skeleton-block::after,
  .feed-live-indicator .feed-live-dot::after,
  .analysis-status-badge::before,
  .disclosure-row[data-live-inserted]::after {
    animation: none !important;
  }

  .skeleton-block::after,
  .feed-live-indicator .feed-live-dot::after {
    display: none;
  }

  .primary-action:active,
  .secondary-action:active,
  .chip:active,
  .tab-chip:active,
  .signal-filter-chip:active,
  .feed-market-option:active,
  .icon-button:active,
  .bottom-nav button:active,
  .social-action:active,
  .social-pill:active,
  .my-menu-row:active,
  .setting-row.interactive:active,
  .subscription-plan-tabs button:active,
  .desktop-subscription-tabs button:active,
  .subscription-period-card:active,
  .desktop-subscription-price-card:active {
    transform: none;
  }

  .boot > div,
  .native-capacitor .boot > div,
  .boot .boot-progress,
  .native-capacitor .boot .boot-progress {
    animation: none !important;
    opacity: 1;
  }

  .boot .boot-progress::before {
    animation: none !important;
    left: 30%;
    transform: none;
  }
}

/* ===== Plan status: plan badge with plain delay text beside it ===== */
.plan-status,
.plan-status.premium,
.plan-status.pro,
.desktop-app .plan-status,
.mobile-title-line .plan-status {
  gap: 8px;
  min-height: 0;
  padding: 0;
  border-radius: 0;
  background: none;
}

.plan-status .plan-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--blue-2);
  color: #fff;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.plan-status.premium .plan-status-badge,
.plan-status.pro .plan-status-badge {
  background: linear-gradient(135deg, #f7b84b, #d8941f);
  color: #17120a;
}

.plan-status .plan-status-delay,
.plan-status .plan-status-prefix {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.mobile-title-line .plan-status .plan-status-badge { min-height: 20px; padding: 0 7px; font-size: 11px; }
.mobile-title-line .plan-status .plan-status-delay,
.mobile-title-line .plan-status .plan-status-prefix { font-size: 12px; }
.desktop-app .plan-status .plan-status-badge { min-height: 18px; padding: 0 6px; border-radius: 4px; font-size: 10px; font-weight: 700; }
.desktop-app .plan-status .plan-status-delay,
.desktop-app .plan-status .plan-status-prefix { font-size: 12px; font-weight: 600; }

/* ===== 내 정보 hub: overview, quick tiles, grouped menu cards ===== */
.settings-hub-layout { gap: 22px; }
.settings-hub-menus { display: grid; gap: 20px; }

.settings-quick-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.settings-quick-tile {
  min-width: 0;
  display: grid;
  justify-items: start;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  background: var(--surface);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.settings-quick-tile .setting-icon { width: 30px; height: 30px; border-radius: 9px; }
.settings-quick-tile .setting-icon .icon { width: 17px; height: 17px; }
.settings-quick-label { color: var(--muted); font-size: 12px; font-weight: 800; }

.settings-quick-tile strong {
  max-width: 100%;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-quick-tile.is-on strong { color: var(--blue); }

.settings-menu-group { display: grid; gap: 8px; min-width: 0; }

.settings-menu-label {
  margin: 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
}

.settings-menu-card {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  background: var(--surface);
}

.settings-menu-card .my-menu-row {
  min-height: 58px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.settings-menu-card .my-menu-row:last-child { border-bottom: 0; }
.settings-menu-card .my-menu-row .setting-icon { width: 34px; height: 34px; border-radius: 10px; }
.settings-menu-card .my-menu-row span.settings-menu-value { color: #c9cdd6; font-size: 13px; font-weight: 800; white-space: nowrap; }
.settings-menu-item.tone-gold .setting-icon { background: rgba(247, 184, 75, 0.14); color: #f7b84b; }
.settings-menu-item.tone-muted strong { color: var(--muted); }
.settings-menu-item.tone-muted .setting-icon { background: rgba(255, 255, 255, 0.05); color: var(--muted); }

@media (max-width: 359px) {
  .settings-quick-tile { padding: 10px; }
  .settings-quick-tile strong { font-size: 14px; }
}

/* ===== Desktop: settings workspace replaces the empty disclosure detail pane ===== */
.desktop-app.settings-mode {
  grid-template-columns: var(--desktop-nav-width, 220px) minmax(0, 1fr) !important;
}

.desktop-app.settings-mode > .desktop-panel-resizer,
.desktop-app.settings-mode > .desktop-detail {
  display: none !important;
}

.desktop-settings {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  max-width: 1120px;
  padding-bottom: 32px;
}

.desktop-settings-nav {
  position: sticky;
  top: 0;
  display: grid;
  gap: 14px;
  min-width: 0;
}

.desktop-settings-nav > .settings-menu-item {
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  background: var(--surface);
}

.desktop-settings-nav .my-menu-row,
.desktop-settings-nav .settings-menu-card .my-menu-row {
  min-height: 42px;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 6px 10px;
}

.desktop-settings-nav .setting-icon,
.desktop-settings-nav .settings-menu-card .my-menu-row .setting-icon { width: 26px; height: 26px; border-radius: 8px; }
.desktop-settings-nav .setting-icon .icon { width: 15px; height: 15px; }
.desktop-settings-nav .my-menu-row strong { font-size: 13px; font-weight: 700; }
.desktop-settings-nav .settings-menu-label { font-size: 12px; font-weight: 700; }
.desktop-settings-nav .settings-menu-card .my-menu-row span.settings-menu-value { font-size: 12px; font-weight: 600; }
.desktop-settings-nav .my-menu-row.active { background: rgba(77, 148, 255, 0.12); }
.desktop-settings-nav .my-menu-row.active strong { color: #dce9ff; }

.desktop-settings-content { min-width: 0; max-width: 780px; }
.desktop-settings-content .settings-subpage-toolbar,
.desktop-settings-content .terms-toolbar { display: none; }
.desktop-settings-overview { display: grid; gap: 16px; }
.desktop-settings-overview .settings-quick-tiles { margin-top: 0; }
.desktop-settings-overview .settings-quick-tile { padding: 16px; }

@media (max-width: 1180px) {
  .desktop-settings { grid-template-columns: 220px minmax(0, 1fr); gap: 20px; }
}

/* ===== Desktop guest login: width-limited card beside a benefits column (desktop-only; mobile card untouched) ===== */
.desktop-app.guest-gate-mode {
  grid-template-columns: var(--desktop-nav-width, 220px) minmax(0, 1fr) !important;
}

.desktop-app.guest-gate-mode > .desktop-panel-resizer,
.desktop-app.guest-gate-mode > .desktop-detail {
  display: none !important;
}

.desktop-app .desktop-guest-gate {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 412px);
  gap: clamp(32px, 5vw, 72px);
  /* Top-aligned so expanding the phone form grows the card downward without moving the intro. */
  align-items: start;
  width: min(100%, 940px);
  margin: clamp(16px, 6vh, 64px) auto 48px;
}

.desktop-app .desktop-guest-intro {
  display: grid;
  gap: 18px;
  align-content: start;
  min-width: 0;
  padding-top: 40px;
}

.desktop-app .desktop-guest-eyebrow {
  justify-self: start;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(77, 148, 255, 0.12);
  color: #9cc3ff;
  font-size: 12px;
  font-weight: 700;
}

.desktop-app .desktop-guest-lead {
  margin: 0;
  color: var(--text);
  font-size: 32px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.02em;
  word-break: keep-all;
}

.desktop-app .desktop-guest-intro ul {
  display: grid;
  gap: 14px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.desktop-app .desktop-guest-intro li {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.desktop-app .desktop-guest-intro li .setting-icon { width: 36px; height: 36px; border-radius: 10px; }
.desktop-app .desktop-guest-intro li .setting-icon .icon { width: 18px; height: 18px; }
.desktop-app .desktop-guest-intro li div { display: grid; gap: 2px; min-width: 0; }
.desktop-app .desktop-guest-intro li strong { color: var(--text); font-size: 15px; font-weight: 700; }
.desktop-app .desktop-guest-intro li span:not(.setting-icon) { color: var(--muted); font-size: 13px; line-height: 1.45; word-break: keep-all; }
.desktop-app .desktop-guest-intro small { color: var(--muted-2); font-size: 12px; line-height: 1.5; word-break: keep-all; }

.desktop-app .desktop-guest-gate .guest-gate-card {
  width: 100%;
  margin: 0;
  gap: 12px;
  padding: 28px 28px 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(37, 39, 49, 0.96), rgba(27, 28, 36, 0.96));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 24px 64px rgba(0, 0, 0, 0.38);
}

.desktop-app .desktop-guest-gate .guest-gate-card > .setting-icon { width: 40px; height: 40px; border-radius: 12px; }
.desktop-app .desktop-guest-gate .guest-gate-card h2 { font-size: 20px; line-height: 1.35; font-weight: 800; letter-spacing: -0.01em; word-break: keep-all; }
.desktop-app .desktop-guest-gate .guest-gate-card > p { margin-bottom: 6px; font-size: 14px; line-height: 1.55; word-break: keep-all; }
.desktop-app .desktop-guest-gate .guest-auth-actions { gap: 8px; }

.desktop-app .desktop-guest-gate .social-button {
  position: relative;
  min-height: 48px;
  grid-template-columns: 22px minmax(0, 1fr) 22px;
  gap: 10px;
  padding: 0 16px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  transition: filter 0.15s ease, transform 0.1s ease;
}

.desktop-app .desktop-guest-gate .social-button > span:not([class]) { text-align: center; }
.desktop-app .desktop-guest-gate .social-button svg { width: 20px; height: 20px; }
.desktop-app .desktop-guest-gate .social-button:hover { filter: brightness(0.96); }

.desktop-app .desktop-guest-gate .auth-consent-notice { font-size: 12px; line-height: 1.55; }

.desktop-app .desktop-guest-gate .phone-auth-start {
  min-height: 46px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
}

.desktop-app .desktop-guest-gate .phone-auth-card { border-radius: 14px; }
.desktop-app .desktop-guest-gate .guest-policy-links { margin-top: 4px; font-size: 12px; }

@media (max-width: 1180px) {
  .desktop-app .desktop-guest-gate { grid-template-columns: minmax(0, 412px); justify-content: center; }
  .desktop-app .desktop-guest-intro { display: none; }
}

/* ===== 관심 종목: summary + alert, add-stock panel, saved list card (scoped to .favorites-workspace) ===== */
.favorites-workspace {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.favorites-panel {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 18px;
  background: var(--surface);
  padding: 16px;
}

.favorites-panel-title {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.favorites-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.favorites-panel-head > span { color: var(--muted); font-size: 13px; font-weight: 700; }

.favorites-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.favorites-summary-copy { display: grid; gap: 2px; }
.favorites-summary-copy span { color: var(--muted); font-size: 12px; font-weight: 700; }
.favorites-summary-copy strong { color: var(--text); font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }

.favorites-feed-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  padding: 0 10px 0 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(77, 148, 255, 0.14);
  color: #b9d4ff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.favorites-feed-link .icon { width: 16px; height: 16px; }

.favorites-alert-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding-top: 14px;
  cursor: pointer;
}

.favorites-alert-row .setting-icon { width: 34px; height: 34px; border-radius: 10px; }
.favorites-alert-row > div { display: grid; gap: 2px; min-width: 0; }
.favorites-alert-row strong { color: var(--text); font-size: 14px; font-weight: 700; }
.favorites-alert-row div > span { color: var(--muted); font-size: 12px; line-height: 1.4; word-break: keep-all; }

.favorites-add-panel { display: grid; gap: 12px; }
.favorites-add-panel .search-field {
  min-height: 46px;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: var(--bg);
}

.favorites-add-panel .search-field:focus-within { border-color: rgba(77, 148, 255, 0.55); }

.favorites-sector-row { display: grid; gap: 8px; min-width: 0; }
.favorites-sector-label { color: var(--muted); font-size: 12px; font-weight: 700; }

.favorites-sector-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 -16px;
  padding: 0 16px 2px;
}

.favorites-sector-chips::-webkit-scrollbar { display: none; }

.favorites-workspace .favorites-sector-chips .tab-chip {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: transparent;
  color: #c8cbd4;
  font-size: 13px;
  font-weight: 700;
}

.favorites-workspace .favorites-sector-chips .tab-chip.active {
  border-color: rgba(77, 148, 255, 0.6);
  background: rgba(77, 148, 255, 0.14);
  color: #dce9ff;
}

/* Search results keep their 88px virtualized row height; only the look changes. */
.favorites-add-panel .stock-results:empty { display: none; }
.favorites-add-panel .stock-results .stock-row {
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  border-bottom-color: var(--line);
}

.favorites-add-panel .stock-results .stock-logo,
.favorites-add-panel .stock-results .stock-logo-fallback { width: 44px; height: 44px; }

.favorites-list .stock-row {
  min-height: 64px;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 12px;
  padding: 10px 0;
}

.favorites-list .stock-row:last-child { border-bottom: 0; }
.favorites-list .stock-row .stock-logo,
.favorites-list .stock-row .stock-logo-fallback { width: 40px; height: 40px; }
.favorites-list .row-main strong { font-size: 15px; font-weight: 700; }
.favorites-list .row-main span { color: var(--muted); font-size: 12px; }

.favorites-workspace .favorite-toggle {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: transparent;
  color: #f7b84b;
}

.favorites-workspace .favorite-toggle .icon { width: 18px; height: 18px; }
.favorites-workspace .favorite-toggle:hover { background: rgba(255, 255, 255, 0.06); }
.favorites-workspace .favorite-toggle.blue { color: var(--muted); }
.favorites-workspace .favorite-toggle.blue:hover { color: #f7b84b; }

/* Desktop: saved list on the left, add-stock panel on the right; no empty disclosure pane. */
.desktop-app.favorites-mode {
  grid-template-columns: var(--desktop-nav-width, 220px) minmax(0, 1fr) !important;
}

.desktop-app.favorites-mode > .desktop-panel-resizer,
.desktop-app.favorites-mode > .desktop-detail {
  display: none !important;
}

.desktop-app .favorites-workspace {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  grid-template-areas:
    "summary add"
    "list add";
  grid-template-rows: auto 1fr;
  align-items: start;
  gap: 20px;
  max-width: 1120px;
  padding-bottom: 32px;
}

.desktop-app .favorites-summary-panel { grid-area: summary; }
.desktop-app .favorites-list-panel { grid-area: list; }
.desktop-app .favorites-add-panel { grid-area: add; position: sticky; top: 0; }
.desktop-app .favorites-add-panel .stock-results { max-height: calc(100dvh - 330px); overflow: auto; }
.desktop-app .favorites-sector-chips { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
.desktop-app .favorites-add-panel .search-field { max-width: none; }

@media (max-width: 1180px) {
  .desktop-app .favorites-workspace {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    grid-template-areas: "summary" "add" "list";
  }

  .desktop-app .favorites-add-panel { position: static; }
}

/* Wide monitors: center the favorites and 내 정보 workspaces and keep the page header aligned to them. */
@media (min-width: 1600px) {
  .desktop-app.favorites-mode .desktop-feed-header,
  .desktop-app.favorites-mode .favorites-workspace {
    width: 100%;
    max-width: 1200px;
    margin-inline: auto;
  }

  .desktop-app.settings-mode .desktop-feed-header,
  .desktop-app.settings-mode .desktop-settings {
    width: 100%;
    max-width: 1068px;
    margin-inline: auto;
  }

  .desktop-app.settings-mode .desktop-settings { grid-template-columns: 260px minmax(0, 780px); }
}
