/* 2026-10-31 — Mobile home-feed spacing.
   Keep Patiyiz styling, story rings and native media ratios intact.
   Only the home timeline (with its two feed tabs) is affected. */
@media (max-width:740px) {
  /* The tab switch stays comfortably tappable, without a tall empty panel. */
  #main-content:has(>.pati-home-feed-tabs)>.pati-home-feed-tabs {
    gap:6px!important;
    margin:6px 9px 4px!important;
    padding-bottom:4px!important;
  }
  #main-content:has(>.pati-home-feed-tabs)>.pati-home-feed-tabs>button {
    box-sizing:border-box;
    min-height:44px!important;
    padding:9px 6px!important;
    font-size:13px!important;
    line-height:1.2!important;
  }

  /* The story strip sits right above the first post, as in a compact feed.
     Do not resize the story avatar or reposition its plus badge. */
  #main-content:has(>.pati-home-feed-tabs)>.stories-section {
    box-sizing:border-box!important;
    margin:0!important;
    padding:7px 9px 5px!important;
    border-top:0!important;
    border-bottom:1px solid var(--pui-border,#e9e9ec)!important;
    border-radius:0!important;
    box-shadow:none!important;
  }
  #main-content:has(>.pati-home-feed-tabs)>.stories-section .stories-strip {
    gap:13px!important;
    margin:0!important;
    padding:4px 2px 5px!important;
    scroll-padding-inline:8px;
  }
  #main-content:has(>.pati-home-feed-tabs)>.stories-section .story-person {
    gap:5px!important;
  }
  #main-content:has(>.pati-home-feed-tabs)>.stories-section .story-person small {
    margin:0!important;
    line-height:1.25!important;
  }

  /* Zero artificial separator height above the first post. */
  #main-content:has(>.pati-home-feed-tabs)>.pati-feed-posts {
    margin-top:0!important;
    padding-top:0!important;
  }
  #main-content:has(>.pati-home-feed-tabs)>.pati-feed-posts>.pati-feed-card:first-child {
    margin-top:0!important;
  }
}


/* Instagram-style feed chooser: screen opens directly on stories + posts.
   Only mobile timeline, brand and menu are affected. */
@media (max-width:740px) {
  #main-content > .pati-home-feed-tabs {
    display:none!important;
  }
  #main-content:has(>.pati-home-feed-tabs)>.stories-section {
    margin:0!important;
    padding:6px 9px 5px!important;
  }
  #main-content:has(>.pati-home-feed-tabs)>.pati-feed-posts {
    margin:0!important;
    padding:0!important;
  }
  #app-root:not(.hidden)>.mobile-header {
    overflow:visible!important;
  }
  #app-root:not(.hidden)>.mobile-header>#pati-feed-menu-trigger {
    appearance:none!important;
    -webkit-appearance:none!important;
    pointer-events:auto!important;
    cursor:pointer!important;
    background:transparent!important;
    border:0!important;
    box-shadow:none!important;
    color:inherit!important;
    font:inherit!important;
    -webkit-tap-highlight-color:transparent;
  }
  #pati-feed-menu-trigger::after {
    content:"";
    position:absolute;
    top:calc(50% - 4px);
    right:-12px;
    width:7px;
    height:7px;
    border-right:2px solid currentColor;
    border-bottom:2px solid currentColor;
    transform:rotate(45deg);
    pointer-events:none;
  }
  #pati-feed-menu-trigger[aria-expanded="true"]::after {
    transform:translateY(3px) rotate(225deg);
  }
  #app-root:not(.hidden)>.mobile-header>.pati-feed-menu {
    position:absolute;
    z-index:200;
    top:calc(100% + 7px);
    left:50%;
    transform:translateX(-50%);
    display:flex;
    flex-direction:column;
    box-sizing:border-box;
    width:min(286px,calc(100vw - 24px));
    padding:7px;
    border-radius:19px;
    border:1px solid rgba(255,255,255,.22);
    color:#fff;
    background:rgba(33,35,42,.94);
    box-shadow:0 14px 38px rgba(0,0,0,.26);
    -webkit-backdrop-filter:blur(18px);
    backdrop-filter:blur(18px);
  }
  #app-root:not(.hidden)>.mobile-header>.pati-feed-menu[hidden] {
    display:none!important;
  }
  #app-root:not(.hidden)>.mobile-header>.pati-feed-menu>button {
    appearance:none;
    display:flex;
    align-items:center;
    gap:13px;
    width:100%;
    min-height:53px;
    padding:11px 12px;
    border:0;
    border-radius:12px;
    background:transparent;
    color:inherit!important;
    font:inherit;
    font-size:14px;
    font-weight:650;
    text-align:left;
    cursor:pointer;
    -webkit-tap-highlight-color:transparent;
  }
  #app-root:not(.hidden)>.mobile-header>.pati-feed-menu>button:active,
  #app-root:not(.hidden)>.mobile-header>.pati-feed-menu>button[aria-checked="true"] {
    background:rgba(255,255,255,.13);
  }
  #app-root:not(.hidden)>.mobile-header>.pati-feed-menu>button .icon {
    display:block;
    width:23px;
    height:23px;
    flex:none;
    color:#17191d!important;
    stroke:#17191d!important;
    fill:none!important;
  }
  #app-root:not(.hidden)>.mobile-header>.pati-feed-menu>button .pati-feed-menu-label {
    flex:1;
    min-width:0;
  }
  #app-root:not(.hidden)>.mobile-header>.pati-feed-menu>button .pati-feed-selected {
    visibility:hidden;
    font-size:17px;
    font-weight:800;
    color:#fff;
  }
  #app-root:not(.hidden)>.mobile-header>.pati-feed-menu>button[aria-checked="true"] .pati-feed-selected {
    visibility:visible;
  }
  #pati-feed-menu-trigger:focus-visible,
  #app-root:not(.hidden)>.mobile-header>.pati-feed-menu>button:focus-visible {
    outline:2px solid #9ebafc!important;
    outline-offset:2px;
  }
}


