/* =====================================================================
   FLIQ Training-Hub · UI-Feinschliff (Buttons, Felder, Raster)
   Datei: assets/planiq-ui-refinement.css
   Als LETZTES Stylesheet einbinden (nach allen anderen assets/*.css).
   Nutzt nur vorhandene --fliq-* Tokens. Farben und Aufbau bleiben gleich.
   ===================================================================== */

:root {
  
  
  --fliq-control-pad-x: 12px;
  --fliq-control-font: var(--fliq-type-label-size, 14px);
  --fliq-focus-ring: 0 0 0 3px color-mix(in srgb, var(--fliq-focus, #151719) 18%, transparent);
}

/* ---------------------------------------------------------------------
   1) Global: alle Eingabefelder einheitlich
   --------------------------------------------------------------------- */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="file"]),
select,
textarea {
  font-family: var(--fliq-font-ui, Inter, Arial, sans-serif);
  box-sizing: border-box;
  max-width: 100%;
}


select {
  padding-right: 34px; /* Platz für den Pfeil, Text wird nicht abgeschnitten */
  text-overflow: ellipsis;
}

textarea {
  line-height: 1.4;
  resize: vertical;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: var(--fliq-focus-ring);
}

/* Felder füllen ihre Rasterzelle bzw. ihr Label immer ganz aus */
label > input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
label > textarea {
  width: 100%;
}

/* ---------------------------------------------------------------------
   2) Global: alle Buttons einheitlich (Höhe, Radius, Schrift)
   --------------------------------------------------------------------- */
.button,
.icon-button,
.calendar-add,
.calendar-range-menu,
.session-menu-button,
.library-tree-folder,
.library-tree-open,
.calendar-day-create {
  border-radius: var(--fliq-control-radius);
}

.button {
  padding-inline: 16px;
  white-space: nowrap;
}


/* Primärbutton nicht größer schreiben als die übrigen */

/* Icon-Buttons: immer quadratisch, Symbol mittig */
.icon-button,
.calendar-add,
.calendar-range-menu,
.session-menu-button {
  width: var(--fliq-control-height);
  min-width: var(--fliq-control-height);
  display: inline-grid;
  place-items: center;
}

.button:focus-visible,
.icon-button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--fliq-focus, #151719);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------------
   3) Session Builder: Kopfzeile (Titel … Track)
   Feste Pixelspalten -> anteilige Spalten, nichts wird abgeschnitten
   --------------------------------------------------------------------- */



/* ---------------------------------------------------------------------
   4) Session Builder: Trainingsablauf (links)
   "+ Block" und "+ Super-Set" nebeneinander statt untereinander
   --------------------------------------------------------------------- */

.planiq-builder .builder-phase > :not(.builder-add) {
  grid-column: 1 / -1;
}



.planiq-builder .builder-add:hover {
  border-style: solid;
  background: color-mix(in srgb, var(--fliq-surface, #fff) 55%, transparent);
}


/* ---------------------------------------------------------------------
   5) Session Builder: Block-Editor (rechts)
   Auswahlfelder füllen die Breite zweispaltig
   --------------------------------------------------------------------- */
.planiq-builder .builder-field-grid,
.planiq-builder .online-track-choice-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--fliq-space-12, 12px) var(--fliq-space-16, 16px);
  width: 100%;
}

.planiq-builder .builder-field-grid select,
.planiq-builder .online-track-choice-row select {
  width: 100%;
}

/* Dauer + "Wo und wie" auf einer Linie, Dauerfeld füllt seine Spalte */
.planiq-builder .builder-track-execution {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: var(--fliq-space-12, 12px) var(--fliq-space-16, 16px);
  align-items: start;
}

.planiq-builder .builder-track-execution input {
  width: 100%;
  padding: 0 var(--fliq-control-pad-x);
  border-radius: var(--fliq-control-radius);
}

.planiq-builder .builder-track-execution textarea {
  min-height: var(--fliq-control-height);
  border-radius: var(--fliq-control-radius);
}

