/* General styles for routine items */
.routine-skill {
    cursor: grab;
    margin-bottom: 0.75rem;
    transition: transform 0.1s ease;
    position: relative; /* Needed for pseudo-elements like drag indicator */
    transition: all 0.3s ease; /* Smooth transitions */
    pointer-events: auto; /* Ensure the item itself is interactive */
}

/* Hover effect for routine items */
.routine-skill:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Style for validation messages within routine items */
.transition-status {
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

/* Style for indicating an item is being edited */
.routine-skill.editing {
    box-shadow: 0 0 0 2px #485fc7;
}

/* Minimum height for the routine builder container */
.routine-skills {
    min-height: 100px;
    transition: background-color 0.2s;
}

/* General column padding within a routine skill */
.routine-skill .columns {
    padding: 0.25rem;
}

/* Styling for individual columns within a routine skill */
.routine-skill .column {
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex; /* Use flex for alignment within columns */
    align-items: center; /* Vertically center content in columns */
}

/* --- Start Routine Button Fixes --- */

/* Button column: Push right, don't shrink, give slightly more width on tablet+ */

/* --- End Routine Button Fixes --- */

/* Toast notification styling (placed by .is-fixed-bottom-right) */
.notification.is-fixed-bottom-right {
    animation: slideIn 0.3s ease-out;
}

/* Slide-in animation for toast */
@keyframes slideIn {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* Consistent height for form fields */
.field .control, .field .checkbox {
    min-height: 1.25rem;
    display: flex;
    align-items: center;
}
.field .checkbox {
    margin-top: 0.5rem;
}

/* Label margin */
.field .label {
    margin-bottom: 0.5rem;
}

/* Consistent input/select height */
.input, .select select {
    height: 2.25em;
}

/* Checkbox margin */
.checkbox {
    margin-right: 1.5rem;
}

/* Styling for validation message area */
.validation-messages {
    border-top: 1px solid #eee;
    padding-top: 0.75rem;
    margin-top: 1rem;
}

/* Styling for individual validation messages */
.transition-status {
    margin-top: 0.25rem;
    font-size: 0.75rem;
}

/* Gradient text for multiple warnings (example) */
.has-text-danger.has-text-warning {
    background: linear-gradient(90deg, #ff3860 50%, #ffdd57 50%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Specific warning colors */
.has-text-danger {
    color: #ff3860 !important; /* Red for transitions */
}
.has-text-landing-warning {
    color: #ff69b4 !important; /* Pink for landings */
}
.has-text-tenth-warning {
    color: #ff851b !important; /* Orange for 10th skill */
}

/* Tariff difference subtitle */
.subtitle.tariff-difference {
    font-size: 0.9rem;
    color: #666;
}

/* Icon margin for warnings */
.has-text-warning .icon {
    margin-right: 0.5rem;
}

/* Dragging indicator text */
.routine-skill::after {
    content: "Drag to reorder";
    position: absolute;
    bottom: -20px; /* Position below the item */
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    color: #666;
    opacity: 0; /* Hidden by default */
    transition: opacity 0.3s ease;
    pointer-events: none; /* Prevent interference */
}

/* Ensure buttons inside draggable items remain clickable */
.routine-skill .buttons * {
    pointer-events: auto !important;
}

.routine-skills .routine-skill {
    margin-bottom: 0; border-radius: 0; border-left: 4px solid #ddd;
    cursor: grab; transition: border-left-color 0.3s ease, opacity 0.2s ease;
    -webkit-user-select: none; user-select: none;
}
.routine-skill.invalid-transition { border-left-color: #ff3860 !important; }
.routine-skill.invalid-landing { border-left-color: #ff69b4 !important; }
.routine-skill.duplicate-skill { border-left-color: #ffdd57 !important; }
.routine-skill-container.editing .routine-skill { box-shadow: 0 0 0 2px #485fc7 inset; }
.is-fixed-bottom-right { position: fixed; bottom: 1rem; right: 1rem; z-index: 1000; }
[x-cloak] { display: none !important; }

.routine-skill button, .routine-skill .delete { pointer-events: auto; }
.transition-status { font-size: 0.8rem; margin-top: 0.25rem; }
.routine-skills { min-height: 100px; transition: background-color 0.2s; border: 1px solid #dbdbdb; border-radius: 4px; padding: 0.5rem; }
/* A card's header: the name and FIG notation, then the button grid. */
.card-head { display: flex; justify-content: space-between; align-items: center; cursor: pointer; padding: 4px 0; }
.card-buttons { display: grid; grid-template-columns: 40px 45px; gap: 3px; flex-shrink: 0; }
.card-buttons .button { height: 24px; }
.card-buttons .card-text-button { font-size: 0.75rem; }

/* --- Side by side: a second routine beside the current one (both editable) --- */
.compare-with { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin: 0.5rem 0 0.75rem; }
.builder-columns.is-comparing { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.75rem; }
.builder-column { min-width: 0; }
.column-head { display: flex; justify-content: space-between; align-items: center; gap: 0.25rem; min-height: 2rem; margin-bottom: 0.25rem; }
.column-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.column-head .buttons { flex-wrap: nowrap; flex-shrink: 0; }
.column-head .buttons .button { margin-bottom: 0; padding-left: 0.6em; padding-right: 0.6em; }
/* Keep both columns' cards level: the link only the first column has is hidden. */
.is-comparing .requirement-picker .is-text { display: none; }
.is-comparing .requirement-picker .select, .is-comparing .requirement-picker .select select { width: 100%; max-width: 100%; }
.is-comparing .requirement-picker-row { flex-wrap: wrap; }
.routine-skill.differs { background-color: #fff6d9; }
.compare-difference { font-size: 0.9rem; color: #555; margin-top: -0.75rem; margin-bottom: 0.75rem; }
.compare-legend { font-size: 0.8rem; color: #777; margin-top: 0.5rem; }
.add-to { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.add-to-label { font-size: 0.85rem; font-weight: 600; }
.add-to .select, .add-to .select select { max-width: 16rem; }
.compare-tabs { display: none; }
@media screen and (max-width: 768px) {
  /* Phones show one routine at a time, chosen with the tabs, at full width. */
  .compare-tabs { display: block; margin-bottom: 0.75rem; }
  .compare-tabs a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
  .builder-columns.is-comparing { display: block; }
  .is-comparing.shows-b > .builder-column:first-child,
  .is-comparing:not(.shows-b) > .builder-column:last-child { display: none; }
  /* The tabs name the routines; the headings keep View (and ⇄ and ✕). */
  .is-comparing .column-head strong { display: none; }
  .is-comparing .column-head { justify-content: flex-end; }
  .is-comparing .requirement-picker .is-text { display: inline-flex; }
  /* In Levels mode a phone shows the open tab only: the level's tabs switch. */
  .is-levels .level-beside, .is-levels .compare-tabs { display: none !important; }
  .is-levels .level-tabs .tabs li.is-beside a { background: none; color: inherit; }
}

.subtitle.tariff-difference { font-size: 0.9rem; color: #666; }
.has-text-danger { color: #ff3860 !important; }
.has-text-landing-warning { color: #ff69b4 !important; }
.has-text-tenth-warning { color: #ff851b !important; }
.validation-messages { border-top: 1px solid #eee; padding-top: 0.75rem; margin-top: 1rem; }

/* --- Layout Styles --- */
.routine-skill { padding: 0.75rem; }
/* Name Block */
.skill-name-block { margin-bottom: 0.5rem; /* Space below this block */ }
.skill-name { font-size: 1rem; font-weight: 600; line-height: 1.2; }
/* Details/Buttons Row */
.skill-details-columns { align-items: center; /* Vertical alignment */ }
.skill-details-columns .column { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.skill-details-columns p { font-size: 0.85rem; white-space: nowrap; }
.skill-details-columns .buttons { margin-bottom: 0; } /* Remove button group margin */
/* Define the margin utility for tablet and up */
@media screen and (min-width: 769px) {

    /* Ensure detail columns take up space */
    .skill-details-columns .column:not(.is-narrow) {
        flex-basis: 0; /* Allow columns to grow */
        flex-grow: 1;  /* Allow columns to grow */
        min-width: 50px; /* Adjust as needed */
    }
}

.skill-validation-row { width: 100%; border-top: 1px solid #eee; margin-top: 0.5rem; padding-top: 0.5rem; }

/* --- Drag to reorder (SortableJS) --- */
/* The placeholder showing where the dragged card will land. */
.routine-skill-container.sortable-ghost .routine-skill { opacity: 0.4; }
.routine-skill-container.sortable-chosen .routine-skill { cursor: grabbing; }

/* Page header */
.hero.is-primary { background-color: #485fc7; }

/* Skills after an interruption (CoP §15.3) still show, but don't count. */
.routine-skill.not-counted { opacity: 0.55; }

/* Saved routines: the switcher above the routine. */
.routine-switcher { display: flex; flex-wrap: nowrap; align-items: center; gap: 0.4rem; margin-bottom: 1rem; }
/* The routine's name gives way so New, Share and More stay on the row. */
.routine-switcher > .select { flex: 0 1 auto; min-width: 0; }
.routine-switcher .select select { max-width: 14rem; width: 100%; text-overflow: ellipsis; }
.routine-switcher > .button, .routine-switcher > details { flex-shrink: 0; }
/* On a phone the routine (and level) choice gets its own row; the rest wrap below it. */
@media screen and (max-width: 768px) {
    .routine-switcher { flex-wrap: wrap; }
    .routine-switcher > .select:first-child { flex: 1 1 100%; }
    .routine-switcher > .select:first-child select { max-width: none; }
}
.routine-menu { position: relative; }
.routine-menu > summary { list-style: none; display: inline-flex; box-sizing: border-box; margin-bottom: 0; }
.routine-menu > summary::-webkit-details-marker { display: none; }
.routine-menu-panel {
    position: absolute; top: calc(100% + 0.3rem); right: 0; z-index: 20; display: flex; flex-direction: column; align-items: stretch;
    min-width: 10rem; background: #fff; border: 1px solid #ddd; border-radius: 6px; padding: 0.3rem; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}
.routine-menu-panel .button { justify-content: flex-start; }

/* Requirements: choosing a set, and the checklist under the totals. */
.requirement-picker { margin-bottom: 1rem; }
.requirement-picker-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.requirement-picker .select select { max-width: 18rem; }
.requirements-title { font-weight: 700; margin-bottom: 0.5rem; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.requirements-list li { display: flex; gap: 0.5rem; padding: 0.3rem 0; border-top: 1px solid #f0f0f0; }
.requirement-mark { font-weight: 700; width: 1.2rem; flex-shrink: 0; }
.is-met .requirement-mark { color: #257953; }
.is-unmet .requirement-mark { color: #cc0f35; }
.requirement-detail { display: block; color: #777; font-size: 0.8rem; }
/* Routines | Levels, and the Levels mode: the level's tabs sit on its columns. */
.builder-mode { margin-bottom: 0.75rem !important; }
.levels-bar .routine-switcher { flex-wrap: wrap; }
.level-tabs { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0.5rem; margin-top: 0.75rem; margin-bottom: 0.75rem; border-bottom: 1px solid #dbdbdb; }
.level-tabs .tabs { flex: 1 1 auto; min-width: 0; }
.level-tabs .tabs ul { flex-wrap: wrap; border-bottom: none; }
.level-tabs .tabs a { gap: 0.3rem; font-weight: 600; }
.level-tabs .tabs li.is-active a { color: #485fc7; }
.level-tabs .tabs li.is-beside a { color: #485fc7; background: #f5f7ff; }
.level-beside { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; }
.tab-chosen { font-size: 0.55rem; color: #485fc7; }
.level-column-head { margin-bottom: 0.6rem; }
.level-column-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem; margin-bottom: 0.35rem; }
.level-column-requirements { font-size: 0.8rem; color: #777; }
.level-column-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.level-column-note { font-size: 0.85rem; color: #777; }
.level-empty { padding: 1rem 0; }
.routine-skills.is-read-only .routine-skill { background: #fafafa; }
.level-check { padding: 0.5rem 0.75rem; border-left: 3px solid #485fc7; background: #f5f7ff; }
.level-check p + p { margin-top: 0.15rem; }
/* Level editor: the structure first, as cards to pick from. */
.level-structure { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0.5rem; border: none; padding: 0; margin-bottom: 1rem; }
.level-structure legend { grid-column: 1 / -1; margin-bottom: 0.25rem; }
.level-structure-choice { display: flex; gap: 0.5rem; align-items: flex-start; padding: 0.6rem 0.75rem; border: 1px solid #dbdbdb; border-radius: 6px; cursor: pointer; }
.level-structure-choice.is-selected { border-color: #485fc7; background: #f5f7ff; }
.level-structure-choice input { margin-top: 0.25rem; }
.level-structure-choice span { display: flex; flex-direction: column; }
.level-option-label { font-size: 0.85rem; font-weight: 600; min-width: 4rem; }
.level-details { margin: 0.5rem 0 1rem; font-size: 0.9rem; }
.level-details > summary { cursor: pointer; color: #485fc7; margin-bottom: 0.5rem; }
/* Requirements page: making a set routine from a routine already built. */
.set-routine-from { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.set-routine-from .input { max-width: 14rem; }
.set-routine-elements { margin: 0.25rem 0 0 1.5rem; font-size: 0.9rem; }
.level-option { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.level-option .select { min-width: 0; }
.level-option .select select { max-width: 26rem; }
.level-exercises { font-size: 0.85rem; color: #555; margin: 0.15rem 0; }

/* --- Add a skill (views.SkillFormView) --- */
/* The editor's own box would limit how far the sticky skill card can follow the
   page, so let its children lay out in the form instead. */
#skill-editor { display: contents; }

/* Skill picker: category tabs and big skill buttons. */
.picker { margin-bottom: 1rem; }
.picker-tabs { display: flex; gap: 0.4rem; overflow-x: auto; padding-bottom: 0.4rem; scrollbar-width: thin; }
.picker-tab { flex-shrink: 0; padding: 0.35rem 0.85rem; border: 1px solid #dbdbdb; border-radius: 999px; background: #fff; font: inherit; font-size: 0.9rem; cursor: pointer; white-space: nowrap; }
.picker-tab.is-active { background: #485fc7; border-color: #485fc7; color: #fff; }
.picker-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; margin-top: 0.5rem; }
@media screen and (min-width: 769px) { .picker-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.picker-skill { display: flex; flex-direction: column; justify-content: center; border: 1px solid #dbdbdb; border-radius: 8px; background: #fafafa; overflow: hidden; }
.picker-skill:hover { border-color: #485fc7; }
/* The box's main button (the usual shape) and, under it, a button per shape. */
.picker-skill-main { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; min-height: 3rem; padding: 0.5rem 0.75rem; width: 100%; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.picker-shapes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid #e5e5e5; }
.picker-shape { border: 0; border-left: 1px solid #e5e5e5; background: #fff; padding: 0.4rem 0.1rem; font: inherit; font-size: 0.8rem; color: #444; cursor: pointer; min-height: 2.25rem; }
.picker-shape:first-child { border-left: 0; }
.picker-shape:hover { background: #eef1fb; }
.picker-shape { display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; }
.picker-shape-modifier { font-size: 0.7rem; color: #485fc7; font-weight: 700; }
.picker-shape-modifier:empty { display: none; }
.picker-shape.is-selected { background: #485fc7; color: #fff; font-weight: 600; }
.picker-shape.is-selected .picker-shape-modifier { color: #fff; }
/* A group of related skills takes a whole row, its options in a grid. */
.picker-group { grid-column: 1 / -1; border: 1px solid #dbdbdb; border-radius: 8px; background: #fafafa; padding: 0.5rem; }
.picker-group-title { font-size: 0.8rem; font-weight: 700; color: #555; text-transform: uppercase; letter-spacing: 0.03em; margin: 0 0.25rem 0.4rem; }
.picker-group-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.35rem; }
@media screen and (min-width: 769px) { .picker-group-options { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.picker-option { display: flex; justify-content: space-between; align-items: center; gap: 0.35rem; min-height: 2.5rem; padding: 0.35rem 0.6rem; border: 1px solid #e3e3e3; border-radius: 6px; background: #fff; font: inherit; text-align: left; cursor: pointer; }
.picker-option .picker-skill-name { font-size: 0.9rem; }
.picker-option:hover { border-color: #485fc7; }
.picker-option.is-picked { border: 2px solid #485fc7; background: #eef1fb; }
.picker-skill.is-picked { border: 2px solid #485fc7; background: #eef1fb; }
.picker-skill-name { font-weight: 600; line-height: 1.2; }
.picker-skill-tariff { color: #485fc7; font-weight: 700; }
.picker-skill-name, .picker-skill-meta { display: block; }
.picker-skill-meta { color: #666; font-size: 0.8rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.picker .input[type="search"] { margin-bottom: 0.6rem; }
.picker-hint { color: #777; font-size: 0.85rem; margin-top: 0.5rem; }

/* Button-style choices (shape, direction, takeoff): radios styled as a segmented control. */
.segmented { display: inline-flex; flex-wrap: wrap; border: 1px solid #dbdbdb; border-radius: 6px; overflow: hidden; }
.segment { position: relative; padding: 0.4rem 0.8rem; cursor: pointer; font-size: 0.9rem; background: #fff; border-left: 1px solid #dbdbdb; user-select: none; }
.segment:first-child { border-left: 0; }
.segment input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segment.is-selected, .segment:has(input:checked) { background: #485fc7; color: #fff; }
.segment:has(input:focus-visible) { outline: 2px solid #485fc7; outline-offset: 2px; }

/* Number with − and + buttons. */
.stepper { display: inline-flex; align-items: center; gap: 0.25rem; }
.stepper .input, .stepper .button { height: 2.25rem; }
.stepper .input { width: 3.25rem; padding: 0 0.25rem; text-align: center; }
.stepper .button { width: 2.5rem; padding: 0; font-size: 1.1rem; }

.skill-builder { border: 1px solid #eee; border-radius: 6px; padding: 0.5rem 0.75rem; margin-bottom: 1rem; }
.skill-builder > summary { cursor: pointer; font-weight: 600; }
.builder-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin-top: 0.75rem; }
.builder-label { min-width: 8.5rem; font-weight: 600; font-size: 0.9rem; }
.builder-readout { color: #555; font-size: 0.9rem; }

/* The skill card: what Add will add. */
.skill-card { border: 2px solid #485fc7; border-radius: 8px; padding: 0.5rem 0.75rem; background: #fff; }
.skill-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.skill-card-name { font-size: 1.05rem; font-weight: 700; line-height: 1.2; }
.skill-card-meta { color: #555; font-size: 0.85rem; margin-top: 0.1rem; }
.skill-card-fig { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.skill-card-tariff { font-size: 1.35rem; font-weight: 700; color: #485fc7; line-height: 1; }
.skill-card-problem { color: #cc0f35; font-size: 0.85rem; margin-top: 0.5rem; }
.skill-card-note { color: #777; font-size: 0.85rem; margin-top: 0.5rem; }
/* Shape buttons and Add (or Update / Cancel) share a row; Add takes what's left. */
.skill-card-actions { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0.5rem; margin-top: 0.5rem; }
.skill-card-actions .add-to { flex-basis: 100%; margin-bottom: 0; order: -1; } /* above the shapes, which share a row with Add */
.skill-card-actions #add-btn { flex: 1 1 6.5rem; min-width: 0; width: auto; height: auto; min-height: 2.5rem; padding: 0.3rem 0.5rem; white-space: normal; line-height: 1.15; }
.skill-card-actions .segment { padding: 0.35rem 0.6rem; }
/* On wider screens the card is laid out as it was before it went compact:
   shapes under the name, then the label, then Add to and a full-width Add.
   Phones keep the compact card (shapes and Add on one row). */
@media screen and (min-width: 769px) {
    .skill-card { display: flex; flex-direction: column; padding: 0.75rem 1rem; }
    .skill-card-name { font-size: 1.2rem; }
    .skill-card-meta { font-size: 0.9rem; margin-top: 0.15rem; }
    .skill-card-tariff { font-size: 1.6rem; }
    .skill-card-actions { display: contents; }
    .skill-card .segmented { order: 1; align-self: flex-start; margin-top: 0.6rem; }
    .skill-card-actions .segment { padding: 0.4rem 0.8rem; }
    .skill-card-label { order: 2; margin: 0.6rem 0; font-size: 0.9rem; }
    .skill-card-actions .add-to { order: 3; margin-bottom: 0.5rem; }
    .skill-card-actions #add-btn { order: 4; flex: none; width: 100%; min-height: 2.5rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .skill-card-buttons { order: 4; justify-content: flex-start; }
}
.skill-card-buttons { flex: 1 1 auto; justify-content: flex-end; margin-bottom: 0 !important; }
.skill-card-buttons .button { margin-bottom: 0 !important; }
/* A shape's difference from the chosen one sits under its name. */
.shape-segment { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; }
.segment-modifier { font-size: 0.7rem; font-weight: 700; color: #485fc7; }
.skill-card-label { margin: 0.35rem 0 0; font-size: 0.85rem; }
.skill-card-label > summary { cursor: pointer; color: #485fc7; }
.skill-card-label .input { margin-top: 0.4rem; }


/* --- Compare page (views.ComparePage) --- */
.compare-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 1rem; }
.compare-table td { vertical-align: top; }
.compare-num { width: 2rem; color: #777; }
.compare-table tr.differs td:not(.compare-num) { background: #fff8e1; }
.compare-name, .compare-label, .compare-meta, .compare-note { display: block; }
.compare-name { font-weight: 600; }
.compare-label, .compare-note { color: #777; font-size: 0.8rem; }
.compare-meta { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8rem; color: #555; }
.compare-table td.not-counted .compare-name, .compare-table td.not-counted .compare-meta { color: #999; }
.compare-empty { color: #bbb; }
.compare-total { font-weight: 700; font-size: 1.2rem; color: #485fc7; }
.compare-summary { font-weight: 600; }
.compare-issues { font-size: 0.85rem; color: #8a2a00; padding-left: 1.1rem; list-style: disc; }

/* --- Requirement sets page and editor (views.RequirementsPage, views.SetEditor) --- */
.box-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
/* Keeps Save in reach while scrolling a long set. */
.editor-head { position: sticky; top: 0; z-index: 5; background: #fff; padding: 0.5rem 0; margin-top: -0.5rem; }
.set-list { margin: 0; }
.set-item { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; padding: 0.6rem 0; border-top: 1px solid #f0f0f0; }
.set-name { font-weight: 600; }
.set-meta { color: #777; font-size: 0.8rem; }
.set-rules { font-size: 0.85rem; margin-top: 0.3rem; }
.set-description { font-size: 0.85rem; color: #555; }
.builtin-group { border-top: 1px solid #f0f0f0; }
.builtin-group > summary { cursor: pointer; font-weight: 600; padding: 0.6rem 0; }
.builtin-group[open] > summary { color: #485fc7; }
.set-rules summary { cursor: pointer; color: #485fc7; }
.set-rules ul { list-style: disc; padding-left: 1.2rem; margin-top: 0.3rem; }
.set-rules ol { list-style: decimal; padding-left: 1.4rem; margin-top: 0.3rem; }
.import-panel { margin-bottom: 1rem; }
.rule-card { border: 1px solid #e3e3e3; border-radius: 8px; padding: 0.75rem; margin-bottom: 0.75rem; background: #fcfcfc; }
.rule-card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 0.5rem; margin-bottom: 0.5rem; }
/* A long title takes the whole row and the buttons wrap below it. */
.rule-card-title { font-weight: 600; flex: 1 1 14rem; }
.rule-card-head .buttons { flex-wrap: nowrap; flex-shrink: 0; }
.rule-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 0.75rem; }
.rule-grid.rule-kind { grid-template-columns: minmax(0, 1fr); }
.rule-grid { align-items: end; }
.rule-grid > .field { margin-bottom: 0.5rem; }
@media screen and (min-width: 769px) {
  .rule-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .rule-grid.rule-kind { grid-template-columns: 1fr 2fr; }
}
.matcher { border: 1px dashed #ddd; border-radius: 6px; padding: 0.5rem 0.75rem; margin: 0.25rem 0 0.5rem; }
.matcher legend { font-size: 0.85rem; font-weight: 600; padding: 0 0.25rem; }
.option-group { border: 1px solid #dbe0f5; border-radius: 8px; padding: 0.5rem 0.75rem; margin-bottom: 0.75rem; background: #f8f9fe; }
.option-group > legend { font-weight: 600; font-size: 0.9rem; padding: 0 0.25rem; }
/* Content inside <details> sits in a slot that resets box-sizing to content-box,
   making Bulma inputs wider than their column; restore Bulma's border-box. */
details > * { box-sizing: border-box; }
/* Fieldsets default to min-width: min-content, which lets nested grids overflow. */
.matcher, .option-group { min-width: 0; }
@media screen and (max-width: 768px) {
  .option-group, .option-group .matcher { padding-left: 0.5rem; padding-right: 0.5rem; }
}
.matcher-summary { font-weight: 400; color: #555; }
.matcher-choices { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.matcher-choices .label { flex-basis: 100%; margin: 0; }
/* Each choice is a pill big enough to tap. */
.matcher-choices .checkbox { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.3rem 0.7rem; border: 1px solid #dbdbdb; border-radius: 999px; font-size: 0.85rem; background: #fff; margin: 0; }
.matcher-choices .checkbox:has(input:checked) { border-color: #485fc7; background: #eff1fa; color: #3850b7; font-weight: 600; }
.matcher-more { margin: 0.25rem 0 0.5rem; }
.matcher-more > summary { cursor: pointer; color: #485fc7; font-size: 0.85rem; padding: 0.35rem 0; }
.matcher-hint { color: #888; font-size: 0.75rem; }
.set-problems ul { list-style: disc; padding-left: 1.2rem; }

/* --- Phones --- */
@media screen and (max-width: 768px) {
    /* Reclaim width from the nested boxes and a shorter header. */
    .section { padding: 1.25rem 0.75rem; }
    .hero-body { padding: 1.25rem 1rem; }
    .hero .title { font-size: 1.5rem; }
    .hero .subtitle { font-size: 1rem; }
    .box { padding: 1rem; }
    .routine-skills { padding: 0.25rem; }
    .routine-skills .routine-skill { padding: 0.75rem; }

    /* Card details sit two per row (see views.skillCard). */
    .skill-details-columns .column { padding: 0.15rem 0.5rem; }
    .skill-details-columns p { white-space: normal; }

    .is-fixed-bottom-right { left: 1rem; }

    /* Keep the skill card (and its Add button) on screen while choosing and adjusting,
       but not while typing elsewhere: with the keyboard up it would cover the field. */
    .skill-card { position: sticky; bottom: 0.5rem; z-index: 5; box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.12); }
    #main-form:has(input:focus:not(#custom-name)) .skill-card { position: static; box-shadow: none; }
    .builder-label { min-width: 100%; }
}

/* --- Loading a set routine: new routine or replace --- */
.set-routine-dialog { width: calc(100% - 2rem); max-width: 26rem; margin: 0 auto; border-radius: 10px; }
.set-routine-dialog .modal-card-body { border-radius: 10px; }
.set-routine-choices { display: flex; flex-direction: column; gap: 0.5rem; }
.set-routine-choices .button { white-space: normal; height: auto; min-height: 2.5em; }

/* --- Which checks apply to a routine (set routines turn some off) --- */
.routine-checks { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1rem; border-top: 1px solid #eee; margin-top: 0.75rem; padding-top: 0.6rem; font-size: 0.9rem; }
.routine-checks-label { font-weight: 600; color: #555; }
.routine-checks .checkbox { display: inline-flex; align-items: center; gap: 0.35rem; }
.set-scoring { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 1rem; }
.set-scoring .matcher-hint { flex-basis: 100%; margin: 0; }
.scored-elements { display: inline-flex; align-items: center; gap: 0.35rem; }
/* Whether an element scores, when only some do; the coach can tick to choose. */
.scores-toggle { display: inline-flex; align-items: center; gap: 0.25rem; margin-left: 0.4rem; padding: 0.05rem 0.45rem; border: 1px solid #dbdbdb; border-radius: 999px; font-size: 0.72rem; color: #666; background: #fff; cursor: pointer; vertical-align: middle; }
.scores-toggle.is-scoring { border-color: #485fc7; background: #eef1fb; color: #3850b7; font-weight: 600; }
.scores-toggle input { margin: 0; }
.scored-input { width: 4.5rem; }

/* --- Share links (static/js/share.js) --- */
.share-modal .modal-card { width: calc(100% - 2rem); max-width: 28rem; margin: 0 auto; border-radius: 10px; }
.share-modal .modal-card-body { border-radius: 10px; max-height: calc(100vh - 3rem); overflow-y: auto; }
.share-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.share-intro { font-size: 0.9rem; color: #555; margin-bottom: 0.6rem; }
.share-choices { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 0.75rem; max-height: 14rem; overflow-y: auto; }
.share-choice { display: flex; align-items: flex-start; gap: 0.5rem; padding: 0.45rem 0.6rem; border: 1px solid #e3e3e3; border-radius: 6px; }
.share-choice:has(input:checked) { border-color: #485fc7; background: #eef1fb; }
.share-choice input { margin-top: 0.25rem; }
.share-choice-name { display: block; font-weight: 600; }
.share-choice-detail { display: block; font-size: 0.8rem; color: #666; }
.share-buttons { margin-bottom: 0.5rem !important; }
.share-link { font-size: 0.75rem; color: #555; }
.share-status { font-size: 0.8rem; color: #666; margin-top: 0.35rem; }
.share-qr { display: flex; justify-content: center; margin-top: 0.75rem; }
.share-qr svg { width: min(14rem, 70vw); height: auto; }
.share-note { text-align: center; font-size: 0.8rem; color: #777; margin-top: 0.25rem; }
