/* Only the mobile line editor; existing desktop styles are retained. */
@media (max-width:767px) {
 body:has(#lineeditor) {margin:0;padding:8px;box-sizing:border-box;min-width:0;font-size:14px;}
 #lineeditor {width:100%;max-width:100%;min-width:0;box-sizing:border-box;font-size:14px;}
 #lineeditor .pagewrapper {display:flex;flex-direction:column;overflow:visible;min-width:0;}
 #lineeditor .pagewrapper > form {order:1;width:100%;min-width:0;}
 #lineeditor .playerlist {order:0;float:none !important;width:100% !important;margin:8px 0 16px;padding:8px;border:1px solid #a8b3c3;border-radius:8px;box-sizing:border-box;background:#fff;position:sticky;top:0;z-index:5;}
 #lineeditor .playerlist::before {content:'Select a player, then tap a line slot';display:block;font-size:14px;font-weight:bold;margin-bottom:8px;color:#151e2d;}
 #lineeditor .playerselect {max-height:160px;overflow-y:auto;padding:0;font-size:14px;}
 #lineeditor .playerselect li {font-size:14px;position:relative;}
 #lineeditor .playerselect label {display:block;font-size:14px !important;min-height:44px;padding:10px 8px !important;line-height:1.5;box-sizing:border-box;cursor:pointer;}
 #lineeditor .playerselect input[type=radio] {position:absolute;left:8px;top:8px;margin:0;}
 #lineeditor .playerselect input:checked + label {background:#151e2d;color:#fff;font-size:14px !important;border-radius:4px;}
 #lineeditor .smalllist {font-size:13px !important;}
 #lineeditor .positionlist {display:flex;flex-wrap:wrap;align-items:center;gap:6px;font-size:14px;}
 #lineeditor .positionlist label {font-size:14px !important;margin:0 8px 0 0;}
 #lineeditor .positionlist input[type=checkbox] {width:20px;height:20px;margin:0;}
 #lineeditor .linetabs {float:none !important;width:100% !important;min-width:0;}
 #lineeditor #tabs {padding:0;min-width:0;}
 #lineeditor #tabs ul.positiontabs {display:flex;flex-wrap:wrap;gap:4px;padding:4px 0 !important;}
 #lineeditor #tabs ul.positiontabs li {float:none;margin:0 !important;font-size:14px !important;}
 #lineeditor #tabs ul.positiontabs li a {font-size:14px !important;min-height:44px;display:flex;align-items:center;box-sizing:border-box;padding:8px 12px !important;background-image:none;border-radius:4px;}
 #lineeditor #tabs ul.positiontabs li.ui-tabs-active a {background:#151e2d;color:#fff;}
 #lineeditor #tabs .ui-tabs-panel {padding:12px 0;}
 #lineeditor #tabs .linesection {float:none !important;width:100% !important;height:auto !important;min-height:0 !important;margin:0 0 14px !important;padding:10px;box-sizing:border-box;border-radius:8px;}
 #lineeditor .linesection h4 {font-size:16px !important;padding:10px;margin-bottom:10px !important;color:#151e2d;}
 #lineeditor .blockcontainer {padding:0;}
 #lineeditor .positionwrapper {float:none !important;width:100% !important;font-size:14px !important;}
 #lineeditor .positionline {display:flex;align-items:center;gap:8px;padding:4px 0;}
 #lineeditor .positionlabel {float:none;width:34px;flex:0 0 34px;font-size:14px;font-weight:bold;}
 #lineeditor .positionname {float:none;width:auto;flex:1;min-width:0;}
 #lineeditor #tabs .linesection input.textname {width:100% !important;height:44px;font-size:16px !important;padding:8px !important;box-sizing:border-box;border:1px solid #a8b3c3;background:#fff;border-radius:4px;color:#151e2d;cursor:pointer;}
 #lineeditor .textname:focus {outline:2px solid #236192;outline-offset:2px;}
 #lineeditor .linetabs .sliders {float:none !important;position:static !important;width:100% !important;box-sizing:border-box;margin-top:10px;padding:8px;font-size:14px !important;}
 #lineeditor .strategywrapper,#lineeditor .timewrapper {overflow:visible;}
 #lineeditor .strats {display:flex;align-items:center;justify-content:space-between;float:none;min-height:44px;font-size:14px;}
 #lineeditor .stratlabel,#lineeditor .timelabel {font-size:14px;float:none;}
 #lineeditor .stratvalue,#lineeditor .timevalue {display:flex;align-items:center;gap:6px;float:none;width:auto !important;}
 #lineeditor .time {display:flex;align-items:center;justify-content:space-between;}
 #lineeditor input[type=text]:not(.textname) {font-size:16px !important;min-height:36px;min-width:48px;box-sizing:border-box;}
 #lineeditor input.updown {width:36px !important;height:36px !important;min-width:36px;background-size:14px;border:1px solid #c6c6c6;border-radius:4px;margin:0;}
 #lineeditor .strategieswrapper,#lineeditor .strategieswrapper input,#lineeditor .teamstrategy {font-size:14px !important;}
 #lineeditor .strategyamount,#lineeditor .strategystrategies {float:none;width:100%;padding:8px;box-sizing:border-box;}
 #lineeditor .Save {float:none;display:flex;flex-wrap:wrap;gap:8px;margin:8px 0;}
 #lineeditor .Save input {min-height:44px;font-size:14px;padding:8px 12px;}
 #lineeditor #linesubmit {background:#151e2d;color:#fff;border:1px solid #151e2d;border-radius:4px;}
 #lineeditor h3.withsave {font-size:16px;clear:both;}
}
/* The action buttons precede the player picker on mobile. */
@media (max-width:767px) {
 #lineeditor .pagewrapper {display:grid;grid-template-columns:minmax(0,1fr);}
 #lineeditor .pagewrapper > form#submissionform {display:contents;}
 #lineeditor .pagewrapper > form#submissionform > .Save {grid-row:1;grid-column:1;display:flex;gap:10px;flex-wrap:wrap;float:none;width:100%;margin:8px 0 12px;}
 #lineeditor .pagewrapper > .playerlist {grid-row:2;grid-column:1;max-width:100%;margin:0 0 16px;}
 #lineeditor .pagewrapper > form#submissionform > h3.withsave {grid-row:3;grid-column:1;}
 #lineeditor .pagewrapper > form#submissionform > .confirm {grid-row:4;grid-column:1;}
 #lineeditor .pagewrapper > form#submissionform > #errors {grid-row:5;grid-column:1;}
 #lineeditor .pagewrapper > form#submissionform > .linetabs {grid-row:6;grid-column:1;}
 #lineeditor .Save input {flex:1 1 140px;min-width:140px;min-height:48px;text-align:center !important;font-size:16px !important;padding:10px 16px !important;box-sizing:border-box;}
 #lineeditor .playerselect {max-height:240px;}
}
.lhgmq-editor-return {margin:12px 0;}
.lhgmq-editor-return a {display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:0 16px;border:1px solid #151e2d;border-radius:6px;background:#151e2d;color:#fff;text-decoration:none;font:600 14px Arial,sans-serif;box-sizing:border-box;}
.lhgmq-editor-return a:hover {background:#26354b;}
.lhgmq-editor-return a:focus-visible {outline:2px solid #236192;outline-offset:3px;}
.lhgmq-editor-return {display:flex;flex-wrap:wrap;gap:8px;}

/* Three navigation buttons remain on a single row. */
.lhgmq-editor-return {display:flex;flex-wrap:nowrap;gap:6px;min-width:0;}
@media (max-width:767px) {
 .lhgmq-editor-return a {flex:1 1 0;min-width:0;min-height:44px;padding:0 4px;font-size:12px;white-space:nowrap;text-align:center;}
}
