.lm-input-expander {
  flex: none;
  align-self: flex-start;
  width: 32px;
  min-height: 32px;
  margin-block: 4px;
  padding: 0;
  border: 1px solid var(--line, #aaa7);
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font-size: 18px;
  cursor: pointer;
}
.lm-input-expander[hidden] { display: none; }
.lm-editor-dialog {
  position: fixed;
  inset: 0;
  width: min(92vw, 640px);
  max-height: 86vh;
  max-height: 86dvh;
  margin: auto;
  padding: 18px;
  overflow: auto;
  border: 1px solid var(--line, #aaa7);
  border-radius: 16px;
  background: var(--lm-card-color, Canvas);
  color: var(--lm-page-text, CanvasText);
}
.lm-editor-dialog::backdrop { background: #1118; }
.lm-editor-dialog h2 { margin: 0 0 14px; font-size: 19px; }
.lm-editor-dialog form { display: grid; gap: 10px; }
.lm-editor-dialog textarea, .lm-editor-dialog input:not([type=checkbox]), .lm-editor-dialog select {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line, #aaa7);
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
}
.lm-editor-dialog textarea { min-height: 6em; resize: vertical; }
.lm-editor-dialog textarea.lm-draft { min-height: min(42dvh, 350px); }
.lm-editor-dialog footer, .lm-editor-dialog .lm-variant-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lm-editor-dialog footer { justify-content: flex-end; margin-top: 10px; }
.lm-editor-dialog button, .lm-action-button {
  padding: 7px 11px;
  border: 1px solid var(--line, #aaa7);
  border-radius: 8px;
  color: inherit;
  background: transparent;
  font: inherit;
  cursor: pointer;
}
.lm-editor-dialog button[data-primary] { background: #007fca; color: #fff; }
.lm-editor-dialog button:disabled, .lm-action-button:disabled { opacity: .5; cursor: default; }
.lm-variant-row { padding-block: 8px; border-bottom: 1px solid var(--line, #aaa7); }
.lm-variant-row strong { flex: 1 1 90px; overflow-wrap: anywhere; }
.lm-ai-table { max-width: 100%; overflow: auto; }
.lm-ai-table table { border-collapse: collapse; min-width: max-content; }
.lm-ai-table :is(th,td) { padding: .42em .7em; border: 1px solid var(--line, #aaa7); text-align: start; }
.lm-ai-table th { background: color-mix(in srgb,currentColor 7%,transparent); }
.lm-inline-reasoning { margin-block: .25em .5em; font-size: .87em; }
.lm-inline-reasoning summary { cursor: pointer; }
.lm-plot-actions { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.lm-plot-actions button { font-size:13px; }
html.lm-page-background:not(.dark) :is(.model-type-tabs,.model-tier-tabs) { background:transparent!important; backdrop-filter:none!important; }
:is(.model-type-tabs,.model-tier-tabs) button { min-height:32px; padding:5px 11px; font-size:13px; }
.workshop-type-row { display:flex; align-items:center; gap:8px; padding-inline:12px; min-width:0; }
.workshop-type-row .card-type-tabs { flex:1; margin-inline:0; min-width:0; }
.workshop-type-row .layout-toggle-btn { flex:none; margin:0; }
#exchange-modal .exchange-modal-card { display:flex; flex-direction:column; max-height:calc(100vh - 16px); max-height:calc(100dvh - max(16px, env(safe-area-inset-top))); }
#exchange-modal .modal-header { flex:none; }
#exchange-modal .lm-exchange-scroll { min-height:0; overflow:auto; overscroll-behavior:contain; }

body.lm-home-page #page-dynamic .dynamic-entry-card {
  display: grid !important;
  grid-template-columns: clamp(42px, 14vw, 62px) minmax(0, 1fr) auto;
  grid-template-areas: "icon content arrow";
  text-align: start !important;
  align-items: center;
  gap: 14px;
}
body.lm-home-page #page-dynamic .dynamic-entry-icon {
  grid-area: icon;
  position: static;
  justify-self: start;
  width: 100%;
  max-width: 62px;
  height: auto;
  aspect-ratio: 1;
  margin: 0 !important;
  transform: none !important;
}
body.lm-home-page #page-dynamic .dynamic-entry-main { grid-area: content; min-width: 0; width: 100%; text-align: start !important; }
body.lm-home-page #page-dynamic .dynamic-entry-arrow { grid-area: arrow; position: static; transform: none; justify-self: end; }
.lm-composer-field { position: relative; flex: 1 1 0; min-width: 0; }
.lm-composer-field > textarea { display: block; width: 100%; box-sizing: border-box; }
.lm-composer-field.lm-composer-expandable > textarea { padding-right: 38px; }
.lm-composer-field > .lm-input-expander {
  position: absolute;
  top: 4px;
  right: 5px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  min-height: 0;
  margin: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.lm-composer-field > .lm-input-expander[hidden] { display: none; }
.lm-input-expander svg, .lm-plot-icon svg, #lm-undo-turn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.lm-plot-actions.lm-plot-actions-below { margin: 4px 0 12px; justify-content: flex-start; }
.lm-plot-actions.lm-plot-actions-below.user-actions { justify-content: flex-end; }
#lm-undo-turn {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  padding: 0;
}
#plotImmersive .lm-plot-tools { display: flex; flex-wrap: nowrap; justify-content: end; gap: 4px; margin-left: auto; }
#plotImmersive .lm-plot-tools .lm-plot-icon {
  display: grid;
  place-items: center;
  padding: 0;
  width: 29px;
  height: 29px;
  min-height: 0;
}
button.gs-row.lm-voice-settings-row, button.settings-item.lm-variants-row {
  width: 100%;
  font: inherit;
  text-align: start;
  color: inherit;
  border-inline: 0;
  border-top: 0;
  background: transparent;
}
.lm-variants-row[hidden] { display: none; }


.lm-composer-field{position:relative;flex:1 1 0;min-width:0;align-self:flex-end}
.lm-composer-field>textarea{padding-right:36px!important;min-width:0;max-width:100%;margin:0!important}
.lm-composer-field>.lm-input-expander{position:absolute!important;inset:5px 5px auto auto!important;width:27px!important;height:27px!important;padding:3px!important;display:grid;place-items:center;z-index:2;border:0;background:transparent;color:inherit}
.lm-composer-field>.shared-emoji-button{position:absolute;left:-40px;bottom:2px}
:is(.chat-footer .input-row,.gc-input-area){align-items:flex-end!important}
:is(.chat-footer .input-row,.gc-input-area)>.shared-emoji-button{align-self:flex-end!important;margin:0 0 2px!important;flex:0 0 32px;height:34px!important}
.chat-footer .icon-row,.gc-tool-row{flex-wrap:nowrap!important;overflow-x:auto;scrollbar-width:none;justify-content:flex-start!important}
.chat-footer .icon-row>.tool-icon-btn,.gc-tool-row>.gc-tool-btn{flex:0 0 auto!important;white-space:nowrap;min-height:34px}
:is(#chat-web-search-btn,#gc-web-search-btn)[aria-pressed=true]{border-color:var(--primary,#0099ff)!important;color:var(--primary,#0099ff)!important;background:rgba(0,153,255,.08)!important}
:is(#chat-web-search-btn,#gc-web-search-btn){border:1px solid transparent;border-radius:18px}
.lm-plot-actions button{display:inline-flex;align-items:center;gap:4px;padding:5px 8px;font-size:12px;min-height:28px}
.lm-plot-actions svg,.lm-plot-icon svg{display:block;width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
#lm-undo-turn{position:static!important;margin-left:auto!important;order:0;width:28px;height:28px}#immersiveBtn{position:static!important;order:1}.plot-header-settings{order:2}
.lm-summary-dialog{width:min(92vw,640px);border:1px solid var(--border-light,#ccd);border-radius:24px;background:var(--bg-card,#f7f8fc);color:var(--text-main,#17191f);padding:22px;max-height:86dvh;overflow:auto;margin:auto}
.lm-summary-dialog::backdrop{background:#0007}.lm-summary-dialog header{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}.lm-summary-dialog h2{margin:0;font-size:22px}.lm-summary-dialog .summary-close{border:0;background:transparent;font-size:26px;color:inherit}.lm-summary-dialog textarea{width:100%;min-height:220px;max-height:44dvh;box-sizing:border-box;resize:vertical;padding:14px;border:1px solid var(--border-light,#ccd);border-radius:12px;background:transparent;color:inherit;font:inherit;line-height:1.65}.lm-summary-dialog footer{display:flex;gap:12px;margin-top:16px}.lm-summary-dialog footer button{flex:1;padding:12px;border:1px solid var(--border-light,#ccd);border-radius:14px;background:transparent;color:inherit;font:inherit}.lm-summary-dialog footer button.primary{background:#0099ff;color:#fff;border-color:#0099ff}
.gc-summary-overlay.active{display:flex!important;align-items:center;justify-content:center;padding:16px;box-sizing:border-box}.gc-summary-overlay .gc-summary-sheet{width:min(100%,640px);border-radius:24px;max-height:85dvh;transform:none!important}.gc-summary-sheet .gc-summary-handle{display:none}.gc-summary-body{overflow:auto;max-height:65dvh}


/* Chat action geometry is shared by role and group screens. */
body :is(.chat-footer .icon-row,.gc-tool-row){gap:8px!important;padding:7px 10px!important;align-items:center!important}
body :is(.chat-footer .icon-row>.tool-icon-btn,.gc-tool-row>.gc-tool-btn){box-sizing:border-box;height:34px!important;min-height:34px!important;width:72px!important;min-width:72px!important;padding:0 12px!important;border:1px solid transparent;border-radius:999px!important;gap:5px!important;justify-content:center;font-family:inherit;font-weight:500;font-size:12px;line-height:1.2;background:var(--active-bg,rgba(127,127,127,.1));flex:0 0 72px!important;white-space:nowrap}
body :is(.chat-footer .icon-row>.tool-icon-btn,.gc-tool-row>.gc-tool-btn) :is(svg){width:16px!important;height:16px!important;flex:0 0 16px!important}
body :is(.chat-footer .icon-row .tool-icon-label,.gc-tool-row>.gc-tool-btn>span){font-size:12px!important;line-height:1.2}
body :is(.chat-image-btn,#gc-image-btn,.shared-emoji-button){box-sizing:border-box;width:34px!important;height:34px!important;min-width:34px!important;min-height:34px!important;flex:0 0 34px!important;align-self:flex-end!important;padding:5px!important;margin:0 0 2px!important;border:0!important;border-radius:0!important;box-shadow:none!important;background:transparent!important;color:var(--text-sub,var(--page-muted,#777))}
body :is(.chat-image-btn,#gc-image-btn,.shared-emoji-button)>svg{display:block;width:24px!important;height:24px!important;fill:none;stroke:currentColor}
.lm-plot-actions.lm-plot-actions-below{margin:-2px 0 8px auto;justify-content:flex-end;padding-right:8px;gap:6px}
.lm-plot-actions.lm-plot-actions-below button{border-radius:999px;min-height:28px;padding:4px 10px;gap:4px;font-size:12px}
.lm-variants-page .page-content{padding:20px;overflow:auto}.lm-variants-page .lm-variant-row{display:flex;align-items:center;gap:8px;min-height:56px;padding:10px 0;border-bottom:1px solid var(--border-light,#ccc6)}
.lm-variants-page h2{font-size:21px;margin:0 0 10px}.lm-variants-page p{line-height:1.7;color:var(--text-sub,#777)}.lm-variants-page .lm-variant-row strong{flex:1;min-width:0;overflow-wrap:anywhere}
.lm-variants-page button:not(.page-back){padding:8px 12px;border:1px solid var(--border-light,#ccc8);border-radius:12px;background:transparent;color:inherit;font:inherit;cursor:pointer}.lm-variants-page button:disabled{opacity:.5;cursor:default}
.lm-variants-page footer{display:flex;gap:10px;margin-top:18px}.lm-variants-page footer button[data-primary]{flex:1;background:#0099ff;color:white;border-color:#0099ff;padding:13px}
.lm-variants-page form>label{display:grid;gap:8px;margin:16px 0}.lm-variants-page :is(input,textarea){width:100%;box-sizing:border-box;padding:12px;border:1px solid var(--border-light,#ccc8);border-radius:12px;color:inherit;background:rgba(var(--lm-panel-rgb,255,255,255),var(--lm-panel-alpha,1));font:inherit}.lm-variants-page textarea{min-height:120px;resize:vertical}.lm-variants-page .page-back{border:0;background:transparent;color:inherit}
