/* IdealChat UI theme v1 (2026-10-26, UIRedesign) — colors from the IdealChat logo.
   Re-skins the DOM overlays (ic_rec.js / ai_panel.js / ic_optm.js / ai_status.js / ic_menu.js).
   The Flutter canvas itself is themed via config.json "colorSchemeSeedInt".
   Overrides only colors, radii and hover/focus states; no layout or behavior changes.
   Rollback: remove the <link ... ic_theme.css> line from index.html (or run ui_theme.sh rollback). */
:root {
  --ic-brand: #0e8f86;        /* logo teal, large text / fills */
  --ic-brand-strong: #0b7a72; /* text & links on white, 5.2:1 */
  --ic-brand-soft: #e3f6f2;   /* selected / tag background */
  --ic-brand-line: #a8dcd3;   /* selected border */
  --ic-line: #dbe5e2;         /* neutral border with a teal cast */
  --ic-ink: #1c2f3a;          /* logo navy, primary text */
  --ic-muted: #5f7078;        /* secondary text, 5.1:1 */
  --ic-accent: #e8892f;       /* logo orange, sparingly */
  --ic-accent-soft: #fff1e4;
  --ic-accent-ink: #b4561a;
}

/* ---- Recommendation row (ic_rec.js #icrec) ---- */
#icrec .b button {
  border-color: var(--ic-line) !important;
  color: var(--ic-ink) !important;
  transition: background-color .15s, border-color .15s;
}
#icrec .b button:hover { background: #f4faf8 !important; }
#icrec .b button.on {
  background: var(--ic-brand-soft) !important;
  border-color: var(--ic-brand-line) !important;
  color: var(--ic-brand-strong) !important;
}
#icrec .l { border-color: var(--ic-line) !important; border-radius: 12px !important; }
#icrec .h a, #icrec .l > a { color: var(--ic-brand-strong) !important; }
#icrec .x { background: #f3f8f6 !important; color: var(--ic-muted) !important; }
#icrec .r { border-radius: 8px; }
#icrec .r:hover { background: #f4faf8; }
#icrec .r img, #icrec .r i { background: var(--ic-brand-soft) !important; }
#icrec .r button {
  border-color: var(--ic-brand-line) !important;
  background: #fff !important;
  color: var(--ic-brand-strong) !important;
}
#icrec .r button:hover:not([disabled]) { background: var(--ic-brand-soft) !important; }
#icrec .r button[disabled] { border-color: var(--ic-line) !important; color: #8a979c !important; }

/* ---- In-room member panel (ic_rec.js #icrm, 「本群成员」) ---- */
#icrm .t { border-color: var(--ic-line) !important; color: var(--ic-ink) !important; }
#icrm .t:hover { background: #f4faf8 !important; }
#icrm .t i, #icrm .m { color: var(--ic-brand-strong) !important; }
#icrm .p { border-color: var(--ic-line) !important; border-radius: 12px !important; }
#icrm .r { border-radius: 8px; }
#icrm .r:hover { background: #f4faf8; }
#icrm .r img, #icrm .r u { background: var(--ic-brand-soft) !important; }
#icrm .r em { /* AI tag: was purple, now brand teal */
  color: var(--ic-brand-strong) !important;
  background: var(--ic-brand-soft) !important;
}

/* ---- AI / member detail panel (ai_panel.js .icp) ---- */
.icp { color: var(--ic-ink) !important; border-radius: 16px !important; }
.icp h3 { color: var(--ic-muted) !important; border-bottom-color: var(--ic-line) !important; }
.icp-pen { color: var(--ic-brand-strong) !important; }
.icp-btn { border-color: var(--ic-line) !important; background: #f6faf9 !important; transition: background-color .15s; }
.icp-btn:hover { background: var(--ic-brand-soft) !important; border-color: var(--ic-brand-line) !important; }
.icp-btn.icp-sw { background: #c62828 !important; border-color: #c62828 !important; color: #fff !important; } /* keep danger red */
.icp th { background: #f3f8f6 !important; }
.icp-av { background: var(--ic-brand-soft) !important; }

/* ---- New-group optional members dialog (ic_optm.js) ---- */
#ic-optm button[data-a="ok"] { background: var(--ic-brand) !important; }
#ic-optm button[data-a="ok"]:hover { background: var(--ic-brand-strong) !important; }
#ic-optm [role="dialog"] { border-radius: 16px !important; }

/* ---- AI status sheet (ai_status.js) & task panel (ic_menu.js) ---- */
#ic-ai-status .p { color: var(--ic-ink) !important; border-radius: 16px !important; }
#ic-ai-status .r { border-top-color: var(--ic-line) !important; }
#ic-ai-status .k, #ic-ai-status .s { color: var(--ic-muted) !important; }
#ic-task-panel { border-left-color: var(--ic-line) !important; }

/* ---- Shared: checkboxes, focus ring ---- */
#icrec input[type="checkbox"], #icrecset input[type="checkbox"], #ic-optm input[type="checkbox"],
.icp input[type="checkbox"] { accent-color: var(--ic-brand); }
#icrecset button, #icrec button, #icrm .t, #ic-optm button, .icp-btn, .icp-pen { outline: none; }
#icrecset button:focus-visible, #icrec button:focus-visible, #icrm .t:focus-visible,
#ic-optm button:focus-visible, .icp-btn:focus-visible, .icp-pen:focus-visible {
  box-shadow: 0 0 0 3px rgba(14, 143, 134, .35) !important;
}

/* ---- Login page on phones: language chip + AGPL source link no longer cover the 「登录」 button ---- */
#ic-lang-menu button[aria-checked=true] { color: var(--ic-brand-strong) !important; }
@media (max-width: 600px) {
  #ic-lang {
    top: calc(10px + env(safe-area-inset-top, 0px)) !important;
    bottom: auto !important;
    padding: 5px 10px !important;
    font-size: 12px !important;
  }
  #ic-lang-menu {
    top: calc(46px + env(safe-area-inset-top, 0px)) !important;
    bottom: auto !important;
  }
  #ic-src-link {
    bottom: calc(2px + env(safe-area-inset-bottom, 0px)) !important;
    background: transparent !important;
    font-size: 11px !important;
    padding: 0 6px !important;
    white-space: nowrap !important;
    color: var(--ic-muted) !important;
  }
}