.planiq-builder .builder-field-duration-hint {
  display: block;
  margin-top: 4px;
  font-size: var(--fliq-type-meta-size, 12px);
  line-height: var(--fliq-type-meta-line, 16px);
}

/* Blockaktionen als normaler Button statt Aufklapp-Dreieck */


.planiq-builder .builder-block-menu-title::after {
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}

.planiq-builder .builder-block-menu[open] > .builder-block-menu-title::after {
  transform: translateY(2px) rotate(-135deg);
}

/* Coach-Hinweise: gleiche Radien wie alle Felder */
.planiq-builder .builder-coach-disclosure > summary {
  border-radius: var(--fliq-control-radius);
}

/* ---------------------------------------------------------------------
   6) Session Builder: Fußzeile
   Gleich hohe Buttons, "Session speichern" ganz rechts
   --------------------------------------------------------------------- */




.planiq-builder .builder-footer .button.secondary { order: 1; }
.planiq-builder .builder-footer .button.primary   { order: 2; }

/* ---------------------------------------------------------------------
   7) Kalender-Sidebar: Suchfeld auf Standardhöhe
   --------------------------------------------------------------------- */

/* ---------------------------------------------------------------------
   8) Responsive
   --------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .planiq-builder .builder-meta > .builder-title-field {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .planiq-builder .builder-field-grid,
  .planiq-builder .online-track-choice-row,
  .planiq-builder .builder-track-execution {
    grid-template-columns: minmax(0, 1fr);
  }
  .planiq-builder .builder-footer .button {
    flex: 1 1 auto;
  }
  .planiq-builder .builder-footer .button.primary {
    order: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .planiq-builder .builder-block-menu-title::after { transition: none; }
}

/* Screenshot refinement, 20.10.2026. These scoped rules take precedence over
   the older builder width limits without changing markup or event handlers. */
