/* ===================================================================== */
/* KudosC wordmark — big, hand-lettered script (Instagram-style logo).    */
/* Used by the home top bar (#appBrandText) and the auth pages            */
/* (.kc-wordmark). Font is "Grand Hotel", loaded from Google Fonts.       */
/* ===================================================================== */
#appBrandText, .kc-wordmark {
  background: linear-gradient(100deg, #5b8def 0%, #8b6cff 45%, #e0529c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  font-family: "Grand Hotel", "Segoe Script", "Brush Script MT", cursive;
  font-weight: 400;
  letter-spacing: .01em;
  line-height: 1.1;
  padding: 0 .08em .06em 0; /* keeps the italic swash from being clipped by background-clip */
  text-shadow: none;
}
/* home top bar: noticeably bigger than before (was 18–25px bold sans) */
#appBrandText { font-size: clamp(30px, 8vw, 38px) !important; font-weight: 400 !important; letter-spacing: .01em !important; white-space: nowrap; }
#appBrandText span { color: inherit; -webkit-text-fill-color: inherit; }
.app-brand { min-width: 0; transition: transform .2s ease, filter .2s ease; }
.app-brand:hover { filter: drop-shadow(0 4px 14px rgba(139,108,255,.45)); transform: translateY(-1px); }
.app-brand:active { transform: scale(.97); }
/* the base mobile rule sets .app-brand font-size:0 — our id rule above wins, so the name stays visible */
@media (max-width: 480px) { #appBrandText { font-size: 32px !important; } }
@media (prefers-reduced-motion: reduce) { .app-brand { transition: none; } }

/* ---------- Header: Search button + online dot (loaded after styles.css) ---------- */
/* Search: a rounded-square button that always shows its icon AND the word "Search". */
body .search-trigger {
  align-items: center; background: #fff; border: 1px solid #dfe3ee; border-radius: 12px;
  box-shadow: 0 1px 2px rgba(28,35,61,.05); color: #2b3250; cursor: pointer; display: inline-flex;
  flex: 0 0 auto; font-size: 13px; font-weight: 800; gap: 8px; height: 38px; justify-content: center;
  letter-spacing: .01em; margin-left: 22px; max-width: none; padding: 0 16px 0 13px; width: auto;
  transition: border-color .18s, box-shadow .18s, transform .12s, background .18s;
}
body .search-trigger:hover { background: #fff; border-color: #7868e9; box-shadow: 0 6px 16px rgba(120,104,233,.18); }
body .search-trigger:active { transform: scale(.96); }
body .search-trigger svg { fill: none; flex: 0 0 auto; height: 17px; stroke: #7868e9; stroke-linecap: round; stroke-width: 2.2; width: 17px; }
body .search-trigger span { color: inherit; display: inline; flex: 0 0 auto; font-size: 13px; }
body .search-trigger kbd { display: none; }
body[data-theme="dark"] .search-trigger { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.16); box-shadow: none; color: #e6edf3; }
body[data-theme="dark"] .search-trigger:hover { background: rgba(255,255,255,.1); border-color: #8b7bff; box-shadow: 0 6px 16px rgba(139,123,255,.2); }
body[data-theme="dark"] .search-trigger svg { stroke: #a99cff; }
@media (max-width: 860px) { body .search-trigger { margin-left: auto; } }
@media (max-width: 480px) {
  body .search-trigger { border-radius: 11px; gap: 6px; height: 36px; margin-left: auto; padding: 0 12px 0 10px; width: auto; }
  body .search-trigger span { display: inline; font-size: 12px; }
  body .search-trigger svg { height: 16px; width: 16px; }
}

/* Online / offline dot — sits right before the "KudosC" name. */
.app-brand .offline-indicator { align-self: center; background: transparent !important; flex: 0 0 auto; margin: 0 8px 0 0 !important; padding: 0 !important; }
.app-brand .offline-indicator-text { display: none !important; }
.app-brand .offline-indicator-dot { height: 10px; width: 10px; }
.app-brand .offline-indicator.is-online .offline-indicator-dot { animation: kcDotPulse 2.4s ease-out infinite; background: #2fb970; box-shadow: 0 0 0 0 rgba(47,185,112,.45); }
.app-brand .offline-indicator.is-offline .offline-indicator-dot { background: #e95479; box-shadow: 0 0 0 3px rgba(233,84,121,.2); }
@keyframes kcDotPulse { 0% { box-shadow: 0 0 0 0 rgba(47,185,112,.45); } 70% { box-shadow: 0 0 0 7px rgba(47,185,112,0); } 100% { box-shadow: 0 0 0 0 rgba(47,185,112,0); } }
@media (prefers-reduced-motion: reduce) { .app-brand .offline-indicator.is-online .offline-indicator-dot { animation: none; box-shadow: 0 0 0 3px rgba(47,185,112,.2); } }

/* ================================================================== */
/* Home search button — animated ring, scanning magnifier, soft shine   */
/* ================================================================== */
@property --kc-search-angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
body .search-trigger {
  --kc-search-fill: #fff;
  --kc-search-glow: rgba(120,104,233,.32);
  background:
    linear-gradient(var(--kc-search-fill), var(--kc-search-fill)) padding-box,
    conic-gradient(from var(--kc-search-angle), #dfe3ee 0deg, #dfe3ee 200deg, #9b8cff 265deg, #5b8def 305deg, #c86dd7 335deg, #dfe3ee 360deg) border-box;
  border: 1.5px solid transparent;
  isolation: isolate;
  overflow: hidden;
  position: relative;
  animation: kcSearchRing 6s linear infinite, kcSearchIn .55s cubic-bezier(.2,.9,.3,1.2) both;
  transition: box-shadow .25s ease, transform .15s ease, color .2s ease;
}
body .search-trigger:hover,
body .search-trigger:focus-visible {
  background:
    linear-gradient(var(--kc-search-fill), var(--kc-search-fill)) padding-box,
    conic-gradient(from var(--kc-search-angle), #9b8cff, #5b8def, #c86dd7, #9b8cff) border-box;
  animation-duration: 2.4s, .55s;
  border-color: transparent;
  box-shadow: 0 8px 22px var(--kc-search-glow), 0 0 0 4px rgba(120,104,233,.10);
}
body .search-trigger:focus-visible { outline: none; }
body .search-trigger:active { transform: scale(.94); }

/* soft light that glides across the button every few seconds */
body .search-trigger::after {
  background: linear-gradient(105deg, transparent 30%, rgba(155,140,255,.28) 50%, transparent 70%);
  content: ""; inset: 0; pointer-events: none; position: absolute; transform: translateX(-130%);
  animation: kcSearchShine 5.5s ease-in-out 1.4s infinite; z-index: 0;
}
body .search-trigger svg, body .search-trigger span { position: relative; z-index: 1; }

/* the magnifier draws itself once, then keeps looking around */
body .search-trigger svg { overflow: visible; transform-origin: 62% 62%; animation: kcSearchLook 4.8s ease-in-out 1.2s infinite; }
body .search-trigger svg circle { stroke-dasharray: 41; stroke-dashoffset: 41; animation: kcSearchDraw .7s ease-out .15s forwards; }
body .search-trigger svg path { stroke-dasharray: 8; stroke-dashoffset: 8; animation: kcSearchDraw .35s ease-out .75s forwards; }
body .search-trigger:hover svg { animation: kcSearchLook 1.1s ease-in-out infinite; }
body .search-trigger:active svg { animation: none; transform: scale(1.22) rotate(-8deg); }
body .search-trigger:hover span { letter-spacing: .035em; }
body .search-trigger span { transition: letter-spacing .25s ease; }

body[data-theme="dark"] .search-trigger {
  --kc-search-fill: #161b2e;
  --kc-search-glow: rgba(139,123,255,.34);
  background:
    linear-gradient(var(--kc-search-fill), var(--kc-search-fill)) padding-box,
    conic-gradient(from var(--kc-search-angle), rgba(255,255,255,.16) 0deg, rgba(255,255,255,.16) 200deg, #a99cff 265deg, #6aa0ff 305deg, #e283f0 335deg, rgba(255,255,255,.16) 360deg) border-box;
}
body[data-theme="dark"] .search-trigger:hover,
body[data-theme="dark"] .search-trigger:focus-visible {
  background:
    linear-gradient(var(--kc-search-fill), var(--kc-search-fill)) padding-box,
    conic-gradient(from var(--kc-search-angle), #a99cff, #6aa0ff, #e283f0, #a99cff) border-box;
}

@keyframes kcSearchRing { to { --kc-search-angle: 360deg; } }
@keyframes kcSearchIn { from { opacity: 0; transform: translateY(-6px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes kcSearchShine { 0%, 62% { transform: translateX(-130%); } 88%, 100% { transform: translateX(130%); } }
@keyframes kcSearchDraw { to { stroke-dashoffset: 0; } }
@keyframes kcSearchLook {
  0%, 55%, 100% { transform: rotate(0) scale(1); }
  66% { transform: rotate(-16deg) scale(1.08); }
  78% { transform: rotate(14deg) scale(1.08); }
  90% { transform: rotate(-6deg) scale(1.03); }
}
@media (prefers-reduced-motion: reduce) {
  body .search-trigger, body .search-trigger::after, body .search-trigger svg { animation: none !important; }
  body .search-trigger svg circle, body .search-trigger svg path { animation: none !important; stroke-dashoffset: 0; }
}

/* ================================================================== */
/* Search button: a clean circle (icon only; "Search" stays for screen  */
/* readers via aria-label). Placed last so it wins over the rules above. */
/* ================================================================== */
body .search-trigger,
body[data-theme="dark"] .search-trigger {
  border-radius: 50%; gap: 0; height: 40px; width: 40px; min-width: 40px; padding: 0;
}
body .search-trigger span { display: none; }
body .search-trigger::after { border-radius: 50%; }
body .search-trigger svg { height: 19px; width: 19px; }
@media (max-width: 480px) {
  body .search-trigger { border-radius: 50%; gap: 0; height: 38px; width: 38px; min-width: 38px; padding: 0; }
  body .search-trigger svg { height: 18px; width: 18px; }
}

/* ================================================================== */
/* Light theme: crisper, clearly visible borders on controls & panels   */
/* (dark theme keeps its own border colours — these only apply to light) */
/* ================================================================== */
body:not([data-theme="dark"]) {
  --kc-light-border: #cdd3e3;
  --kc-light-border-strong: #b9c0d4;
}
body:not([data-theme="dark"]) .search-trigger { --kc-search-fill: #fff; box-shadow: 0 1px 3px rgba(28,35,61,.12); }
body:not([data-theme="dark"]) .topbar { border-bottom: 1px solid var(--kc-light-border); }
body:not([data-theme="dark"]) input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
body:not([data-theme="dark"]) select,
body:not([data-theme="dark"]) textarea { border-color: var(--kc-light-border-strong); }
body:not([data-theme="dark"]) input:focus,
body:not([data-theme="dark"]) select:focus,
body:not([data-theme="dark"]) textarea:focus { border-color: #7868e9; }
body:not([data-theme="dark"]) .feed-card,
body:not([data-theme="dark"]) .project-card,
body:not([data-theme="dark"]) .settings-card,
body:not([data-theme="dark"]) .composer-card,
body:not([data-theme="dark"]) .modal { border: 1px solid var(--kc-light-border); }

/* ================================================================== */
/* Home top bar — bigger, wider KudosC wordmark                         */
/* ================================================================== */
#appBrandText {
  font-size: clamp(38px, 10vw, 50px) !important;
  letter-spacing: .06em !important;      /* wider */
  padding: 0 .14em .1em 0;
  filter: drop-shadow(0 2px 10px rgba(139, 108, 255, .28));
}
@media (max-width: 480px) { #appBrandText { font-size: 36px !important; letter-spacing: .05em !important; } }
@media (max-width: 360px) { #appBrandText { font-size: 31px !important; letter-spacing: .03em !important; } }
.app-brand { align-items: center; cursor: pointer; display: flex; gap: 2px; }

/* the little chevron that says "tap me to switch account" */
.brand-caret { fill: none; flex: 0 0 auto; height: 20px; margin-left: 2px; stroke: #6c5ce0; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.6; transition: transform .2s ease; width: 20px; }
.app-brand[aria-expanded="true"] .brand-caret { transform: rotate(180deg); }
body[data-theme="dark"] .brand-caret { stroke: #b4a8ff; }
body.is-guest .brand-caret { display: none; }
@media (max-width: 360px) { .brand-caret { height: 16px; width: 16px; } }

/* ================================================================== */
/* Home search — Instagram-style rounded-square box with icon + label   */
/* (last in file so it wins over the older circle / ring versions)      */
/* ================================================================== */
body .search-trigger,
body[data-theme="dark"] .search-trigger,
body:not([data-theme="dark"]) .search-trigger {
  align-items: center;
  animation: none;
  background: #efeff4;
  border: 1px solid transparent;
  border-radius: 12px;
  box-shadow: none;
  color: #6b7185;
  display: flex;
  flex: 1 1 200px;
  gap: 9px;
  height: 40px;
  justify-content: flex-start;
  margin: 0 18px;
  max-width: 330px;
  min-width: 0;
  overflow: hidden;
  padding: 0 14px;
  text-align: left;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
  width: auto;
}
body[data-theme="dark"] .search-trigger { background: #262a3b; color: #9aa1b8; }
body .search-trigger:hover,
body .search-trigger:focus-visible { animation: none; background: #e6e6ee; border-color: transparent; box-shadow: none; }
body[data-theme="dark"] .search-trigger:hover,
body[data-theme="dark"] .search-trigger:focus-visible { background: #2e3347; }
body .search-trigger:focus-visible { box-shadow: 0 0 0 2px rgba(120, 104, 233, .55); }
body .search-trigger:active { transform: scale(.985); }
body .search-trigger::after { display: none; }
body .search-trigger svg {
  animation: none !important; flex: 0 0 auto; height: 18px; stroke: currentColor; stroke-width: 2.2; transform: none; width: 18px;
}
body .search-trigger svg circle, body .search-trigger svg path { animation: none !important; stroke-dasharray: none; stroke-dashoffset: 0; }
body[data-theme="dark"] .search-trigger svg { stroke: currentColor; }
body .search-trigger span {
  color: inherit; display: block; font-size: 14.5px; font-weight: 500; letter-spacing: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
body .search-trigger:hover span { letter-spacing: 0; }
@media (max-width: 860px) { body .search-trigger { margin: 0 12px; } }
@media (max-width: 570px) {
  body .search-trigger,
  body[data-theme="dark"] .search-trigger,
  body:not([data-theme="dark"]) .search-trigger { border-radius: 11px; flex: 1 1 0; height: 38px; margin: 0 8px; max-width: none; padding: 0 11px; width: auto; }
  body .search-trigger span { font-size: 13.5px; }
}
/* very narrow phones: keep the box, drop its label so the name + icons still fit */
@media (max-width: 370px) { body .search-trigger span, body[data-theme="dark"] .search-trigger span, body:not([data-theme="dark"]) .search-trigger span { display: none; } body .search-trigger, body[data-theme="dark"] .search-trigger, body:not([data-theme="dark"]) .search-trigger { flex: 0 0 auto; margin-left: auto; padding: 0; justify-content: center; width: 38px; } }

/* ================================================================== */
/* Account switcher (opens from the KudosC name)                        */
/* ================================================================== */
.account-switcher {
  background: #fff; border: 1px solid #dfe3ee; border-radius: 16px; box-shadow: 0 18px 44px rgba(20, 24, 45, .22);
  color: #181d30; left: max(14px, calc((100vw - 1430px) / 2 + 34px)); max-height: min(70vh, 520px); overflow-y: auto;
  padding: 8px; position: absolute; top: calc(100% - 6px); width: min(340px, calc(100vw - 28px)); z-index: 60;
  animation: kcSwitcherIn .16s ease-out;
}
.account-switcher.is-hidden { display: none; }
@keyframes kcSwitcherIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
body[data-theme="dark"] .account-switcher { background: #171b2b; border-color: rgba(255, 255, 255, .1); box-shadow: 0 18px 44px rgba(0, 0, 0, .6); color: #eef0f6; }
.account-switcher-title { color: #8a90a6; font-size: 11px; font-weight: 800; letter-spacing: .08em; margin: 6px 10px 6px; text-transform: uppercase; }
.account-row { align-items: center; border-radius: 12px; display: flex; gap: 4px; }
.account-row:hover { background: #f1f2f8; }
body[data-theme="dark"] .account-row:hover { background: rgba(255, 255, 255, .06); }
.account-row-main { align-items: center; background: transparent; border-radius: 12px; color: inherit; cursor: pointer; display: flex; flex: 1; gap: 12px; min-width: 0; padding: 9px 10px; text-align: left; }
.account-row-main .mini-avatar { flex: 0 0 auto; height: 40px; width: 40px; }
.account-row-text { display: grid; flex: 1; gap: 2px; min-width: 0; }
.account-row-text strong { font-size: 14.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-row-text small { color: #8a90a6; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-row-check { align-items: center; background: linear-gradient(135deg, #5b8def, #8b6cff); border-radius: 50%; color: #fff; display: inline-flex; flex: 0 0 auto; height: 22px; justify-content: center; width: 22px; }
.account-row-check svg { fill: none; height: 14px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 3; width: 14px; }
.account-row-remove { align-items: center; background: transparent; border-radius: 50%; color: #8a90a6; cursor: pointer; display: inline-flex; flex: 0 0 auto; height: 32px; justify-content: center; margin-right: 6px; width: 32px; }
.account-row-remove:hover { background: rgba(233, 84, 121, .12); color: #e95479; }
.account-row-remove svg { fill: none; height: 16px; stroke: currentColor; stroke-linecap: round; stroke-width: 2.4; width: 16px; }
.account-switcher-actions { border-top: 1px solid #e6e8f0; display: grid; gap: 2px; margin-top: 6px; padding-top: 6px; }
body[data-theme="dark"] .account-switcher-actions { border-top-color: rgba(255, 255, 255, .1); }
.account-switcher-actions button { align-items: center; background: transparent; border-radius: 12px; color: inherit; cursor: pointer; display: flex; font-size: 14px; font-weight: 700; gap: 12px; padding: 10px; text-align: left; width: 100%; }
.account-switcher-actions button:hover:not(:disabled) { background: #f1f2f8; }
body[data-theme="dark"] .account-switcher-actions button:hover:not(:disabled) { background: rgba(255, 255, 255, .06); }
.account-switcher-actions button:disabled { cursor: not-allowed; opacity: .45; }
.account-add-icon { align-items: center; background: #efeff4; border-radius: 50%; color: #6c5ce0; display: inline-flex; flex: 0 0 auto; height: 40px; justify-content: center; width: 40px; }
body[data-theme="dark"] .account-add-icon { background: #262a3b; color: #b4a8ff; }
.account-add-icon svg { fill: none; height: 20px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.2; width: 20px; }
@media (max-width: 570px) { .account-switcher { left: 12px; top: calc(100% - 4px); } }
body.chat-page-open .account-switcher { display: none !important; }

/* login / signup in "add another account" mode */
.kc-add-account-bar { align-items: center; background: rgba(120, 104, 233, .1); border: 1px solid rgba(120, 104, 233, .28); border-radius: 12px; display: flex; flex-wrap: wrap; font-size: 13px; font-weight: 600; gap: 6px 12px; justify-content: space-between; margin-bottom: 16px; padding: 10px 12px; }
.kc-add-account-bar button { background: transparent; color: #6c5ce0; cursor: pointer; font-size: 13px; font-weight: 800; padding: 2px 0; }
.kc-add-account-bar button:disabled { opacity: .5; }

/* never let the wordmark be squeezed under the search box on phones */
.app-brand { flex: 0 0 auto; }
@media (max-width: 570px) { body .search-trigger, body[data-theme="dark"] .search-trigger, body:not([data-theme="dark"]) .search-trigger { min-width: 38px; } }
