/* CAROMY UI V0.1.26.2 — multilingual fit, layout only.
   No changes to translations, shot physics, recommendation logic or event handlers. */

/* A flex/grid child with a long English label must be allowed to shrink. */
.app-shell, .app-main, .app-view, .panel, .page-head,
.shot-card, .shot-card-top, .shot-card-top > *,
.lesson-panel, .lesson-search-panel, .lesson-shot-head,
.profile-hero, .profile-hero > div, .setting-row,
.capture-actions-three, .recommend-actions, .rotation-toolbar,
.practice-four-grid, .practice-tile, .practice-tile-heading,
.caromy-v022-card, .caromy-thanks-card {min-width:0;}

/* Critical rule: a translated label must never be forced outside its button.
   Keep actual content (no ellipsis, no text clipping), and allow line breaks. */
button, [role="button"], .bottom-nav a,
button strong, button small, button span, button b,
.bottom-nav a small, .bottom-nav button small {
  box-sizing:border-box;
  min-width:0;
  max-width:100%;
  white-space:normal!important;
  overflow-wrap:anywhere;
  word-break:normal;
  line-height:1.25;
}
button:not(.icon-btn):not(.profile-shortcut) {text-align:center;}

/* Main menu: preserve all four tabs while making room for two-line labels. */
.bottom-nav, .bottom.bottom-nav {
  height:auto!important;
  min-height:var(--nav-h,84px);
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
}
.bottom-nav .nav-item, .bottom.bottom-nav a {
  min-width:0!important;
  max-width:100%;
  padding:5px 2px!important;
}
.bottom-nav .nav-item small, .bottom.bottom-nav a small {
  display:block;
  width:100%;
  max-width:100%;
  white-space:normal!important;
  overflow-wrap:anywhere;
  font-size:clamp(10px,2.7vw,13px)!important;
  line-height:1.25!important;
}
.app-main {padding-bottom:calc(142px + env(safe-area-inset-bottom))!important;}
.app:has(.practice-four-grid){padding-bottom:145px!important;}

/* Header + capture buttons: a 76 px fixed-height card cannot hold two translated lines. */
.app-header, .header {min-width:0;}
.app-header .brand, .header .brand {min-width:0;max-width:100%;}
.app-header .brand > span {min-width:0;}
.app-header .brand strong, .app-header .brand small,
.header .brand strong, .header .brand small {
  white-space:normal!important;
  overflow-wrap:anywhere;
}
.app-header .header-actions {flex-shrink:0;}
.capture-actions-three {grid-template-columns:repeat(3,minmax(0,1fr))!important;}
.capture-actions-three .capture-btn,
.capture-actions-three .capture-btn.manual-compact {
  width:100%!important;
  height:auto!important;
  min-height:82px!important;
  padding:9px 4px!important;
  gap:4px!important;
}
.capture-actions-three .capture-btn strong {
  display:block;
  max-width:100%;
  white-space:normal!important;
  overflow-wrap:anywhere;
  line-height:1.22!important;
  font-size:clamp(11px,3.1vw,15px)!important;
}
.manual-layout-btn {height:auto!important;min-height:48px;}
.manual-layout-btn strong, .manual-layout-btn small {white-space:normal!important;}
.recommend-actions .cta-primary.wide,
#recommendBtn, .compact-action, .lesson-channel-btn, .caromy-teach-btn {
  height:auto!important;
  min-height:50px;
  padding:10px 8px!important;
}

/* Recommendation playback controls and tutorial buttons — highest overflow risk. */
.shot-card .animation-bar {min-width:0;align-items:stretch!important;}
.shot-card .animation-bar > *,
.shot-card .animation-bar .play-btn,
.shot-card .animation-bar .round-btn,
.shot-card .animation-bar .speed-cycle-btn,
.shot-card .animation-bar .exclude-shot-btn {
  min-width:0!important;
  max-width:100%!important;
  height:auto!important;
  min-height:46px!important;
  max-height:none!important;
  padding:6px 3px!important;
  overflow-wrap:anywhere;
  white-space:normal!important;
  line-height:1.2!important;
}
.shot-card .animation-bar .play-btn {gap:4px!important;flex-wrap:wrap;}
.shot-card .animation-bar .round-btn,
.shot-card .animation-bar .speed-cycle-btn {font-size:clamp(10px,2.6vw,14px)!important;}
.shot-card .caromy-lesson-actions {grid-template-columns:repeat(2,minmax(0,1fr))!important;}
.shot-card .caromy-lesson-actions button,
.shot-card .caromy-lesson-actions .lesson-link-btn,
.shot-card .caromy-lesson-actions .caromy-shot-try-btn {
  height:auto!important;
  min-height:50px!important;
  max-height:none!important;
  padding:8px 6px!important;
  white-space:normal!important;
  overflow-wrap:anywhere;
  line-height:1.3!important;
  font-size:clamp(11px,3vw,15px)!important;
}
.shot-card-top {flex-wrap:wrap;}
.shot-card-top h3, .shot-card .shot-specs .caromy-spec-value,
.shot-card .shot-specs .caromy-spec-label {
  min-width:0;
  max-width:100%;
  white-space:normal!important;
  overflow-wrap:anywhere;
}
.shot-card-actions {flex:0 1 auto;max-width:100%;flex-wrap:wrap;}
.shot-card-actions button {min-width:0;flex:1 1 auto;}

