/*
 * ANDROID_TABLET_LANDSCAPE_V1_BEGIN
 * Landscape-only geometry. The shared one-pixel reading increment and all
 * component appearance remain owned by tablet.css.
 * Rotation changes layout classes, never the page or its live components.
 */

html.layout-mobile.device-tablet.mobile-tablet-landscape[data-layout-page="index"]:not(.layout-industrial) {
  --tablet-landscape-user-width: min(60%, 680px);
  --tablet-assistant-rail-width: min(76%, 900px);
}

html.layout-mobile.device-tablet.mobile-tablet-landscape[data-layout-page="index"]:not(.layout-industrial) #chatArea > .message.user-message {
  align-self: flex-end !important;
  width: fit-content;
  max-width: var(--tablet-landscape-user-width) !important;
  margin-right: 0 !important;
  margin-left: auto !important;
}

/* Learning artifacts and their controls share a wider rail. The shared tablet
   layer owns width/max-width; landscape only supplies their scoped value. */
html.layout-mobile.device-tablet.mobile-tablet-landscape[data-layout-page="index"]:not(.layout-industrial) #chatArea > .message.assistant-message.video-resource-message,
html.layout-mobile.device-tablet.mobile-tablet-landscape[data-layout-page="index"]:not(.layout-industrial) #chatArea > .message.assistant-message.interactive-resource-message,
html.layout-mobile.device-tablet.mobile-tablet-landscape[data-layout-page="index"]:not(.layout-industrial) #chatArea > .message.assistant-message.has-markmap,
html.layout-mobile.device-tablet.mobile-tablet-landscape[data-layout-page="index"]:not(.layout-industrial) #chatArea > .message.assistant-message.problem-solving-message,
html.layout-mobile.device-tablet.mobile-tablet-landscape[data-layout-page="index"]:not(.layout-industrial) #chatArea > .message.assistant-message.concept-comparison-message,
html.layout-mobile.device-tablet.mobile-tablet-landscape[data-layout-page="index"]:not(.layout-industrial) #chatArea > .message.assistant-message.help-options-message,
html.layout-mobile.device-tablet.mobile-tablet-landscape[data-layout-page="index"]:not(.layout-industrial) #chatArea > .message.assistant-message.error-diagnosis-report,
html.layout-mobile.device-tablet.mobile-tablet-landscape[data-layout-page="index"]:not(.layout-industrial) #chatArea > .message.assistant-message.video-resource-message + .controls,
html.layout-mobile.device-tablet.mobile-tablet-landscape[data-layout-page="index"]:not(.layout-industrial) #chatArea > .message.assistant-message.interactive-resource-message + .controls,
html.layout-mobile.device-tablet.mobile-tablet-landscape[data-layout-page="index"]:not(.layout-industrial) #chatArea > .message.assistant-message.has-markmap + .controls,
html.layout-mobile.device-tablet.mobile-tablet-landscape[data-layout-page="index"]:not(.layout-industrial) #chatArea > .message.assistant-message.problem-solving-message + .controls,
html.layout-mobile.device-tablet.mobile-tablet-landscape[data-layout-page="index"]:not(.layout-industrial) #chatArea > .message.assistant-message.concept-comparison-message + .controls,
html.layout-mobile.device-tablet.mobile-tablet-landscape[data-layout-page="index"]:not(.layout-industrial) #chatArea > .message.assistant-message.help-options-message + .controls,
html.layout-mobile.device-tablet.mobile-tablet-landscape[data-layout-page="index"]:not(.layout-industrial) #chatArea > .message.assistant-message.error-diagnosis-report + .controls {
  --tablet-assistant-rail-width: min(92%, 1120px);
}

html.layout-mobile.device-tablet.mobile-tablet-landscape[data-layout-page="index"]:not(.layout-industrial) #chatArea > .thinking-panel,
html.layout-mobile.device-tablet.mobile-tablet-landscape[data-layout-page="index"]:not(.layout-industrial) #chatArea > .mobile-thinking-panel {
  align-self: center;
  width: var(--tablet-assistant-rail-width);
  max-width: var(--tablet-assistant-rail-width);
  margin-right: auto;
  margin-left: auto;
}

html.layout-mobile.device-tablet.mobile-tablet-landscape[data-layout-page="index"]:not(.layout-industrial) #mobileBottomActionRow .mobile-menu-list {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  width: min(680px, calc(100vw - (var(--tablet-edge) * 2))) !important;
  margin-right: auto !important;
  margin-left: auto !important;
}

/* The welcome surface may spend horizontal space on equivalent cards. Active
   dialogue remains a single chronological stream. */
html.layout-mobile.device-tablet.mobile-tablet-landscape[data-layout-page="index"]:not(.layout-industrial) #recommendQuestionsPanel .recommend-questions-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  max-width: min(880px, calc(100vw - (var(--tablet-edge) * 2))) !important;
  margin-right: auto !important;
  margin-left: auto !important;
}

/* Use landscape width for tools and leave more height for the drawing canvas. */
html.layout-mobile.device-tablet.mobile-tablet-landscape[data-layout-page="index"]:not(.layout-industrial) #drawingBoardModal .drawing-controls {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

/* ANDROID_TABLET_LANDSCAPE_V1_END */