@media screen {
  html:root body #onlinePlanDialog.planiq-builder {
     
     
  }
  html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm {  }
  html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm .dialog-heading {
    min-height:50px;  
  }
  html:root body #onlinePlanDialog.planiq-builder #onlinePlanDialogTitle {
    font-size:26px!important; 
  }
  html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm .builder-meta {
     
      align-items:start;
  }
  html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm .builder-title-field { grid-column:auto; max-width:none; }
  html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm label {
    min-width:0; font-size:16px!important; line-height:22px;
  }
  html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm label>span { font-size:16px!important; line-height:22px; }
  html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm :is(.builder-meta,.builder-block-settings,.builder-field-grid,.builder-track-route,.builder-track-execution)>label {
    grid-template-columns:minmax(0,1fr); width:100%; max-width:none;
  }
  html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm :is(.builder-meta,.builder-block-settings,.builder-field-grid,.builder-track-route,.builder-track-execution) :is(input:not([type=hidden]),select,textarea) {
    width:100%!important; max-width:none!important; min-width:0!important; box-sizing:border-box;
    line-height:24px!important; 
  }
  html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm .builder-workspace {
      align-items:start;
  }
  html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm .builder-workspace.builder-desktop:not(.builder-continuous) {
    grid-template-columns:minmax(280px,28.3%) minmax(0,1fr);
  }
  html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm .builder-outline {    }
  html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm .builder-outline>h3 {
      line-height:28px; 
  }
  html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm .builder-sequence-hint {
    line-height:22px;
  }
  html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm .builder-phase {
      
       
  }
  html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm .builder-phase+.builder-phase::before { content:none; }
  html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm .builder-phase>h4 {
       line-height:24px; 
  }
  html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm .builder-phase-summary {
    line-height:22px;
  }
  html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm .builder-phase:has(.builder-block-choice)>.builder-phase-summary { grid-row:1; align-self:center; }
  html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm .builder-block-choice {
     padding:12px!important; 
  }
  html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm .builder-add {
    display:flex; justify-content:center; align-items:center; width:100%; min-width:0;
    min-height:44px; padding:4px; border:1px dashed color-mix(in srgb,currentColor 30%,transparent);
    border-radius:10px; background:transparent; font-size:14px!important; line-height:20px; font-weight:600; text-align:center;
  }
  html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm .builder-editor {
      
  }
  html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm .builder-context { font-size:14px!important; line-height:20px; }
  html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm .builder-editor-title { font-size:28px!important; }
  html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm :is(.builder-field-grid,.builder-track-route) {
    grid-template-columns:repeat(2,minmax(0,1fr)); max-width:none; gap:12px 20px;
  }
  html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm :is(.builder-track-goal,.builder-track-route,.builder-track-execution) {
    margin:16px 0 0; padding:16px 0 0; border-top:1px solid var(--fliq-border-subtle); row-gap:12px;
  }
  html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm .builder-track-goal { margin-top:0; }
  html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm .builder-field-heading { font-size:16px; line-height:22px; font-weight:700; }
  html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm .builder-track-execution {
    grid-template-columns:176px minmax(0,1fr); column-gap:20px;
  }
  html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm .builder-track-execution textarea:not([hidden]) {
    height:96px!important; min-height:96px!important;
  }
  html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm .builder-field-duration-hint {
    margin:0; font-size:13px!important; line-height:18px;
  }
  html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm label:has(.builder-field-duration-hint:not([hidden]))>input {
    border-color:var(--fliq8-warning)!important;
  }
  html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm .builder-coach-disclosure { margin:24px 0 0; padding:0; }
  html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm .builder-coach-disclosure>summary {
    display:flex; align-items:center; min-height:60px; padding:16px 0; font-size:16px!important; line-height:24px; font-weight:600;
  }
  html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm .builder-coach-disclosure>summary::before {
    content:""; width:16px; height:16px; flex:none; margin-inline-end:10px; background:currentColor;
    mask:url("ci-8.1/icons/chevron-right.svg?v=163586f895bd") center/16px 16px no-repeat;
  }
  html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm .builder-coach-disclosure[open]>summary::before { transform:rotate(90deg); }
  html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm .builder-editor:has(.online-track-block>.builder-block-menu) { position:relative; }
  html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm .online-track-block:has(>.builder-block-menu) { position:static; }
  html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm .online-track-block>.builder-block-menu { top:24px!important; right:24px!important; }
  html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm .builder-block-menu-title { min-height:44px!important; padding:8px 14px!important; font-size:16px!important; line-height:24px; }
  html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm :is(.online-calculation-note,.calculation-note) { margin:16px 0 16px; font-size:16px!important; line-height:22px; font-weight:400; color:var(--fliq-text-secondary); }
  html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm .builder-footer {       }
  html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm .builder-duration-label { line-height:20px; }
  html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm .builder-duration-hint { line-height:20px; }
  @container builder-form (max-width:1100px) {
    html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm .builder-meta {  }
    html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm .builder-title-field { grid-column:1/-1; }
    html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm .builder-workspace.builder-desktop:not(.builder-continuous) { grid-template-columns:minmax(0,1fr); }
  }
  @container builder-form (max-width:700px) {
    html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm .builder-meta {  }
    html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm :is(.builder-block-settings,.builder-field-grid,.builder-track-route,.builder-track-execution) { grid-template-columns:minmax(0,1fr); }
    html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm .online-track-block>.builder-block-menu { position:static!important; margin:0 0 16px; }
  }
  @container builder-form (max-width:420px) {
    html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm .builder-meta {  }
    html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm .builder-add { font-size:13px!important; line-height:18px; min-height:44px; }
    html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm .builder-footer {  grid-template-columns:repeat(2,minmax(0,1fr)); }
    html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm .builder-footer>.button { padding-inline:8px; white-space:normal; }
    html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm .builder-footer>.button.primary { grid-column:1/-1; grid-row:2; }
  }
  @media(max-width:700px) {
    html:root body #onlinePlanDialog.planiq-builder {    }
    html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm {  }
    html:root body #onlinePlanDialog.planiq-builder #onlinePlanForm .builder-editor {  }
  }
}