/* Video filters, search, settings and dialogs. */
.lesson-channel-filters {min-width:0;}
.lesson-channel-filters button {min-width:0;flex:1 1 0;white-space:normal!important;padding:9px 3px;}
.lesson-search-form button {min-width:0;max-width:44%;padding:10px 8px;}
.lesson-social-links {min-width:0;}
.lesson-social-links a {min-width:0;overflow-wrap:anywhere;white-space:normal;}
.rotation-toolbar {flex-wrap:wrap;}
.rotation-toolbar > div {min-width:0;max-width:100%;flex-wrap:wrap;}
.rotation-toolbar > span {white-space:normal!important;overflow-wrap:anywhere;}
.rotation-toolbar button {height:auto!important;min-height:40px;padding:8px 7px;}
.setting-row {height:auto!important;min-height:58px;gap:8px;flex-wrap:wrap;padding:9px 2px;}
.setting-row > label, .setting-row > span {min-width:0;flex:1 1 42%;overflow-wrap:anywhere;}
#view-profile .setting-row select, #view-profile .setting-row input {max-width:min(100%,190px)!important;}
.guide-card, .busy-card, .caromy-v022-card, .caromy-thanks-card {
  max-width:100%;max-height:calc(100dvh - 32px);overflow-y:auto;
  overflow-wrap:anywhere;
}
.guide-actions button, .axis-choice-actions button,
.caromy-v022-actions button, .caromy-thanks-card button,
.caromy-teach-continue-actions button {
  width:100%;height:auto!important;min-height:46px;
  padding:9px 7px!important;
  white-space:normal!important;
  line-height:1.3!important;
}

/* Practice has fixed 2x2 rows and fixed 47 px buttons: let translated content set height. */
.practice-table-toolbar, .practice-table-toolbar .view-tools,
.practice-table-toolbar .zoom-tools {min-width:0;flex-wrap:wrap;}
.practice-table-toolbar button {
  height:auto!important;min-height:35px;
  padding:7px 5px!important;
  white-space:normal!important;
  overflow-wrap:anywhere;
}
.practice-four-grid {
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  grid-template-rows:minmax(110px,auto) minmax(190px,auto)!important;
}
.practice-four-grid .practice-tile {
  height:auto!important;min-height:0!important;
  overflow:visible!important;
}
.practice-tile-heading {height:auto!important;flex-wrap:wrap!important;align-items:flex-start;}
.practice-tile-heading .caromy-spec-label,
.practice-tile-heading .caromy-spec-value {
  min-width:0;max-width:100%;
  white-space:normal!important;
  overflow-wrap:anywhere;
  line-height:1.25!important;
}
.shoot-tile .practice-retry {
  grid-template-columns:minmax(0,1fr)!important;
  grid-template-rows:repeat(2,minmax(47px,auto))!important;
}
.shoot-tile .practice-retry button,
.shoot-tile .practice-shoot {
  height:auto!important;
  min-height:47px!important;
  max-height:none!important;
  padding:7px 5px!important;
  white-space:normal!important;
  overflow-wrap:anywhere;
  line-height:1.25!important;
}
.shoot-tile .practice-shoot {flex:0 0 auto!important;flex-wrap:wrap;gap:4px!important;}
.shoot-tile .practice-retry button {font-size:clamp(12px,3vw,15px)!important;}
.caromy-thanks-card strong,.caromy-thanks-card p {max-width:100%;overflow-wrap:anywhere;}

@media(max-width:360px){
  .capture-actions-three {gap:5px!important;}
  .shot-card .animation-bar {gap:4px!important;}
  .shot-card .animation-bar .play-btn {font-size:12px!important;}
  .practice-four-grid {grid-template-rows:minmax(110px,auto) minmax(196px,auto)!important;}
  .shot-card .caromy-lesson-actions button {font-size:11px!important;}
}
