* { box-sizing: border-box; }

    :root{
      --bg:#0b0d10;
      --card:#12161b;
      --text:#eef2f7;
      --muted:#b6c0cc;
      --line:#233041;
      --accent:#7c5cff;
      --ok:#3ddc97;
      --warn:#ffd166;
      --danger:#ff5c7a;
      --shadow:0 10px 30px rgba(0,0,0,.35);
      --radius:18px;

      --violet-border: rgba(124,92,255,.32);
      --violet-glow: 0 0 0 1px rgba(124,92,255,.16), 0 10px 30px rgba(0,0,0,.35);
    }

    body {
      margin: 0;
      font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
      background:
        radial-gradient(1200px 600px at 20% -10%, rgba(124,92,255,.25), transparent 60%),
        radial-gradient(900px 500px at 90% 10%, rgba(61,220,151,.18), transparent 55%),
        var(--bg);
      background-repeat: no-repeat;
      background-attachment: fixed;
      color: var(--text);
    }

    .wrap { max-width: 1100px; margin: 0 auto; padding: 22px; }
    body.home-page .site-nav{ margin-bottom: 0; }

    .topbar{
      display:flex;
      gap:10px;
      flex-wrap:wrap;
      align-items:center;
      justify-content:space-between;
      margin-bottom:18px;
    }

    .badge{
      display:flex;
      gap:12px;
      align-items:center;
      background: rgba(12,14,18,.6);
      border: 1px solid var(--line);
      border-radius: 999px;
      padding: 10px 14px;
      box-shadow: var(--shadow);
    }

    .dot{
      width: 10px;
      height: 10px;
      border-radius: 50%;
      background: var(--ok);
      box-shadow: 0 0 10px rgba(61,220,151,.6);
    }

    .btn {
      padding: 10px 12px;
      border-radius: 12px;
      border: 1px solid var(--line);
      background: rgba(12,14,18,.6);
      color: var(--text);
      cursor: pointer;
      font-weight: 650;
      white-space: nowrap;
      text-decoration: none;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      font-size: 14px;
      line-height: 1;
    }
    .btn:hover { border-color: var(--accent); }
    .btn.primary { border-color: var(--accent); background: rgba(124,92,255,.12); }
    .btn.remove { border-color: var(--danger); }

    .card {
      background: linear-gradient(180deg, rgba(18,22,27,.92), rgba(15,19,24,.92));
      border: 1px solid var(--violet-border);
      border-radius: var(--radius);
      box-shadow: var(--violet-glow);
      /* Allow small tooltips to escape card bounds */
      overflow: visible;
    }
    .pad { padding: 18px; }

    .home-switch-wrap{ margin-top:0; }
    .home-section-switch{
      display:grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      width: 100%;
      gap:0;
      padding:0;
      border-radius: 16px;
      overflow: hidden;
      border: 1px solid rgba(157,124,255,.24);
      background: linear-gradient(180deg, rgba(26,22,36,.88), rgba(14,11,20,.88));
      box-shadow: 0 16px 44px rgba(0,0,0,.42);
    }
    .home-switch-btn{
      border: 0;
      background: transparent;
      color: rgba(255,255,255,.92);
      border-radius: 0;
      min-height: 0;
      padding: 13px 12px;
      cursor: pointer;
      display:flex;
      align-items:center;
      justify-content:center;
      gap: 10px;
      font-size: 18px;
      font-weight: 550;
      line-height: 1.1;
      transition: background .15s ease, color .15s ease;
    }
    .home-switch-btn + .home-switch-btn{
      border-left: 1px solid rgba(255,255,255,.12);
    }
    .home-switch-btn:hover{
      background: rgba(157,124,255,.08);
      color: #fff;
    }
    .home-switch-btn.active{
      background: linear-gradient(180deg, rgba(123,77,255,.22), rgba(123,77,255,.12));
      color: #fff;
    }
    .home-switch-label{
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      text-align: center;
    }
    .home-switch-count{
      display:none;
    }
    .home-switch-count.show{
      display:inline-flex;
      align-items:center;
      justify-content:center;
      min-width:20px;
      height:20px;
      padding:0 6px;
      border-radius:999px;
      border:1px solid rgba(255,92,92,.72);
      background:linear-gradient(180deg, rgba(255,92,92,.32), rgba(155,26,57,.42));
      color:#fff;
      font-size:11px;
      font-weight:700;
      line-height:1;
      box-shadow:0 0 14px rgba(255,92,92,.35);
      flex:0 0 auto;
    }
    .home-tab-panel{ display:none; margin-top:14px; }
    .home-tab-panel.active{ display:block; }
    .portal-panel-head{
      display:flex;
      justify-content:flex-end;
      align-items:center;
    }

    .message-center-head{
      display:flex;
      align-items:flex-start;
      justify-content:space-between;
      gap:12px;
      flex-wrap:wrap;
    }
    .message-center-actions{
      display:flex;
      gap:8px;
      flex-wrap:wrap;
    }
    .message-center-list{
      display:flex;
      flex-direction:column;
      gap:12px;
    }
    .message-item{
      border: 1px solid rgba(157,124,255,.2);
      border-radius: 14px;
      background: rgba(12,14,18,.58);
      padding: 12px;
      display:flex;
      flex-direction:column;
      gap: 10px;
      cursor:pointer;
    }
    .message-item.unread{
      border-color: rgba(157,124,255,.5);
      background: linear-gradient(180deg, rgba(123,77,255,.16), rgba(12,14,18,.62));
    }
    .message-item-head{
      display:flex;
      align-items:flex-start;
      justify-content:space-between;
      gap:10px;
      flex-wrap:wrap;
    }
    .message-item-title{
      font-weight:700;
      font-size:15px;
    }
    .message-item-time{
      font-size:12px;
      color: var(--muted);
    }
    .message-item-body{
      color: rgba(238,242,247,.9);
      font-size: 14px;
      line-height: 1.5;
      white-space: normal;
      word-break: break-word;
    }
    .message-item-foot{
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:8px;
      flex-wrap:wrap;
    }
    .message-item-actions{
      display:flex;
      align-items:center;
      gap:8px;
      flex-wrap:wrap;
    }
    .message-reminder-actions{
      display:flex;
      gap:8px;
      flex-wrap:wrap;
      margin-top:10px;
    }
    .message-reminder-note{
      margin-top:10px;
      color: var(--muted);
      font-size:13px;
    }
    .message-thread-actions{
      display:flex;
      gap:8px;
      flex-wrap:wrap;
      margin:10px 0 4px;
    }
    .message-thread-list{
      display:flex;
      flex-direction:column;
      gap:8px;
      max-height:44vh;
      overflow:auto;
      margin:10px 0 12px;
    }
    .message-thread-msg{
      border:1px solid rgba(157,124,255,.24);
      border-radius:12px;
      background:rgba(12,14,18,.58);
      padding:10px 12px;
      max-width:94%;
      align-self:flex-start;
    }
    .message-thread-msg.outgoing{
      align-self:flex-end;
      border-color:rgba(61,220,151,.4);
      background:linear-gradient(180deg, rgba(61,220,151,.2), rgba(12,14,18,.62));
    }
    .message-thread-msg-head{
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:10px;
      margin-bottom:6px;
      font-size:12px;
      color:var(--muted);
    }
    .message-thread-msg-body{
      font-size:14px;
      line-height:1.45;
      color:rgba(238,242,247,.95);
      white-space:pre-wrap;
      word-break:break-word;
    }
    @media (max-width: 900px){
      .home-section-switch{
        grid-template-columns: 1fr;
        border-radius: 16px;
      }
      .home-switch-btn{
        border-radius: 0;
      }
      .home-switch-btn + .home-switch-btn{
        border-left: 0;
        border-top: 1px solid rgba(255,255,255,.12);
      }
    }

    .welcome-avatar{width:64px; height:64px; border-radius:12px; border:1px solid var(--line); background:rgba(12,14,18,.6); overflow:hidden; display:none; align-items:center; justify-content:center}
    .welcome-avatar img{width:100%; height:100%; object-fit:cover; display:block}

    .home-welcome-hero{ margin: 0; }
    .home-welcome-shell{
      display:grid;
      margin-top: 0;
      column-gap: 22px;
      row-gap: 0;
      align-items: stretch;
      grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
      background: transparent;
    }
    .home-welcome-copy{
      padding: 22px 6px 4px;
      display:flex;
      flex-direction:column;
      justify-content:center;
      text-align:center;
      gap: 0;
    }
    .home-welcome-title{
      margin:0;
      line-height: 1.06;
      letter-spacing: -.02em;
      font-size: clamp(24px, 3vw, 38px);
      font-weight: 500;
      color: var(--accent2, #9D7CFF);
      text-shadow: 0 0 24px rgba(157,124,255,.20);
      white-space: nowrap;
    }
    .home-welcome-greet{
      margin: 14px 0 0;
      color: rgba(255,255,255,.96);
      font-size: clamp(10px, 1vw, 14px);
      font-weight: 440;
      line-height: 1.5;
      white-space: nowrap;
    }
    .home-welcome-sub{
      margin:0;
      color: rgba(238,242,247,.92);
      font-size: 15px;
      line-height: 1.5;
      max-width: 54ch;
    }
    .home-welcome-actions{
      display:flex;
      justify-content:center;
      gap:10px;
      flex-wrap:wrap;
      margin-top: 20px;
    }
    .home-welcome-media{
      position:relative;
      overflow:hidden;
      width: 100%;
      aspect-ratio: 5 / 3;
      min-height: 0;
      border-radius: 26px;
      background:
        radial-gradient(560px 360px at 70% 35%, rgba(123,77,255,.22), transparent 65%),
        radial-gradient(520px 380px at 38% 70%, rgba(157,124,255,.16), transparent 70%);
      filter: saturate(1.04) contrast(1.06);
      opacity: .96;
      display:flex;
      align-items:center;
      justify-content:center;
      -webkit-mask-image: linear-gradient(90deg,
        rgba(0,0,0,0) 0%,
        rgba(0,0,0,.95) 14%,
        rgba(0,0,0,1) 50%,
        rgba(0,0,0,.95) 86%,
        rgba(0,0,0,0) 100%);
      mask-image: linear-gradient(90deg,
        rgba(0,0,0,0) 0%,
        rgba(0,0,0,.95) 14%,
        rgba(0,0,0,1) 50%,
        rgba(0,0,0,.95) 86%,
        rgba(0,0,0,0) 100%);
    }
    .home-welcome-media::before{
      content:'';
      position:absolute;
      inset:0;
      background:
        linear-gradient(90deg,
          rgba(14,11,20,.92) 0%,
          rgba(14,11,20,.50) 12%,
          rgba(14,11,20,0) 26%,
          rgba(14,11,20,0) 74%,
          rgba(14,11,20,.50) 88%,
          rgba(14,11,20,.92) 100%),
        linear-gradient(180deg,
          rgba(14,11,20,0) 0%,
          rgba(14,11,20,0) 74%,
          rgba(14,11,20,.40) 100%);
      pointer-events:none;
      z-index:2;
    }
    .home-welcome-media img{
      width:100%;
      height:100%;
      object-fit:cover;
      display:none;
      position:relative;
      z-index:1;
    }
    .home-welcome-media.has-image img{ display:block; }
    .home-welcome-empty{
      color: var(--muted);
      font-size: 13px;
      line-height: 1.4;
      text-align:center;
      max-width: 220px;
      padding: 12px;
      position:relative;
      z-index:3;
    }
    .home-welcome-media.has-image .home-welcome-empty{ display:none; }
    @media (max-width: 980px){
      .home-welcome-shell{ grid-template-columns: 1fr; }
    }

    .grid{
      display:grid;
      grid-template-columns: repeat(3, minmax(0,1fr));
      gap:16px;
    }
    @media (max-width: 980px){ .grid{grid-template-columns: repeat(2, minmax(0,1fr));} }
    @media (max-width: 640px){ .grid{grid-template-columns: 1fr;} }

    .pet-card{
      display:flex;
      flex-direction:column;
      gap:12px;
    }

    /* Make cards in the pet/family grids equal-height and keep actions aligned */
    #petGrid > .card,
    #familyGrid > .card,
    #familiesGrid > .card{
      display:flex;
    }
    #petGrid > .card > .pet-card,
    #familyGrid > .card > .pet-card,
    #familiesGrid > .card > .pet-card{
      flex: 1;
    }

    .pet-header{display:flex; gap:12px; align-items:center;}
    .pet-photo{
      width:64px; height:64px; border-radius:16px; overflow:hidden; flex:0 0 auto;
      background: rgba(12,14,18,.6);
      border:1px solid var(--line);
      display:flex; align-items:center; justify-content:center;
    }
    .pet-photo img{width:100%; height:100%; object-fit:cover;}

    .pill{
      padding:6px 10px; border-radius:999px; border:1px solid var(--line);
      font-size:12px; color:var(--muted); background: rgba(12,14,18,.6);
      display:inline-flex; align-items:center; gap:6px;
    }
    .pill.ok{ border-color: rgba(61,220,151,.4); color: var(--ok); }
    .pill.warn{ border-color: rgba(255,209,102,.5); color: var(--warn); }
    .pill.danger{ border-color: rgba(255,92,122,.6); color: var(--danger); }

    .pillrow{display:flex; gap:8px; flex-wrap:wrap; align-items:center;}
    .pillrow-slot{min-height: 28px;}

    .pet-actions-stack{
      margin-top: auto;
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .pet-actions-end{
      display:flex;
      justify-content:flex-end;
      gap:8px;
      flex-wrap:wrap;
    }

    /* Tooltip for permission pills */
    .pill[data-tip]{
      position: relative;
      cursor: help;
    }
    .pill[data-tip]::after{
      content: attr(data-tip);
      position: absolute;
      left: 50%;
      bottom: calc(100% + 10px);
      transform: translateX(-50%) translateY(2px);
      opacity: 0;
      pointer-events: none;
      transition: opacity .12s ease, transform .12s ease;
      z-index: 60;

      width: max-content;
      max-width: 260px;
      white-space: normal;

      padding: 10px 12px;
      border-radius: 12px;
      border: 1px solid rgba(124,92,255,.35);
      background: rgba(12,14,18,.96);
      color: var(--text);
      box-shadow: 0 14px 30px rgba(0,0,0,.45);
      font-size: 12px;
      line-height: 1.2;
    }
    .pill[data-tip]::before{
      content: "";
      position: absolute;
      left: 50%;
      bottom: calc(100% + 4px);
      transform: translateX(-50%);
      opacity: 0;
      pointer-events: none;
      transition: opacity .12s ease;
      z-index: 61;

      width: 10px;
      height: 10px;
      background: rgba(12,14,18,.96);
      border-left: 1px solid rgba(124,92,255,.35);
      border-bottom: 1px solid rgba(124,92,255,.35);
      transform: translateX(-50%) rotate(45deg);
    }
    .pill[data-tip]:hover::after,
    .pill[data-tip]:hover::before{
      opacity: 1;
    }
    .pill[data-tip]:hover::after{
      transform: translateX(-50%) translateY(0);
    }

    .pet-actions{display:flex; gap:8px; flex-wrap:wrap;}
    .btn-group{display:flex; gap:8px; flex-wrap:wrap; align-items:center;}
    .btn-group .btn{flex:0 0 auto;}
    .actions-split{width:100%; justify-content:space-between;}

    .empty{
      padding:32px; text-align:center; color:var(--muted);
    }
    .grid-empty{grid-column: 1 / -1;}

    .floating-pill{
      position:fixed; right:22px; bottom:22px; z-index:20;
      display:flex; gap:10px; padding:10px 12px; border-radius:999px;
      border:1px solid rgba(255,255,255,.12); background:rgba(12,14,18,.85);
      box-shadow:0 12px 30px rgba(0,0,0,.35);
    }

    /* QR modal */
    .admin-modal{position:fixed; inset:0; background:rgba(11,13,16,.96); display:none; align-items:center; justify-content:center; z-index:50;}
    .admin-modal.show{display:flex;}
    .admin-modal-card{background:var(--card); border:1px solid var(--line); border-radius:18px; padding:18px; width:560px; max-width:calc(100% - 32px);} 
    .admin-modal-head{display:flex; justify-content:space-between; align-items:center; margin-bottom:12px;}
    .admin-modal-title{margin:0; font-size:18px;}
    .contact-admin-modal-card{width:min(620px, calc(100% - 32px));}
    .contact-admin-grid{grid-template-columns:1fr; gap:12px}
    .portal-modal-card{
      width:min(1120px, calc(100% - 32px));
      padding:18px;
    }
    .qr-zoom-modal-card{
      width:min(560px, calc(100% - 32px));
    }
    .qr-zoom-frame{
      display:flex;
      align-items:center;
      justify-content:center;
      min-height:320px;
      border-radius:16px;
      border:1px solid rgba(157,124,255,.24);
      background:#fff;
      padding:16px;
    }
    .qr-zoom-frame img{
      width:min(440px, 100%);
      height:auto;
      max-height:68vh;
      object-fit:contain;
      display:block;
    }
    .portal-modal-layout{
      display:grid;
      grid-template-columns:minmax(0, 2fr) minmax(0, 1fr);
      gap:14px;
      align-items:stretch;
    }
    .portal-main,
    .portal-qr-panel{
      border:1px solid rgba(157,124,255,.26);
      border-radius:18px;
      background:linear-gradient(180deg, rgba(22,17,34,.88), rgba(14,11,20,.88));
      box-shadow:0 0 0 1px rgba(157,124,255,.10), 0 12px 28px rgba(0,0,0,.35);
    }
    .portal-main{ padding:14px; display:flex; flex-direction:column; gap:12px; }
    .portal-name-row{
      display:flex;
      align-items:flex-end;
      justify-content:space-between;
      gap:12px;
      min-width:0;
    }
    .portal-progress-inline{
      display:flex;
      align-items:center;
      justify-content:flex-end;
      flex:0 0 auto;
    }
    .portal-progress-circle{
      --pct:0;
      width:52px;
      height:52px;
      border-radius:50%;
      display:grid;
      place-items:center;
      position:relative;
      background:conic-gradient(
        hsl(calc(var(--pct) * 1.2) 84% 54%) calc(var(--pct) * 1%),
        rgba(255,255,255,.13) 0
      );
      box-shadow:0 0 0 1px rgba(157,124,255,.26), 0 10px 22px rgba(0,0,0,.34);
      transition:background .2s ease, box-shadow .2s ease;
    }
    .portal-progress-circle::before{
      content:"";
      position:absolute;
      inset:4px;
      border-radius:50%;
      background:rgba(11,9,18,.95);
      border:1px solid rgba(157,124,255,.28);
      z-index:0;
    }
    .portal-progress-inner{
      position:relative;
      z-index:1;
      font-size:12px;
      font-weight:700;
      line-height:1;
      color:#fff;
      letter-spacing:.01em;
    }
    .portal-progress-check{
      position:relative;
      z-index:1;
      width:18px;
      height:18px;
      display:none;
      align-items:center;
      justify-content:center;
      color:#3ddc97;
    }
    .portal-progress-check svg{
      width:100%;
      height:100%;
      display:block;
    }
    .portal-progress-circle.is-complete{
      width:22px;
      height:22px;
      border-radius:0;
      background:none;
      box-shadow:none;
    }
    .portal-progress-circle.is-complete::before{
      display:none;
    }
    .portal-progress-circle.is-complete .portal-progress-inner{
      display:none;
    }
    .portal-progress-circle.is-complete .portal-progress-check{
      display:inline-flex;
      width:22px;
      height:22px;
      color:#3ddc97;
      filter:drop-shadow(0 0 8px rgba(61,220,151,.42));
    }
    .portal-progress-circle.is-complete[title]{
      cursor:default;
    }
    .portal-main-content{
      display:grid;
      grid-template-columns:minmax(0, .95fr) minmax(0, 1.05fr);
      gap:14px;
      align-items:start;
    }
    .portal-photo{
      border-radius:16px;
      overflow:hidden;
      border:1px solid rgba(157,124,255,.28);
      background:rgba(10,8,18,.72);
      height:230px;
      min-height:230px;
      max-height:230px;
      display:flex;
      align-items:center;
      justify-content:center;
      position:relative;
    }
    .portal-photo img{
      width:100%;
      height:100%;
      object-fit:cover;
      display:none;
    }
    .portal-photo.has-image img{ display:block; }
    .portal-photo-empty{
      color:rgba(238,242,247,.72);
      font-size:12px;
      text-align:center;
      padding:10px 12px;
    }
    .portal-photo.has-image .portal-photo-empty{ display:none; }
    .portal-meta{
      display:flex;
      flex-direction:column;
      gap:8px;
      justify-content:flex-start;
      height:100%;
      min-width:0;
    }
    .portal-name{
      font-size:30px;
      line-height:1.1;
      letter-spacing:-.02em;
      color:#fff;
      font-weight:560;
      white-space:nowrap;
      overflow:hidden;
      text-overflow:ellipsis;
    }
    .portal-age-breed{
      color:rgba(238,242,247,.85);
      font-size:14px;
      line-height:1.3;
    }
    .portal-divider{
      margin:8px 0 10px;
      height:2px;
      border-radius:999px;
      background:linear-gradient(90deg, rgba(157,124,255,0) 0%, rgba(157,124,255,.95) 50%, rgba(157,124,255,0) 100%);
      box-shadow:0 0 18px rgba(157,124,255,.45);
    }
    .portal-health-grid{
      display:grid;
      grid-template-columns:minmax(0, 1fr);
      gap:10px;
    }
    .portal-health-item{
      display:flex;
      align-items:flex-start;
      gap:10px;
      min-width:0;
    }
    .portal-health-item-stack{
      display:block;
    }
    .portal-health-main{
      display:flex;
      align-items:flex-start;
      gap:10px;
      min-width:0;
    }
    .portal-health-vax-row{
      margin-top:8px;
      display:flex;
      align-items:center;
      flex-wrap:wrap;
    }
    .portal-health-icon{
      width:30px;
      height:30px;
      border-radius:10px;
      border:1px solid rgba(157,124,255,.32);
      background:rgba(123,77,255,.16);
      color:rgba(238,242,247,.9);
      display:flex;
      align-items:center;
      justify-content:center;
      flex:0 0 auto;
    }
    .portal-health-icon svg,
    .portal-health-icon img{
      width:16px;
      height:16px;
      display:block;
    }
    .portal-health-icon img{
      object-fit:contain;
    }
    .portal-health-label{
      font-size:11px;
      letter-spacing:.06em;
      text-transform:uppercase;
      color:rgba(238,242,247,.66);
      margin-bottom:2px;
    }
    .portal-health-value{
      font-size:13px;
      color:#fff;
      line-height:1.35;
      white-space:nowrap;
      overflow:hidden;
      text-overflow:ellipsis;
    }
    .portal-main-actions{
      display:flex;
      gap:8px;
      flex-wrap:wrap;
      justify-content:flex-end;
      margin-top:auto;
      padding-top:6px;
    }
    .portal-main-actions .btn{ min-height:38px; }
    .portal-qr-panel{
      padding:14px;
      display:grid;
      grid-template-columns:minmax(0, 1fr) auto;
      gap:12px;
      align-items:center;
    }
    .portal-qr-title{
      font-size:18px;
      font-weight:650;
      color:#fff;
      line-height:1.2;
      margin-bottom:6px;
    }
    .portal-qr-text{
      font-size:13px;
      line-height:1.45;
      margin-bottom:12px;
    }
    .portal-qr-actions{
      display:flex;
      flex-wrap:wrap;
      gap:8px;
    }
    .portal-qr-frame{
      border-radius:14px;
      border:1px solid rgba(157,124,255,.28);
      background:#fff;
      padding:10px;
      box-shadow:0 12px 30px rgba(0,0,0,.28);
    }
    .portal-qr-zoom-btn{
      border:0;
      background:transparent;
      padding:0;
      margin:0;
      cursor:zoom-in;
      border-radius:10px;
      display:block;
      line-height:0;
    }
    .portal-qr-zoom-btn:focus-visible{
      outline:2px solid rgba(123,77,255,.75);
      outline-offset:3px;
    }
    .portal-qr-img{
      width:132px;
      height:132px;
      display:block;
      object-fit:contain;
    }
    .portal-inline-card{
      border:none;
      box-shadow:0 12px 28px rgba(0,0,0,.35);
    }
    .portal-inline-head{
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:10px;
      margin-bottom:12px;
    }
    .portal-inline-title{
      display:flex;
      align-items:center;
      gap:10px;
      min-width:0;
    }
    .portal-inline-logo{
      width:28px;
      height:28px;
      display:block;
      object-fit:contain;
      flex:0 0 28px;
      filter: drop-shadow(0 0 12px rgba(157,124,255,.35));
    }
    .portal-inline-title-text{
      font-weight:700;
      font-size:20px;
      color:#fff;
      white-space:nowrap;
      overflow:hidden;
      text-overflow:ellipsis;
    }
    .portal-inline-nav{
      display:flex;
      align-items:center;
      gap:8px;
      margin-left:auto;
    }
    .portal-inline-arrow{
      width:34px;
      height:34px;
      min-height:34px;
      border-radius:999px;
      padding:0;
      display:flex;
      align-items:center;
      justify-content:center;
      font-size:18px;
      line-height:1;
    }
    .portal-inline-count{
      font-size:12px;
      color:rgba(238,242,247,.78);
      min-width:56px;
      text-align:center;
    }
    .portal-records-shell{
      margin-top:16px;
      display:flex;
      flex-direction:column;
      gap:14px;
    }
    .portal-records-head{
      display:flex;
      align-items:flex-end;
      justify-content:space-between;
      gap:12px;
      margin-bottom:14px;
    }
    .portal-records-title{
      font-size:18px;
      font-weight:700;
      color:#fff;
    }
    .portal-record-layout{
      display:grid;
      grid-template-columns:minmax(240px, 300px) minmax(0, 1fr);
      gap:0;
      border:1px solid rgba(124,92,255,.22);
      border-radius:24px;
      background:rgba(10,12,17,.92);
      box-shadow:0 24px 48px rgba(0,0,0,.24);
      overflow:hidden;
    }
    .portal-record-sidebar{
      display:flex;
      flex-direction:column;
      gap:14px;
      padding:14px;
      border-right:1px solid rgba(255,255,255,.10);
      background:linear-gradient(180deg, rgba(26,22,36,.88), rgba(14,11,20,.88));
    }
    .portal-record-sidebar-group{
      display:flex;
      flex-direction:column;
      gap:8px;
    }
    .portal-record-sidebar-group.is-active .portal-record-sidebar-title{
      color:#fff;
    }
    .portal-record-sidebar-title{
      margin:0;
      padding:0 2px;
      font-size:11px;
      font-weight:700;
      letter-spacing:.08em;
      text-transform:uppercase;
      color:rgba(238,242,247,.64);
    }
    .portal-record-sidebar-list{
      display:flex;
      flex-direction:column;
      gap:8px;
    }
    .portal-record-card{
      width:100%;
      border:1px solid rgba(255,255,255,.08);
      border-radius:12px;
      background:rgba(18,22,27,.72);
      color:rgba(255,255,255,.92);
      padding:11px 12px;
      text-align:left;
      cursor:pointer;
      display:flex;
      align-items:center;
      min-height:48px;
      box-shadow:none;
      transition:border-color .16s ease, background .16s ease, color .16s ease;
    }
    .portal-record-card:hover,
    .portal-record-card:focus-visible{
      background:rgba(157,124,255,.08);
      border-color:rgba(124,92,255,.36);
      outline:none;
    }
    .portal-record-card.is-active{
      background:linear-gradient(180deg, rgba(123,77,255,.24), rgba(123,77,255,.14));
      color:#fff;
      border-color:rgba(124,92,255,.56);
    }
    .portal-record-card.is-warn:not(.is-active){
      background:rgba(255,209,102,.12);
      border-color:rgba(255,209,102,.45);
    }
    .portal-record-card.is-danger:not(.is-active){
      background:rgba(255,92,122,.12);
      border-color:rgba(255,92,122,.52);
    }
    .portal-record-card.is-active.is-warn{
      background:linear-gradient(180deg, rgba(255,209,102,.3), rgba(255,209,102,.16));
      border-color:rgba(255,209,102,.62);
    }
    .portal-record-card.is-active.is-danger{
      background:linear-gradient(180deg, rgba(255,92,122,.34), rgba(255,92,122,.18));
      border-color:rgba(255,92,122,.7);
    }
    .portal-record-card-head{
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:10px;
      width:100%;
    }
    .portal-record-card-title{
      font-size:15px;
      font-weight:700;
      color:#fff;
    }
    .portal-record-workspace{
      border:0;
      border-radius:0;
      background:rgba(10,12,17,.92);
      box-shadow:none;
      overflow:hidden;
      min-width:0;
    }
    .portal-record-workspace-head{
      padding:22px 24px 0;
      display:flex;
      align-items:flex-start;
      justify-content:space-between;
      gap:12px;
      flex-wrap:wrap;
    }
    .portal-record-workspace-title{
      margin:0;
      font-size:24px;
      font-weight:800;
      color:#fff;
    }
    .portal-record-public-toggle{
      display:inline-flex;
      align-items:center;
      gap:10px;
      color:#eef2f7;
      font-size:13px;
      font-weight:650;
      user-select:none;
      cursor:pointer;
    }
    .portal-record-public-toggle input{
      width:16px;
      height:16px;
      accent-color:#7B4DFF;
      cursor:pointer;
      margin:0;
    }
    .portal-record-public-toggle span{
      line-height:1.2;
    }
    .portal-record-workspace-body{
      min-height:0;
      padding:18px 24px 24px;
      background:rgba(9,11,16,.96);
    }
    .portal-record-workspace-body.is-inline{
      min-height:0;
    }
    .portal-record-native{
      display:flex;
      flex-direction:column;
      gap:16px;
    }
    .portal-record-native-head{
      display:flex;
      align-items:flex-start;
      justify-content:space-between;
      gap:12px;
      flex-wrap:wrap;
    }
    .portal-record-native-copy{
      max-width:720px;
      line-height:1.5;
    }
    .portal-record-native-list{
      display:flex;
      flex-direction:column;
      gap:12px;
    }
    .portal-record-native-empty{
      display:flex;
      flex-direction:column;
      gap:6px;
      align-items:flex-start;
      border:1px dashed rgba(124,92,255,.28);
      border-radius:16px;
      background:rgba(12,14,18,.42);
    }
    .portal-record-native-item{
      background:rgba(12,14,18,.62);
    }
    .portal-record-native-item.is-warn{
      border-color:rgba(255,209,102,.48);
    }
    .portal-record-native-item.is-danger{
      border-color:rgba(255,92,122,.56);
    }
    .portal-record-native-actions{
      display:flex;
      gap:8px;
      flex-wrap:wrap;
    }
    .portal-record-workspace-frame{
      width:100%;
      min-height:240px;
      height:240px;
      border:0;
      display:block;
      background:transparent;
    }
    .portal-section-modal-card{
      width:min(1360px, 98vw);
      max-height:94vh;
    }
    .portal-section-modal-body{
      min-height:66vh;
      overflow:auto;
      padding:0;
      background: var(--card);
    }
    #portalSectionModal.is-inline-section .portal-section-modal-card{
      max-height:min(90vh, 1100px);
    }
    #portalSectionModal.is-inline-section .portal-section-modal-body{
      min-height:0;
    }
    .portal-section-inline{
      padding:18px;
    }
    .portal-section-inline[hidden],
    .portal-section-frame[hidden]{
      display:none !important;
    }
    .portal-section-frame{
      width:100%;
      min-height:78vh;
      border:0;
      display:block;
      background:transparent;
    }
    .portal-section-card{
      border:none;
      box-shadow:none;
      background:transparent;
    }
    @media (max-width: 980px){
      .portal-modal-layout{
        grid-template-columns:1fr;
      }
      .portal-main-content{
        grid-template-columns:1fr;
      }
      .portal-photo{
        height:220px;
        min-height:220px;
        max-height:220px;
      }
      .portal-name-row{
        align-items:flex-start;
      }
      .portal-health-grid{
        grid-template-columns:1fr;
      }
      .portal-qr-panel{
        grid-template-columns:1fr;
      }
      .portal-qr-frame{
        justify-self:center;
      }
      .portal-progress-inline{
        align-items:flex-start;
      }
      .portal-progress-circle{
        width:46px;
        height:46px;
      }
      .portal-record-layout{
        grid-template-columns:1fr;
      }
      .portal-record-sidebar{
        border-right:0;
        border-bottom:1px solid rgba(255,255,255,.10);
      }
      .portal-record-workspace-head{
        padding:18px 18px 0;
      }
      .portal-record-public-toggle{
        width:100%;
      }
      .portal-record-workspace-body{
        padding:16px 18px 18px;
      }
      .portal-record-native-head{
        align-items:stretch;
      }
      .portal-record-native-head .btn{
        width:100%;
      }
      .portal-record-workspace-frame{
        min-height:220px;
        height:220px;
      }
    }

