/* One-row header on a symmetric grid: [back, group] | Midiary exactly in the middle | profile.
   The side columns are equal, so the way home never moves with the length of a name or a group. */
#midiary-design .fd-telegram.fd-telegram{display:grid!important;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr)!important;align-items:center!important;gap:6px!important;row-gap:0!important;min-height:0!important;padding:4px 6px!important}
#midiary-design .fd-telegram .header-leading,#midiary-design .fd-telegram .header-actions,#midiary-design .fd-telegram .header-identity:not([hidden]){display:contents!important}
#midiary-design .fd-telegram :is(#theme,#header-help,#logout,#header-ai){display:none!important}
#midiary-design .fd-telegram #back{grid-area:1/1!important;justify-self:start;width:40px;height:40px;min-height:40px}
#midiary-design .fd-telegram #header-group{grid-area:1/1!important;justify-self:start;width:auto!important;max-width:calc(100% - 46px)!important;min-width:0;min-height:40px;margin:0 0 0 46px;padding:6px 10px;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:nowrap!important;font-size:12px}
#midiary-design .fd-telegram .fd-telegram-title{grid-area:1/2!important;justify-self:center;min-width:0}
#midiary-design .fd-telegram .fd-telegram-title>span{display:none}
#midiary-design .fd-telegram #header-profile{grid-area:1/3!important;justify-self:end;width:max-content!important;max-width:100%!important;min-width:0!important;min-height:40px;margin:0;justify-content:flex-start;padding:3px 8px 3px 4px;box-sizing:border-box;gap:6px}
#midiary-design .fd-telegram #header-profile .identity-copy{min-width:0;gap:1px;line-height:1.2}
#midiary-design .fd-telegram #header-profile .identity-copy strong{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}
#midiary-design .fd-telegram #header-profile .identity-copy span:not(strong){display:block;font-size:9px;line-height:1.2;color:var(--fd-muted)}
#midiary-design .fd-telegram #header-profile .identity-avatar{width:28px;height:28px;min-width:28px;flex:none}
@media(max-width:620px){#midiary-design .fd-telegram #header-group{padding-inline:3px;font-size:11px}}
@media(max-width:380px){
 #midiary-design .fd-telegram.fd-telegram{gap:4px!important;padding-inline:5px!important}
 #midiary-design .fd-telegram #header-group{margin-left:44px;max-width:calc(100% - 44px)!important;padding-inline:5px;font-size:10px}
 #midiary-design .fd-telegram #header-profile{padding-right:5px;gap:4px}
 #midiary-design .fd-telegram #header-profile .identity-copy strong{font-size:11px}
}
/* Miti in the bottom menu */
#midiary-design .fd-bottom-nav .nav-ai img{width:24px;height:24px;flex:none;border-radius:50%}
#midiary-design .fd-bottom-nav .nav-ai[hidden]{display:none}
/* Profile: the controls that left the header */
#midiary-design .profile-quick{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;margin:4px 0 14px}
#midiary-design .profile-quick .profile-quick-button{display:flex;align-items:center;justify-content:center;gap:9px;width:100%;min-width:0;min-height:44px;margin:0;padding:10px 14px;border-radius:14px;font-size:14px;line-height:1.4}
#midiary-design .profile-quick .profile-theme{grid-column:1/-1}
#midiary-design .profile-quick .profile-theme+.profile-logout{grid-column:1/-1}
#midiary-design .profile-quick svg{width:21px;height:21px;flex:none;stroke-width:1.8;overflow:visible}
#midiary-design .profile-quick .icon-question{display:inline-grid;place-items:center;width:20px;height:20px;box-sizing:border-box;flex:none;border:1.6px solid currentColor;border-radius:50%;font-size:14px;line-height:1}
#midiary-design .profile-quick .profile-theme[data-theme=dark] svg{color:#c4b5fd}
#midiary-design .profile-quick .profile-theme[data-theme=light] svg{color:#9b6500}
#midiary-design .profile-quick .profile-logout{--button-glass:linear-gradient(135deg,#9f12392e,#7f1d1d26);--button-edge:#fb718563;--button-ink:#fecaca;--button-shadow:inset 0 1px 0 #ffffff12,0 4px 14px #7f1d1d18;font-weight:600}
#midiary-design[data-theme=light] .profile-quick .profile-logout{--button-glass:linear-gradient(135deg,#fff1f2d9,#ffe4e6b3);--button-edge:#be123c4d;--button-ink:#9f1239;--button-shadow:inset 0 1px 0 #ffffffcc,0 4px 14px #9f12390a}
@media(max-width:359px){#midiary-design .profile-quick{grid-template-columns:minmax(0,1fr)}}
/* Tighter spacing on the schedule screen */
#midiary-design .day-page>.eyebrow{margin-bottom:2px!important}
#midiary-design .day-page>h1{margin:0 0 8px!important}
#midiary-design .day-page .section-heading{margin-bottom:6px!important}
#midiary-design[data-theme] .day-details .empty-state{width:100%;max-width:560px;box-sizing:border-box;padding:4px 0!important;margin:0 auto!important;text-align:center}
#midiary-design .day-details:has(>.empty-state)>.section-heading{width:100%;max-width:560px;justify-content:center;margin:0 auto 6px!important;text-align:center}
#midiary-design .day-details .empty-state>svg{width:24px!important;height:24px!important}
#midiary-design .day-details .empty-state h2{margin:6px 0 4px!important}
#midiary-design .day-details .empty-state p{margin:0 auto 8px!important}
#midiary-design .day-details .schedule-builder-entry{margin:6px 0!important}
#midiary-design .day-details .schedule-builder-open,#midiary-design .day-details .schedule-upload{margin-top:6px!important;margin-bottom:0!important}
#midiary-design .day-details .event-editor{margin-top:8px!important}