/* Patiyiz 2026-10-31: accessible care shortcuts, lost city opt-in and mission progress */
.pati-city-alert{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:16px 0;padding:17px;border:1px solid var(--border,#dedee1);border-radius:16px;background:var(--paper,#fff);color:var(--ink,#202127)}
.pati-city-alert strong{font-size:14px}.pati-city-alert p{margin:6px 0 0;color:var(--muted,#666);font-size:12px;line-height:1.5}
.pati-city-alert button{flex-shrink:0;border:1px solid currentColor;border-radius:12px;background:var(--ink,#202127);color:var(--paper,#fff);padding:10px 12px;font-weight:700;font-size:12px}
.pati-city-alert button[aria-pressed="true"]{background:transparent;color:inherit}
.pati-city-alert button:disabled{opacity:.6;cursor:not-allowed}
.pati-care-quick{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;margin:15px 0 18px}
.pati-care-quick button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:88px;padding:10px 6px;border:1px solid var(--border,#dedee1);background:var(--paper,#fff);color:var(--ink,#202127);border-radius:14px}
.pati-care-quick button span{font-size:22px}.pati-care-quick button strong{font-size:12px}.pati-care-quick button small{font-size:10px;color:var(--muted,#666);text-align:center}
.pati-mission-progress{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:14px 0;padding:0}
.pati-mission-progress>div{border-radius:14px;padding:14px;border:1px solid var(--border,#dedee1);background:var(--paper,#fff);color:var(--ink,#202127)}
.pati-mission-progress strong,.pati-mission-progress span{display:block;font-size:12px}.pati-mission-progress span{margin:4px 0 8px;color:var(--muted,#666)}
.pati-mission-progress progress{display:block;width:100%;height:9px;accent-color:var(--ink,#202127)}
@media(max-width:600px){.pati-city-alert{align-items:stretch;flex-direction:column}.pati-city-alert button{align-self:stretch}.pati-care-quick{grid-template-columns:repeat(2,minmax(0,1fr))}.pati-mission-progress{grid-template-columns:1fr}}


/* 2026-11-01 — The logo itself opens a compact, two-choice feed picker. */
#app-root .pati-feed-brand-selector{
  appearance:none;-webkit-appearance:none;border:0!important;background:transparent!important;
  color:inherit!important;font:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent;
}
#app-root .pati-feed-brand-selector:focus-visible{
  outline:2px solid #434c59!important;outline-offset:4px;border-radius:12px;
}
#pati-feed-menu-trigger::after,#pati-feed-desktop-trigger::after{
  content:"";position:static;display:block;flex:none;
  width:7px;height:7px;margin:0 0 3px 6px;
  border-right:2px solid currentColor;border-bottom:2px solid currentColor;
  transform:rotate(45deg);pointer-events:none;
}
#pati-feed-menu-trigger[aria-expanded="true"]::after,
#pati-feed-desktop-trigger[aria-expanded="true"]::after{
  transform:translateY(3px) rotate(225deg);
}
#pati-feed-menu,#pati-feed-desktop-menu{
  box-sizing:border-box;width:min(292px,calc(100vw - 20px));max-height:calc(100dvh - 94px);
  overflow-y:auto;padding:7px;border:1px solid #e6e7ea;border-radius:17px;
  background:#fff;color:#18191f;
  box-shadow:0 13px 38px rgba(13,20,32,.19);
  -webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);
}
#pati-feed-menu[hidden],#pati-feed-desktop-menu[hidden]{display:none!important}
#pati-feed-menu>button,#pati-feed-desktop-menu>button{
  appearance:none;-webkit-appearance:none;display:flex!important;align-items:center;
  gap:11px;width:100%;min-height:62px;margin:0;padding:10px 11px!important;
  border:0!important;border-radius:11px!important;background:transparent!important;
  color:#18191f!important;font:inherit;font-size:14px;text-align:left;cursor:pointer;
}
#pati-feed-menu>button[aria-checked="true"],
#pati-feed-desktop-menu>button[aria-checked="true"]{background:#f1f2f5!important}
#pati-feed-menu>button:focus-visible,
#pati-feed-desktop-menu>button:focus-visible{
  outline:2px solid #303943!important;outline-offset:-3px;
}
#pati-feed-menu>button .icon,#pati-feed-desktop-menu>button .icon{
  display:block;flex:none;width:23px;height:23px;color:#222!important;
  fill:none!important;stroke:currentColor!important;
}
#pati-feed-menu .pati-feed-menu-label,#pati-feed-desktop-menu .pati-feed-menu-label{
  display:flex;flex:1;flex-direction:column;align-items:flex-start;gap:3px;min-width:0;
}
#pati-feed-menu .pati-feed-menu-label strong,#pati-feed-desktop-menu .pati-feed-menu-label strong{
  font-size:14px;line-height:1.25;font-weight:800;color:#18191f;
}
#pati-feed-menu .pati-feed-menu-label small,#pati-feed-desktop-menu .pati-feed-menu-label small{
  font-size:11px;line-height:1.35;font-weight:500;color:#626b76;
}
#pati-feed-menu .pati-feed-selected,#pati-feed-desktop-menu .pati-feed-selected{
  visibility:hidden;font-size:17px;font-weight:800;color:#111;
}
#pati-feed-menu>button[aria-checked="true"] .pati-feed-selected,
#pati-feed-desktop-menu>button[aria-checked="true"] .pati-feed-selected{visibility:visible}
@media(max-width:740px){
  #app-root:not(.hidden)>.mobile-header>.brand.pati-feed-brand-selector{z-index:4;max-width:calc(100% - 172px)!important}
  #app-root:not(.hidden)>.mobile-header>#pati-feed-menu{
    position:absolute;top:calc(100% + 7px);left:50%;transform:translateX(-50%);
    z-index:700;background:#fff!important;border:1px solid #e6e7ea!important;
    color:#18191f!important;box-shadow:0 13px 38px rgba(13,20,32,.19)!important;
  }
  #pati-feed-desktop-menu{display:none!important}
}
@media(min-width:741px){
  #app-root .sidebar>.brand.pati-feed-brand-selector{
    display:flex;align-items:center;justify-content:flex-start;gap:7px;
    width:100%;text-align:left;
  }
  #pati-feed-desktop-menu{position:fixed;z-index:12000}
}