/* Inline style extraction */
.inline-style-1{font-weight:800}
.inline-style-2{margin-bottom:16px}
.inline-style-3{display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap}
.inline-style-4{display:flex; align-items:center; gap:12px}
.inline-style-5{font-size:12px}
.inline-style-6{font-size:20px; font-weight:700}
.inline-style-7{margin-left:auto}
.inline-style-8{display:inline-flex}
.inline-style-9{font-weight:700}
.inline-style-10{margin-top:16px}
.inline-style-11{display:flex; gap:16px; align-items:flex-start; flex-wrap:wrap}
.inline-style-12{background:#fff; padding:8px; border-radius:12px}
.inline-style-13{display:block; width:220px; height:220px}
.inline-style-14{margin-top:6px; position:absolute; left:-9999px; opacity:0}
.inline-style-15{margin-top:10px; display:flex; gap:8px; flex-wrap:wrap}
.inline-style-16{margin:0 0 16px}
.inline-style-17{display:flex; gap:8px; justify-content:flex-end; flex-wrap:wrap}
.inline-style-18{grid-template-columns:1fr; gap:12px}
.inline-style-19{display:flex; gap:8px; justify-content:flex-end; flex-wrap:wrap; margin-top:16px}

/* Inline style extraction (JS templates) */
.js-inline-style-2{font-weight:700; font-size:20px}
.js-inline-style-3{font-size:12px}

.rot-0{transform:rotate(0deg);}
.rot-90{transform:rotate(90deg);}
.rot-180{transform:rotate(180deg);}
.rot-270{transform:rotate(270deg);}

#adminSettingsBtn, #addPetSecondary { margin-left: auto; }

#familyCard{margin-top:0;}

.member-avatar{
  font-weight: 900;
  font-size: 20px;
  line-height: 1;
  color: rgba(238,242,247,.86);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.admin-modal-card input[type="text"],
.admin-modal-card input[type="email"],
.admin-modal-card input[type="date"],
.admin-modal-card input[type="time"],
.admin-modal-card input[type="number"],
.admin-modal-card textarea,
.admin-modal-card select{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background: rgba(12,14,18,.6);
  color: var(--text);
  outline:none;
}
.admin-modal-card input[type="text"]:focus,
.admin-modal-card input[type="email"]:focus,
.admin-modal-card input[type="date"]:focus,
.admin-modal-card input[type="time"]:focus,
.admin-modal-card input[type="number"]:focus,
.admin-modal-card textarea:focus,
.admin-modal-card select:focus{border-color:var(--accent);}

.family-form{grid-template-columns: 1fr 1fr; gap:12px;}
@media (max-width: 720px){ .family-form{grid-template-columns: 1fr;} }
.family-perms{margin-top:14px;}
.family-expiry{margin-top:14px;}
.family-expiry input[type="date"],
.family-expiry select{
  height: 42px;
}
.family-expiry-actions{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:12px;
  flex-wrap:wrap;
  margin-top:10px;
}
.family-perm-row{display:flex; gap:14px; flex-wrap:wrap; margin-top:8px;}
.family-perm{display:flex; align-items:center; gap:10px; font-weight:650; color:var(--text);}
.family-perm input{transform: translateY(1px);}

.admin-modal-foot{display:flex; gap:8px; justify-content:flex-end; flex-wrap:wrap; margin-top:14px;}
.family-pet-list{display:flex; flex-direction:column; gap:10px; margin-top:12px;}
.family-pet-row{display:flex; align-items:center; gap:12px; padding:10px 12px; border:1px solid var(--line); border-radius:14px; background: rgba(12,14,18,.6);}
.family-pet-avatar{
  width:48px; height:48px;
  border-radius:14px;
  overflow:hidden;
  background: rgba(12,14,18,.6);
  border:1px solid var(--line);
  display:flex; align-items:center; justify-content:center;
  flex:0 0 auto;
}
.family-pet-avatar img{width:100%; height:100%; object-fit:cover; display:block;}
.family-pet-actions{display:flex; gap:8px; flex-wrap:wrap;}

.pet-logs-shell{
  margin-top:14px;
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:14px;
}
.pet-log-card .pad{
  display:flex;
  flex-direction:column;
  gap:12px;
}
.portal-inline-log-card{
  display:flex;
  flex-direction:column;
  gap:12px;
}
.pet-log-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.portal-inline-log-head{
  justify-content:flex-end;
}
.portal-inline-log-spacer{
  display:none;
}
.pet-log-actions{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.expense-download-wrap{
  position:relative;
  display:inline-flex;
}
.expense-download-menu{
  position:absolute;
  top:calc(100% + 8px);
  right:0;
  min-width:170px;
  padding:7px;
  border-radius:12px;
  border:1px solid rgba(157,124,255,.24);
  background:linear-gradient(180deg, rgba(26,22,36,.95), rgba(14,11,20,.95));
  box-shadow:0 18px 60px rgba(0,0,0,.45);
  z-index:2100;
  display:none;
}
.expense-download-menu.show{
  display:block;
}
.expense-download-item{
  width:100%;
  border:0;
  border-radius:10px;
  background:transparent;
  color:var(--text);
  text-align:left;
  padding:10px 12px;
  font-size:13px;
  font-weight:600;
  cursor:pointer;
}
.expense-download-item:hover{
  background:rgba(255,255,255,.06);
}
.expense-download-item:disabled{
  opacity:.5;
  cursor:not-allowed;
}
.pet-log-icon-btn{
  width:38px;
  min-width:38px;
  height:38px;
  min-height:38px;
  padding:0;
  justify-content:center;
}
.pet-log-icon-btn svg{
  width:18px;
  height:18px;
  display:block;
}
.pet-log-icon-btn.is-active{
  border-color:var(--accent);
  background:rgba(124,92,255,.12);
}
.pet-log-title{
  margin:0;
  font-size:18px;
  font-weight:650;
  color:#fff;
}
.pet-log-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.pet-log-section{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.pet-log-section + .pet-log-section{
  padding-top:8px;
  border-top:1px solid rgba(255,255,255,.08);
}
.pet-log-section-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.pet-log-section-title{
  font-size:12px;
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:rgba(238,242,247,.82);
}
.pet-log-section-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.expense-log-summary{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:10px;
  margin-top:8px;
  padding:8px 12px;
  border:1px solid rgba(157,124,255,.24);
  border-radius:12px;
  background:rgba(12,14,18,.5);
}
.expense-log-summary-main{
  display:flex;
  flex-direction:column;
  gap:2px;
  min-width:0;
}
.expense-log-summary-title{
  color:#fff;
  font-size:13px;
  font-weight:650;
}
.expense-log-summary-meta{
  color:rgba(238,242,247,.72);
  font-size:11px;
}
#expenseVisibleTotal{
  color:#fff;
  font-size:18px;
  font-weight:700;
  white-space:nowrap;
}
.expense-log-head-row{
  display:grid;
  grid-template-columns:minmax(0,.95fr) minmax(0,1.25fr) minmax(0,.9fr) minmax(0,.7fr);
  gap:10px;
  margin-top:8px;
  padding:0 12px 0;
  color:#fff;
  font-size:11px;
  font-weight:700;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.expense-log-head-row > span,
.expense-log-head-btn{
  display:block;
  min-width:0;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.expense-log-head-row > span.is-total{
  text-align:right;
}
.expense-log-head-btn{
  display:inline-flex;
  align-items:center;
  justify-content:flex-start;
  gap:5px;
  border:0;
  padding:0;
  margin:0;
  background:transparent;
  color:inherit;
  font:inherit;
  letter-spacing:inherit;
  text-transform:inherit;
  cursor:pointer;
}
.expense-log-head-btn:hover{
  color:#f6f8ff;
}
.expense-log-head-btn.is-open{
  color:#d9cbff;
}
.expense-log-head-btn.is-active{
  color:#bde2ff;
}
.expense-filter-icon{
  width:11px;
  height:11px;
  opacity:.9;
  flex:0 0 auto;
}
.expense-filter-panel{
  margin-top:8px;
  border:1px solid rgba(157,124,255,.24);
  border-radius:12px;
  padding:10px;
  background:rgba(12,14,18,.6);
}
.expense-filter-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
}
.expense-filter-panel label{
  display:flex;
  flex-direction:column;
  gap:6px;
  color:rgba(238,242,247,.9);
  font-size:12px;
}
.expense-filter-panel input,
.expense-filter-panel select{
  width:100%;
  height:38px;
  border-radius:10px;
  border:1px solid var(--line);
  background:rgba(12,14,18,.6);
  color:var(--text);
  padding:0 10px;
  outline:none;
}
.expense-filter-panel input:focus,
.expense-filter-panel select:focus{
  border-color:var(--accent);
}
.expense-filter-panel-foot{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-top:10px;
}
.expense-filter-panel-foot .muted{
  font-size:11px;
}
.expense-log-list{
  max-height:360px;
  overflow-y:auto;
  margin-top:0;
  padding-right:4px;
}
.pet-log-empty{
  padding:18px 10px;
}
.log-item{
  border:1px solid rgba(157,124,255,.24);
  border-radius:14px;
  background:rgba(12,14,18,.58);
  padding:10px 12px;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.log-item-clickable{
  cursor:pointer;
  transition:border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.log-item-clickable:hover{
  border-color:rgba(157,124,255,.52);
  box-shadow:0 8px 20px rgba(0,0,0,.22);
}
.log-item-clickable:focus-visible{
  outline:2px solid rgba(157,124,255,.72);
  outline-offset:2px;
}
.expense-log-row{
  display:grid;
  grid-template-columns:minmax(0,.95fr) minmax(0,1.25fr) minmax(0,.9fr) minmax(0,.7fr);
  align-items:center;
  gap:10px;
}
.expense-log-cell{
  min-width:0;
  color:rgba(238,242,247,.9);
  font-size:13px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.expense-log-cell.is-total{
  text-align:right;
  color:#fff;
  font-weight:650;
}
.log-item-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}
.log-item-title{
  font-size:14px;
  font-weight:650;
  color:#fff;
}
.log-item-date{
  font-size:12px;
  color:rgba(238,242,247,.72);
  white-space:nowrap;
}
.log-item-meta{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  color:rgba(238,242,247,.82);
  font-size:12px;
}
.log-item-notes{
  color:rgba(238,242,247,.9);
  font-size:13px;
  line-height:1.45;
}
.log-modal-card{
  width:min(760px, calc(100% - 32px));
}
.log-modal-card .admin-modal-body{
  display:flex;
  flex-direction:column;
  gap:14px;
}
.log-modal-card label{
  display:block;
  margin-bottom:6px;
}
.log-form-grid{
  grid-template-columns:1fr 1fr;
  gap:12px;
}
.log-visibility-field{
  display:flex;
  align-items:flex-end;
}
.log-visibility-field .checkbox{
  display:inline-flex;
  align-items:center;
  gap:10px;
  min-height:42px;
  font-weight:600;
}
.log-vax-tools{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.log-vax-list{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.expense-line-items{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.expense-line-items-head{
  display:grid;
  grid-template-columns:minmax(0,1.2fr) minmax(0,.9fr) minmax(0,.7fr) auto;
  gap:8px;
  color:rgba(238,242,247,.72);
  font-size:11px;
  letter-spacing:.06em;
  text-transform:uppercase;
  margin-top:2px;
}
.expense-line-item{
  border:1px solid rgba(157,124,255,.24);
  border-radius:12px;
  background:rgba(12,14,18,.5);
  padding:10px;
  display:grid;
  grid-template-columns:minmax(0,1.2fr) minmax(0,.9fr) minmax(0,.7fr) auto;
  gap:8px;
  align-items:end;
}
.expense-line-item-remove{
  display:flex;
  align-items:flex-end;
  justify-content:flex-end;
}
.expense-total-row{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  color:#fff;
  font-size:14px;
  margin-top:2px;
}
.expense-search-wrap{
  margin-top:4px;
}
.expense-search-input{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(12,14,18,.6);
  color:var(--text);
  outline:none;
}
.expense-search-input:focus{
  border-color:var(--accent);
}
#vetVisitDate,
#vetVisitVetSelect,
#expenseDate,
#expenseCategory{
  height:42px;
}

@media (max-width: 980px){
  .pet-logs-shell{ grid-template-columns:1fr; }
}
@media (max-width: 720px){
  .log-form-grid{ grid-template-columns:1fr; }
  .expense-log-summary{
    align-items:flex-start;
    flex-direction:column;
  }
  .expense-log-head-row,
  .expense-log-row{
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  }
  .expense-filter-grid{
    grid-template-columns:1fr;
  }
  .expense-filter-panel-foot{
    flex-direction:column;
    align-items:flex-start;
  }
  .expense-line-items-head{
    display:none;
  }
  .expense-line-item{
    grid-template-columns:1fr;
  }
  .expense-line-item-remove{
    justify-content:flex-start;
  }
}

@media (max-width: 900px){
  body{
    background-attachment: scroll;
  }
  .wrap{
    padding: 14px;
  }
  .home-welcome-copy{
    padding: 8px 2px 2px;
    text-align: left;
  }
  .home-welcome-title{
    white-space: normal;
    font-size: clamp(24px, 7.6vw, 34px);
  }
  .home-welcome-greet{
    white-space: normal;
    font-size: 14px;
    margin-top: 10px;
  }
  .home-welcome-actions{
    justify-content: flex-start;
  }
  .home-welcome-actions .btn{
    flex: 1 1 220px;
    min-height: 42px;
  }
  .home-section-switch{
    display: flex;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    border-radius: 14px;
  }
  .home-section-switch::-webkit-scrollbar{
    display: none;
  }
  .home-switch-btn{
    flex: 0 0 auto;
    min-width: 190px;
    justify-content: flex-start;
    padding: 12px 14px;
    font-size: 14px;
    scroll-snap-align: start;
  }
  .home-switch-btn + .home-switch-btn{
    border-top: 0;
    border-left: 1px solid rgba(255,255,255,.12);
  }
  .message-center-actions{
    width: 100%;
  }
  .message-center-actions .btn{
    flex: 1 1 140px;
    min-height: 42px;
    justify-content: center;
  }
  .portal-modal-card{
    width: min(100vw - 16px, 1120px);
    padding: 12px;
  }
  .portal-main-actions{
    justify-content: stretch;
  }
  .portal-main-actions .btn{
    flex: 1 1 180px;
    justify-content: center;
  }
  .portal-record-workspace-head{
    padding: 14px 14px 0;
  }
  .portal-record-workspace-body{
    padding: 14px;
  }
  .portal-record-sidebar{
    padding: 10px;
  }
  .portal-record-sidebar-group{
    gap: 6px;
  }
  .portal-record-sidebar-list{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
  }
  .portal-record-card{
    min-height: 42px;
    padding: 9px 10px;
  }
  .portal-record-workspace-title{
    font-size: 20px;
  }
  .admin-modal{
    padding: 12px;
  }
  .admin-modal-card{
    max-width: 100%;
  }
  .admin-modal-foot .btn{
    min-height: 42px;
  }
  .message-thread-list{
    max-height: 50vh;
  }
}

@media (max-width: 640px){
  .wrap{
    padding: 10px;
  }
  .topbar{
    margin-bottom: 12px;
  }
  .home-welcome-media{
    border-radius: 16px;
    aspect-ratio: 4 / 3;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .home-switch-btn{
    min-width: 168px;
    font-size: 13px;
    padding: 11px 12px;
  }
  .portal-photo{
    height: 190px;
    min-height: 190px;
    max-height: 190px;
  }
  .portal-name{
    font-size: 24px;
  }
  .portal-inline-title-text{
    font-size: 17px;
  }
  .portal-inline-nav{
    width: 100%;
    justify-content: space-between;
    margin-left: 0;
  }
  .portal-inline-count{
    min-width: 0;
  }
  .portal-record-public-toggle{
    font-size: 12px;
  }
  .portal-record-sidebar-list{
    display: flex;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .portal-record-card{
    flex: 0 0 auto;
    min-width: 170px;
  }
  .message-center-actions .btn{
    flex: 1 1 100%;
  }
  .message-thread-actions .btn{
    flex: 1 1 100%;
  }
}

@media (max-width: 420px){
  .home-welcome-actions .btn{
    flex: 1 1 100%;
  }
  .portal-main-actions .btn{
    flex: 1 1 100%;
  }
}
