/* galaxy — ajustements pour la vraie application (les gabarits viennent de bundle.css) */
html, body { margin: 0; height: 100%; background: var(--bg); }
body.gx { min-height: 100%; overscroll-behavior: none; }
button { font: inherit; }
a { color: inherit; }
a.btn, a.brand { text-decoration: none; }
[hidden] { display: none !important; }
.app { position: fixed; inset: 0; overflow: hidden; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* éléments cliquables reprenant les gabarits */
button.planet-card, button.rail-item, button.tab, button.menu-item, button.suggest-chip {
  font: inherit; color: inherit; text-align: left; width: 100%; appearance: none; }
button.planet-card { border: 1px solid var(--line); }
button.rail-item { border: 0; background: transparent; }
button.rail-item.is-active { background: var(--surface-2); }
button.menu-item { border: 0; background: transparent; cursor: pointer; }
button.menu-item:hover { background: var(--surface-2); }
button.tab { width: auto; cursor: pointer; }
.suggest button { height: 34px; padding: 0 14px; display: inline-flex; align-items: center; border-radius: var(--radius-pill); border: 1px solid var(--line); background: var(--surface-1); font-size: 13px; color: var(--ink); cursor: pointer; }
.suggest button:hover { background: var(--surface-2); }
.seg button { height: 30px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 500; color: var(--ink-muted); border: 0; background: transparent; cursor: pointer; }
.seg button.on { background: var(--surface-1); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }

/* connexion */
.login-page { position: relative; z-index: 1; min-height: 100%; display: grid; place-items: center; padding: 40px 16px; box-sizing: border-box; }
.login-card { max-width: 100%; box-sizing: border-box; }
input.input.real { width: 100%; box-sizing: border-box; font: inherit; font-size: 16px; outline: none; }
input.input.real:focus { box-shadow: var(--shadow-focus); }
.otp-input { position: relative; }
.otp-input input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; font-size: 16px; caret-color: transparent; }
.otp-input:focus-within .otp-cell.is-active { box-shadow: var(--shadow-focus); }
.recap button { background: none; border: 0; color: var(--ink-muted); font-size: 13px; cursor: pointer; text-decoration: underline; }
.setup-steps { margin: 0; padding-left: 20px; color: var(--ink-muted); font-size: 14px; line-height: 20px; display: flex; flex-direction: column; gap: 4px; }
.qr { background: #fff; border-radius: var(--radius-md); padding: 12px; width: 220px; align-self: center; }
.qr svg { display: block; width: 100%; height: auto; }

/* accueil */
.scr-body.scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.home-wrap { padding-bottom: 160px; }
.planet-card .pc-last { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.planet-card .pc-sub { color: var(--ink-muted); font-weight: 400; font-size: 13px; margin-left: 6px; }
@media (max-width: 1100px) { .planet-grid { grid-template-columns: repeat(3, 1fr); } }
.banner + .banner { margin-top: 10px; }
.banner button { flex: none; }

/* barre de discussion réelle */
.composer textarea { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; resize: none; color: var(--ink); font: inherit; font-size: 15px; line-height: 22px; padding: 10px 0; max-height: 160px; }
.composer textarea::placeholder { color: var(--ink-faint); }
.composer:focus-within { box-shadow: var(--shadow-focus); }
.composer .c-send[disabled] { opacity: .35; cursor: default; }
.composer.is-recording textarea { color: var(--hermes); }
.dock { pointer-events: none; }
.dock > * { pointer-events: auto; }

/* fil */
.proj-thread { overflow-y: auto; justify-content: flex-start; }
.proj-thread > .thread, .m-thread > .thread { margin-top: auto; }
.msg { max-width: 720px; }
.msg-text { white-space: normal; overflow-wrap: anywhere; }
.msg-text p { margin: 0 0 8px; } .msg-text p:last-child { margin: 0; }
.msg-text code { font-family: var(--font-mono); font-size: 13px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; }
.msg-text pre { font-family: var(--font-mono); font-size: 13px; line-height: 20px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 10px 12px; overflow-x: auto; margin: 6px 0; white-space: pre; }
.msg-text ul { margin: 4px 0 8px; padding-left: 20px; }
.msg-text a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.msg.is-error .msg-text { color: var(--down); }
.msg .tool-line { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--ink-muted); }
.approval .cmd { white-space: pre-wrap; overflow-wrap: anywhere; }
.approval.is-expired { border-color: var(--line); }
.approval.is-expired .approval-top { background: var(--surface-2); color: var(--ink-muted); }

/* projet desktop */
.proj { grid-template-columns: 248px minmax(0, 1fr) 340px; }
.proj-rail { overflow-y: auto; }
.proj-rail .input input { background: transparent; border: 0; outline: none; color: var(--ink); font: inherit; width: 100%; }
.proj-side { overflow-y: auto; }
.proj-side .panel { gap: 12px; }
.quick .btn { font-size: 13px; }
@media (max-width: 1180px) { .proj { grid-template-columns: 220px minmax(0, 1fr); } .proj-side { display: none; } }

/* menu profil */
.menu-wrap { position: relative; }
.menu.pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; }
.menu-item small { display: block; }

/* mobile */
.m-view { position: absolute; inset: 0; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top); }
.m-view .tabs { overflow-x: auto; scrollbar-width: none; padding-bottom: 10px; flex: none; }
.m-view .tabs::-webkit-scrollbar { display: none; }
.m-view .m-thread { position: relative; top: auto; bottom: auto; flex: 1; overflow-y: auto; padding: 4px 16px 16px; justify-content: flex-start; }
.m-view .m-compose { position: relative; padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
.m-home .m-compose { position: absolute; background: linear-gradient(to top, var(--bg) 60%, transparent); }
.m-home .scr-body { padding-bottom: 120px; }
.sheet.fixed { position: fixed; max-height: 82vh; overflow-y: auto; padding-bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 30; }
.scrim.fixed { position: fixed; z-index: 29; }
.sheet .panel { border: 0; padding: 4px 0 0; background: transparent; }
@media (max-width: 860px) {
  .hello { font-size: 34px; line-height: 38px; }
  .login-card { padding: 24px; }
  .otp-cell { width: 44px; }
  .msg { max-width: 100%; }
  .approval { max-width: 100%; }
}

/* toasts */
.toast { position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%); background: var(--surface-1); border: 1px solid var(--line-strong); color: var(--ink); padding: 10px 16px; border-radius: var(--radius-pill); box-shadow: var(--shadow-float); font-size: 14px; z-index: 50; max-width: calc(100vw - 32px); }
