/* v14.14.4 — navigation, mobile form width, adaptive periods, physical rotation */
.unified-logged .log-nav.unified-log-subtabs{
  display:flex!important;flex-wrap:nowrap!important;gap:0!important;overflow-x:auto!important;
  max-width:100%;border-bottom:1px solid var(--line);margin:4px 0 16px;
  scrollbar-width:none;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;
}
.unified-logged .log-nav.unified-log-subtabs::-webkit-scrollbar{display:none}
.unified-logged .log-nav.unified-log-subtabs button{
 flex:0 0 auto!important;width:auto!important;min-height:45px!important;padding:10px 14px!important;
 border:0!important;border-bottom:3px solid transparent!important;border-radius:0!important;
 background:transparent!important;color:var(--muted)!important;box-shadow:none!important;
 font-weight:650!important;font-size:14px!important;white-space:nowrap!important;
}
.unified-logged .log-nav.unified-log-subtabs button[aria-current="page"]{
 color:var(--indigo)!important;border-bottom-color:var(--indigo)!important;font-weight:800!important;
}
.unified-logged .log-nav.unified-log-subtabs button:focus-visible{outline:2px solid var(--indigo);outline-offset:-2px}
/* Tab selectors are navigation. The form submit remains the real primary button. */
.unified-account-shell .account-panel .account-mode-tabs{
 display:flex;flex-wrap:nowrap;gap:0;align-items:stretch;margin:13px 0 19px;
 border-bottom:1px solid var(--line);max-width:100%;
}
.unified-account-shell .account-panel .account-mode-tabs button,
.unified-account-shell .account-panel .account-mode-tabs button.secondary{
 flex:1 1 0;min-width:0;border:0!important;border-bottom:3px solid transparent!important;
 border-radius:0!important;background:transparent!important;box-shadow:none!important;
 color:var(--muted)!important;font-size:15px;font-weight:650;
 margin:0!important;padding:14px 8px!important;
}
.unified-account-shell .account-panel .account-mode-tabs button.active,
.unified-account-shell .account-panel .account-mode-tabs button[aria-selected="true"]{
 border-bottom-color:var(--indigo)!important;color:var(--indigo)!important;font-weight:800!important;
}
.unified-account-shell .account-panel #emailForm #sendCode{display:block;width:100%;min-height:49px;margin:16px 0 8px;border-radius:12px;font-size:16px;background:var(--indigo);color:white}
/* Dialogs must never shift sideways on mobile; vertical scroll and zoom remain available. */
#logModal{
 box-sizing:border-box!important;width:min(520px,calc(100vw - 24px))!important;
 max-width:calc(100vw - 24px)!important;overflow-x:hidden!important;overflow-y:auto!important;
 overscroll-behavior-x:none;touch-action:pan-y pinch-zoom;
}
#logModal .log-form,#logModal .template-option,#logModal .modal-header,
#logModal .log-form-grid,#logModal .log-form-actions{min-width:0;max-width:100%;box-sizing:border-box}
#logModal .log-form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
#logModal .log-form label,#logModal .log-form input:not([type=checkbox]):not([type=radio]),
#logModal .log-form select{min-width:0;max-width:100%;box-sizing:border-box}
#logModal .log-form-actions{flex-wrap:wrap}
#logModal .log-form-actions button{min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere}
@media(max-width:520px){#logModal .log-form-grid{grid-template-columns:minmax(0,1fr)}#logModal{padding:16px!important}}
/* Adaptive period control: exact date for Day; labelled range for Week, month/year for other periods. */
.unified-logged .log-date.log-period-date .period-picker-label{
 width:100%!important;min-width:0!important;max-width:100%!important;display:flex;flex-direction:column;gap:5px;
 font-size:.85rem;font-weight:700;color:var(--log-muted);text-align:center;
}
.unified-logged .log-date.log-period-date .period-picker-trigger{
 width:100%!important;min-width:0!important;min-height:44px!important;padding:8px 8px!important;
 border:1px solid #cbd6e7!important;border-radius:11px!important;
 background:#fff!important;color:var(--text)!important;font:600 14px Inter,system-ui,sans-serif!important;
 display:flex;align-items:center;justify-content:center;gap:6px;line-height:1.25;white-space:normal;text-align:center;
}
.unified-logged .log-date.log-period-date .period-picker-trigger span{color:var(--indigo)}
.period-picker-dialog{border:1px solid var(--line,#ddd);border-radius:18px;padding:19px;
 width:min(440px,calc(100vw - 24px));max-width:calc(100vw - 24px);max-height:85dvh;
 color:#29283e;background:white;box-shadow:0 22px 70px #17153155;overflow-y:auto;}
.period-picker-dialog::backdrop{background:#16142d80}
.period-picker-header{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:16px}
.period-picker-header strong{font-size:18px}
.period-picker-close{border:0;background:transparent;color:#4f4c7d;font-size:28px;padding:2px 9px}
.period-picker-selects{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin-bottom:16px}
.period-picker-selects label{display:grid;gap:5px;font-size:13px;font-weight:700;color:#6c6a85}
.period-picker-selects select{width:100%;min-width:0;font-size:16px;padding:9px;border:1px solid #d8d6e7;border-radius:9px;background:white;color:#27253d}
.period-picker-options{display:grid;gap:7px;max-height:55dvh;overflow:auto}
.period-picker-months{grid-template-columns:repeat(2,minmax(0,1fr))}
.period-picker-choice{width:100%;padding:12px;border:1px solid #d6d4e8;border-radius:10px;background:#f7f6fc;color:#3c3a62;font-weight:700;font-size:15px;text-align:center}
.period-picker-choice.current{background:#e7e5fb;border-color:#7771c6;color:#443bad}
/* Expanded graph rotates only while an actual touch device is in portrait.
   Never call screen.orientation.lock: it causes a second device rotation. */
#fullGraphDialog .full-graph-inner{position:relative;left:auto;top:auto;
 width:100%;height:100%;transform:none;transform-origin:center;}
@media (orientation:portrait) and (pointer:coarse){
 #fullGraphDialog{overflow:hidden}
 #fullGraphDialog .full-graph-inner{
  position:absolute;top:0;left:0;width:100dvh;height:100dvw;
  transform-origin:top left;transform:translateX(100dvw) rotate(90deg);
 }
}
