/*
 * A.I.C. layout styles
 *
 * Application shell / sidebar / navigation layout.
 * Rules remain scoped behind `html.aic-layout-refactor` so they cannot leak
 * into non-A.I.C. documents while the application layout owns that class.
 */

/* ============================================================
   Application shell
   Source: app/views/layouts/application.html.erb
   ============================================================ */

      html.aic-layout-refactor{
        --safe-top: env(safe-area-inset-top, 0px);
        --safe-right: env(safe-area-inset-right, 0px);
        --safe-bottom: env(safe-area-inset-bottom, 0px);
        --safe-left: env(safe-area-inset-left, 0px);
      }

      html.aic-layout-refactor,
:where(html.aic-layout-refactor) body{
        height:100%;
        min-height:100%;
        background:var(--ui-app-canvas, #f4f6f8);
        font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
        -webkit-font-smoothing:antialiased;
      }

      :where(html.aic-layout-refactor) body{
        margin:0;
        min-height:100vh;
        min-height:100dvh;
        padding:0;
      }

      :where(html.aic-layout-refactor) input,
:where(html.aic-layout-refactor) select,
:where(html.aic-layout-refactor) textarea,
:where(html.aic-layout-refactor) button{
        font:inherit;
        font-family:inherit;
        letter-spacing:inherit;
      }

      :where(html.aic-layout-refactor) input[type="date"],
:where(html.aic-layout-refactor) input[type="time"],
:where(html.aic-layout-refactor) input[type="datetime-local"],
:where(html.aic-layout-refactor) input[type="month"],
:where(html.aic-layout-refactor) input[type="search"],
:where(html.aic-layout-refactor) input[type="text"],
:where(html.aic-layout-refactor) input[type="number"],
:where(html.aic-layout-refactor) input[type="email"],
:where(html.aic-layout-refactor) input[type="password"],
:where(html.aic-layout-refactor) input[type="tel"],
:where(html.aic-layout-refactor) input[type="url"],
:where(html.aic-layout-refactor) select,
:where(html.aic-layout-refactor) textarea{
        font-family:inherit;
        color:inherit;
      }

      :where(html.aic-layout-refactor) input[type="date"]::-webkit-datetime-edit,
:where(html.aic-layout-refactor) input[type="date"]::-webkit-datetime-edit-fields-wrapper,
:where(html.aic-layout-refactor) input[type="date"]::-webkit-datetime-edit-text,
:where(html.aic-layout-refactor) input[type="date"]::-webkit-datetime-edit-month-field,
:where(html.aic-layout-refactor) input[type="date"]::-webkit-datetime-edit-day-field,
:where(html.aic-layout-refactor) input[type="date"]::-webkit-datetime-edit-year-field,
:where(html.aic-layout-refactor) input[type="time"]::-webkit-datetime-edit,
:where(html.aic-layout-refactor) input[type="time"]::-webkit-datetime-edit-fields-wrapper,
:where(html.aic-layout-refactor) input[type="time"]::-webkit-datetime-edit-text,
:where(html.aic-layout-refactor) input[type="time"]::-webkit-datetime-edit-hour-field,
:where(html.aic-layout-refactor) input[type="time"]::-webkit-datetime-edit-minute-field{
        font-family:inherit;
        font-weight:inherit;
        color:inherit;
      }

      :where(html.aic-layout-refactor) input[type="date"]::-webkit-calendar-picker-indicator,
:where(html.aic-layout-refactor) input[type="time"]::-webkit-calendar-picker-indicator{
        cursor:pointer;
      }

      :where(html.aic-layout-refactor) b,
:where(html.aic-layout-refactor) strong{
        font-weight:600;
        letter-spacing:0.02em;
      }

      :where(html.aic-layout-refactor) .skip-link{
        position: absolute;
        left: -9999px;
        top: auto;
        width: 1px;
        height: 1px;
        overflow: hidden;
      }

      :where(html.aic-layout-refactor) .skip-link:focus{
        position: static;
        width: auto;
        height: auto;
        padding: 8px 12px;
        background:transparent;
        border: 1px solid #cfe3ff;
        border-radius: 8px;
        color: #0b3e84;
        margin: 8px;
      }

      :where(html.aic-layout-refactor) .auth-shell .main-content{
        min-height: 100vh;
        min-height: 100dvh;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        box-sizing: border-box;
        padding:
          calc(12px + var(--safe-top))
          calc(12px + var(--safe-right))
          calc(12px + var(--safe-bottom))
          calc(12px + var(--safe-left));
      }

      @media (min-width: 640px){
        :where(html.aic-layout-refactor) .auth-shell .main-content{
          padding:
            calc(16px + var(--safe-top))
            calc(16px + var(--safe-right))
            calc(16px + var(--safe-bottom))
            calc(16px + var(--safe-left));
        }
      }

      :where(html.aic-layout-refactor) .app-shell{
        /* Expanded drawer width is distinct from the zero-width content offset on My. */
        --aic-sidebar-expanded-w: 204px;
        --sidebar-w: var(--aic-sidebar-expanded-w);
        --page-pad-x: 20px;
        --page-top: calc(20px + var(--safe-top));
        --page-bottom: calc(24px + var(--safe-bottom));
      }

      :where(html.aic-layout-refactor) .app-shell.sidebar-collapsed{
        --sidebar-w: var(--sidebar-w-collapsed);
      }

      :where(html.aic-layout-refactor) .app-shell .main-content{
        max-width: none;
        box-sizing: border-box;
        margin-top: var(--page-top);
        margin-bottom: var(--page-bottom);
        margin-left: calc(var(--sidebar-w) + var(--page-pad-x) + var(--safe-left));
        margin-right: calc(var(--page-pad-x) + var(--safe-right));
        width: calc(100% - var(--sidebar-w) - (var(--page-pad-x) * 2) - var(--safe-left) - var(--safe-right));
        padding: 0 0 var(--safe-bottom);
        transition: margin-left .22s ease, width .22s ease;
      }

      /*
       * 通常画面の最上位コンテナは、main-content内で中央寄せせず
       * サイドバー直後の左端から表示する。
       * 認証画面・フラッシュ・style/script/templateは対象外。
       */
      :where(html.aic-layout-refactor) body.app-shell main.main-content > :not(.flash-wrap):not(style):not(script):not(template){
        margin-left: 0 !important;
        margin-right: auto !important;
      }

      :where(html.aic-layout-refactor) .layout-sidebar-shell{
        display:block;
      }

      :where(html.aic-layout-refactor) .dashboard-shell .main-content{
        margin-left: calc(var(--page-pad-x) + var(--safe-left));
        margin-right: calc(var(--page-pad-x) + var(--safe-right));
        width: calc(100% - (var(--page-pad-x) * 2) - var(--safe-left) - var(--safe-right));
      }

      :where(html.aic-layout-refactor) .dashboard-with-sidebar .main-content{
        margin-left: calc(var(--sidebar-w) + var(--page-pad-x) + var(--safe-left));
        margin-right: calc(var(--page-pad-x) + var(--safe-right));
        width: calc(100% - var(--sidebar-w) - (var(--page-pad-x) * 2) - var(--safe-left) - var(--safe-right));
      }

      :where(html.aic-layout-refactor) .dashboard-sidebar-toggle{
        position:fixed;
        top:calc(14px + var(--safe-top));
        right:calc(16px + var(--safe-right));
        display:inline-flex;
        align-items:center;
        justify-content:center;
        gap:8px;
        min-height:46px;
        padding:0 14px;
        margin:0;
        border-radius:14px;
        border:2px solid #b7c0cb;
        background:transparent;
        color:var(--ui-color-text);
        box-shadow:var(--ui-shadow-xs);
        cursor:pointer;
        font-size:13px;
        font-weight:700;
        line-height:1;
        z-index:1095;
        transition:
          transform .08s ease,
          background .2s ease,
          box-shadow .2s ease,
          color .2s ease,
          border-color .2s ease;
      }

      :where(html.aic-layout-refactor) .dashboard-sidebar-toggle:hover{
        background:transparent;
        box-shadow:var(--ui-shadow-sm);
        transform:translateY(-1px);
      }

      :where(html.aic-layout-refactor) .dashboard-sidebar-toggle:active{
        transform:translateY(0);
      }

      :where(html.aic-layout-refactor) .dashboard-sidebar-toggle:focus-visible{
        outline:none;
        box-shadow:
          var(--ui-focus-ring), var(--ui-shadow-xs);
      }

      :where(html.aic-layout-refactor) .dashboard-sidebar-toggle i{
        line-height:1;
      }

      :where(html.aic-layout-refactor) .dashboard-sidebar-toggle__label{
        display:inline-flex;
        align-items:center;
        justify-content:center;
        line-height:1.2;
      }

      @media (max-width: 1024px){
        :where(html.aic-layout-refactor) .app-shell .main-content{
          margin-left: calc(var(--page-pad-x) + var(--safe-left));
          margin-right: calc(var(--page-pad-x) + var(--safe-right));
          width: calc(100% - (var(--page-pad-x) * 2) - var(--safe-left) - var(--safe-right));
          /* R70 FIX1: a breakpoint must not animate a temporary sidebar gap. */
          transition: none;
        }

        :where(html.aic-layout-refactor) .dashboard-with-sidebar .main-content{
          margin-left: calc(var(--page-pad-x) + var(--safe-left));
          margin-right: calc(var(--page-pad-x) + var(--safe-right));
          width: calc(100% - (var(--page-pad-x) * 2) - var(--safe-left) - var(--safe-right));
        }
      }

      @media (max-width: 900px){
        :where(html.aic-layout-refactor) .app-shell{
          --page-pad-x: 12px;
          --page-top: calc(12px + var(--safe-top));
          --page-bottom: calc(20px + var(--safe-bottom));
        }
      }

      @media (max-width:768px){
        :where(html.aic-layout-refactor) .dashboard-sidebar-toggle{
          min-height:44px;
          padding:0 12px;
          font-size:12.5px;
          top:calc(12px + var(--safe-top));
          right:calc(12px + var(--safe-right));
        }
      }

      @media (max-width:640px){
        :where(html.aic-layout-refactor) .dashboard-sidebar-toggle{
          min-height:42px;
          padding:0 12px;
          margin:0;
          border-radius:var(--ui-radius-md);
          font-size:12px;
          top:calc(12px + var(--safe-top));
          right:calc(12px + var(--safe-right));
        }

        :where(html.aic-layout-refactor) .dashboard-sidebar-toggle__label{
          display:none;
        }
      }

      @media (display-mode: standalone) {
        html.aic-layout-refactor,
:where(html.aic-layout-refactor) body{
          overscroll-behavior-y:none;
        }
      }

      :where(html.aic-layout-refactor) .flash-wrap{
        width: 100%;
        margin: 0 0 12px;
      }

      :where(html.aic-layout-refactor) .global-toast{
        position:fixed;
        left:50%;
        bottom:18px;
        transform:translateX(-50%) translateY(16px);
        display:flex;
        align-items:center;
        gap:8px;
        padding:9px 13px;
        border-radius:var(--ui-radius-md);
        font-weight:700;
        font-size:12.5px;
        background:var(--ui-surface);
        color:var(--ui-color-text);
        box-shadow:var(--ui-shadow-md);
        opacity:0;
        pointer-events:none;
        transition:opacity .2s ease, transform .2s ease;
        z-index:10000;
      }

      :where(html.aic-layout-refactor) .global-toast.is-show{
        opacity:1;
        transform:translateX(-50%) translateY(0);
      }

      :where(html.aic-layout-refactor) .global-toast i{
        font-size:13px;
      }

/* ============================================================
   Sidebar
   Source: app/views/layouts/_sidebar.html.erb
   ============================================================ */

:where(html.aic-layout-refactor) body.my-namespace-layout,
:where(html.aic-layout-refactor) body.my-namespace-layout.sidebar-collapsed{
        --sidebar-w:0px !important;
        --sidebar-w-collapsed:0px !important;
      }

      :where(html.aic-layout-refactor) body.my-namespace-layout #appSidebar,
:where(html.aic-layout-refactor) body.my-namespace-layout .app-sidebar,
:where(html.aic-layout-refactor) body.my-namespace-layout .app-sidebar__mobile-toggle{
        display:none !important;
      }

      :where(html.aic-layout-refactor) body.my-namespace-layout main,
:where(html.aic-layout-refactor) body.my-namespace-layout .main,
:where(html.aic-layout-refactor) body.my-namespace-layout .app-main,
:where(html.aic-layout-refactor) body.my-namespace-layout .main-content,
:where(html.aic-layout-refactor) body.my-namespace-layout .content,
:where(html.aic-layout-refactor) body.my-namespace-layout .content-wrapper,
:where(html.aic-layout-refactor) body.my-namespace-layout .layout-content,
:where(html.aic-layout-refactor) body.my-namespace-layout .page-content{
        width:auto !important;
        max-width:100% !important;
      }

html.aic-layout-refactor{
        --sidebar-w:220px;
        --sidebar-w-collapsed:74px;
        --sb-text:#111827;
        --sb-muted:#64748b;
        --sb-accent:#111827;
--sb-btn-border:#b7c0cb;
        --sb-btn-bg-top:#fff;
        --sb-btn-bg-bottom:#fff;
        --sb-btn-bg-top-hover:#fff;
        --sb-btn-bg-bottom-hover:#fff;
        --sb-btn-bg-top-active:#fff;
        --sb-btn-bg-bottom-active:#fff;
--sb-btn-focus:var(--ui-focus-ring);

        --sb-menu-bg-top:#f4f7fa;
        --sb-menu-bg-bottom:#e8eef4;
        --sb-menu-bg-hover-top:#f6f9fc;
        --sb-menu-bg-hover-bottom:#ebf1f6;
        --sb-menu-bg-active-top:#ffffff;
        --sb-menu-bg-active-bottom:#f6f9fc;
        --sb-menu-border:rgba(148,163,184,.22);
        --sb-menu-inset-light:rgba(255,255,255,.88);
        --sb-menu-inset-light-strong:rgba(255,255,255,.96);
        --sb-menu-inset-dark:rgba(148,163,184,.24);
        --sb-menu-inset-dark-strong:rgba(100,116,139,.28);
--sb-menu-divider:rgba(148,163,184,.18);

        --sb-button-height:44px;
        --sb-toggle-size:44px;
        --sb-icon-size:18px;
        --sb-link-gap:8px;
        --sb-link-pad-x:10px;
        --sb-collapsed-btn-size:40px;
        --sb-collapsed-profile-size:46px;

        --sb-logo-open-width:100%;
        --sb-logo-open-height:88px;
        --sb-logo-image-open-max-width:100%;
        --sb-logo-image-open-max-height:80px;
        --sb-logo-collapsed-size:36px;
        --sb-logo-surface-radius:22px;
        --sb-logo-surface-radius-collapsed:14px;

        --safe-top: env(safe-area-inset-top, 0px);
        --safe-right: env(safe-area-inset-right, 0px);
        --safe-bottom: env(safe-area-inset-bottom, 0px);
        --safe-left: env(safe-area-inset-left, 0px);
      }

      :where(html.aic-layout-refactor) #appSidebar,
:where(html.aic-layout-refactor) #appSidebar *,
:where(html.aic-layout-refactor) .app-sidebar__mobile-toggle,
:where(html.aic-layout-refactor) .app-sidebar__mobile-toggle *{
        box-sizing:border-box;
      }

      :where(html.aic-layout-refactor) .app-sidebar{
        position:fixed;
        inset:0 auto 0 0;
        width:var(--sidebar-w);
        height:100vh;
        height:100dvh;
        padding:
          calc(12px + var(--safe-top))
          12px
          calc(12px + var(--safe-bottom));
        background:var(--ui-surface);
        color:var(--sb-text);
        box-shadow:
          var(--ui-shadow-edge-right);
        z-index:1000;
        overflow:hidden;
        transition:width .24s ease, padding .24s ease, background .24s ease, transform .26s ease;
        border-right:1px solid rgba(255,255,255,.65);
        backdrop-filter:blur(24px) saturate(155%);
        -webkit-backdrop-filter:blur(24px) saturate(155%);
      }

      :where(html.aic-layout-refactor) .app-sidebar__backdrop{
        display:none;
      }

      :where(html.aic-layout-refactor) body.sidebar-collapsed .app-sidebar{
        width:var(--sidebar-w-collapsed);
        padding-left:8px;
        padding-right:8px;
      }

      :where(html.aic-layout-refactor) .app-sidebar__mobile-toggle{
        display:none;
        position:fixed;
        top:calc(14px + var(--safe-top));
        left:calc(14px + var(--safe-left));
        right:auto;
        width:var(--sb-toggle-size);
        height:var(--sb-toggle-size);
        min-width:var(--sb-toggle-size);
        min-height:var(--sb-toggle-size);
        padding:0;
        border-radius:var(--ui-radius-md);
        border:0;
        background:linear-gradient(180deg, var(--ui-surface), var(--ui-surface-soft));
        color:var(--sb-text);
        box-shadow:var(--ui-shadow-sm);
        z-index:1105;
        cursor:pointer;
        transition:
          transform .08s ease,
          background .2s ease,
          box-shadow .2s ease,
          color .2s ease,
          border-color .2s ease;
      }

      :where(html.aic-layout-refactor) .app-sidebar__mobile-toggle:hover{
        background:transparent;
        color:var(--sb-text);
        box-shadow:var(--ui-shadow-sm);
        border-color:var(--sb-btn-border);
      }

      :where(html.aic-layout-refactor) .app-sidebar__mobile-toggle:active{
        transform:translateY(1px);
        background:transparent;
      }

      :where(html.aic-layout-refactor) .app-sidebar__mobile-toggle:focus-visible{
        outline:none;
        box-shadow:var(--ui-focus-ring);
      }

      :where(html.aic-layout-refactor) .app-sidebar__inner{
        height:100%;
        display:flex;
        flex-direction:column;
        gap:10px;
        min-height:0;
        align-items:flex-start;
        padding-bottom:var(--safe-bottom);
      }

      :where(html.aic-layout-refactor) .app-sidebar__topbar{
        display:flex;
        align-items:center;
        justify-content:flex-start;
        gap:12px;
        min-height:48px;
        height:48px;
        width:100%;
        padding:0 0 2px;
        flex:0 0 auto;
        overflow:visible;
      }

      :where(html.aic-layout-refactor) .app-sidebar__toggle{
        width:var(--sb-toggle-size);
        height:var(--sb-toggle-size);
        min-width:var(--sb-toggle-size);
        min-height:var(--sb-toggle-size);
        display:grid;
        place-items:center;
        padding:0;
        background:linear-gradient(180deg, var(--ui-surface), var(--ui-surface-soft));
        border:0;
        color:var(--sb-text);
        cursor:pointer;
        z-index:1001;
        border-radius:var(--ui-radius-md);
        transition:
          transform .08s ease,
          background .2s ease,
          box-shadow .2s ease,
          color .2s ease,
          border-color .2s ease;
        box-shadow:var(--ui-shadow-sm);
        flex:0 0 auto;
        align-self:flex-start;
        justify-self:flex-start;
        margin:0;
        font-size:15px;
        line-height:1;
        position:relative;
        left:0;
        top:0;
      }

      :where(html.aic-layout-refactor) .app-sidebar__toggle:hover{
        background:transparent;
        color:var(--sb-text);
        box-shadow:var(--ui-shadow-sm);
        border-color:var(--sb-btn-border);
      }

      :where(html.aic-layout-refactor) .app-sidebar__toggle:active{
        transform:translateY(1px);
        background:transparent;
      }

      :where(html.aic-layout-refactor) .app-sidebar__toggle:focus-visible{
        outline:none;
        box-shadow:var(--ui-focus-ring);
      }

      :where(html.aic-layout-refactor) .app-sidebar__toggle i,
:where(html.aic-layout-refactor) .app-sidebar__mobile-toggle i,
:where(html.aic-layout-refactor) .app-sidebar__profile-icon i,
:where(html.aic-layout-refactor) .app-sidebar__icon{
        line-height:1;
      }

      :where(html.aic-layout-refactor) .app-sidebar__profile{
        display:flex;
        align-items:center;
        gap:10px;
        min-height:68px;
        width:100%;
        max-width:100%;
        padding:12px 14px;
        border-radius:20px;
        background:transparent;
        border:1px solid rgba(255,255,255,.70);
        box-shadow:
          var(--ui-shadow-edge-top);
        backdrop-filter:blur(16px);
        -webkit-backdrop-filter:blur(16px);
        flex:0 0 auto;
        overflow:hidden;
        position:relative;
        text-decoration:none;
        align-self:flex-start;
        margin:0;
      }

      :where(html.aic-layout-refactor) .app-sidebar__profile--link:hover{
        background:transparent;
        border-color:rgba(255,255,255,.84);
        box-shadow:
          var(--ui-shadow-edge-top);
      }

      :where(html.aic-layout-refactor) .app-sidebar__profile--link:active{
        transform:translateY(1px);
      }

      :where(html.aic-layout-refactor) .app-sidebar__profile::after{
        content:"";
        position:absolute;
        inset:1px;
        border-radius:var(--ui-radius-xl);
        pointer-events:none;
        box-shadow:
          var(--ui-ring-info);
        opacity:.9;
      }

      :where(html.aic-layout-refactor) .app-sidebar__profile-icon{
        width:var(--sb-icon-size);
        height:var(--sb-icon-size);
        min-width:var(--sb-icon-size);
        min-height:var(--sb-icon-size);
        border:none;
        background:none;
        box-shadow:none;
        border-radius:0;
        display:flex;
        align-items:center;
        justify-content:center;
        color:var(--sb-text);
        flex:0 0 var(--sb-icon-size);
        font-size:18px;
        line-height:1;
        padding:0;
        margin:0;
        z-index:1;
      }

      :where(html.aic-layout-refactor) .app-sidebar__profile-body{
        min-width:0;
        flex:1 1 auto;
        display:flex;
        flex-direction:column;
        justify-content:center;
        overflow:hidden;
        max-height:44px;
        transition:opacity .12s ease, width .12s ease, max-width .12s ease;
        z-index:1;
        transform-origin:left center;
      }

      :where(html.aic-layout-refactor) .app-sidebar__profile-name{
        font-size:13px;
        font-weight:700;
        color:var(--sb-text);
        line-height:1.2;
        white-space:nowrap;
        overflow:hidden;
        text-overflow:ellipsis;
        text-shadow:none;
      }

      :where(html.aic-layout-refactor) .app-sidebar__profile-meta{
        margin-top:4px;
        display:flex;
        flex-wrap:nowrap;
        gap:5px;
        align-items:center;
        min-width:0;
        overflow:hidden;
      }

      :where(html.aic-layout-refactor) .app-sidebar__role,
:where(html.aic-layout-refactor) .app-sidebar__user-id{
        display:inline-flex;
        align-items:center;
        min-height:18px;
        padding:0 6px;
        border-radius:999px;
        font-size:9px;
        font-weight:700;
        letter-spacing:.03em;
        white-space:nowrap;
        backdrop-filter:blur(10px);
        -webkit-backdrop-filter:blur(10px);
        box-shadow:var(--ui-shadow-sm);
        flex:0 0 auto;
      }

      :where(html.aic-layout-refactor) .app-sidebar__role{
        background:transparent;
        color:var(--sb-accent);
        border:1px solid rgba(31,41,55,.12);
      }

      :where(html.aic-layout-refactor) .app-sidebar__user-id{
        background:transparent;
        color:#475569;
        border:1px solid rgba(255,255,255,.78);
      }

      :where(html.aic-layout-refactor) .app-sidebar__section-label-wrap{
        min-height:18px;
        display:flex;
        align-items:center;
        flex:0 0 auto;
        width:100%;
      }

      :where(html.aic-layout-refactor) .app-sidebar__section-label{
        margin:0 4px;
        padding:0 8px;
        font-size:11px;
        font-weight:700;
        letter-spacing:.08em;
        text-transform:uppercase;
        color:#94a3b8;
        line-height:1.2;
        white-space:nowrap;
        overflow:hidden;
        text-shadow:none;
        transition:opacity .12s ease;
      }

      :where(html.aic-layout-refactor) .app-sidebar__menu{
        list-style:none;
        padding:0 2px 8px 0;
        margin:0;
        display:flex;
        flex-direction:column;
        gap:0;
        overflow:auto;
        min-height:0;
        flex:1 1 auto;
        width:100%;
        align-items:flex-start;
      }

      :where(html.aic-layout-refactor) .app-sidebar__menu::-webkit-scrollbar{
        width:8px;
      }

      :where(html.aic-layout-refactor) .app-sidebar__menu::-webkit-scrollbar-thumb{
        background:transparent;
        border-radius:999px;
      }

      :where(html.aic-layout-refactor) .app-sidebar__item{
        position:relative;
        width:100%;
        border-bottom:none;
      }

      :where(html.aic-layout-refactor) .app-sidebar__item:first-child{
        border-top:none;
      }

      :where(html.aic-layout-refactor) .app-sidebar__developer-section{
        width:100%;
        min-height:30px;
        margin:8px 0 2px;
        padding:10px 0 0;
        border-top:1px solid var(--ui-color-border);
        display:flex;
        align-items:flex-end;
        flex:0 0 auto;
      }

      :where(html.aic-layout-refactor) .app-sidebar__developer-section-label{
        margin:0 4px;
        padding:0 8px;
        color:#64748b;
        text-shadow:none;
      }

      :where(html.aic-layout-refactor) .app-sidebar__link{
        width:100%;
        max-width:100%;
        color:var(--sb-text);
        font-size:13px;
        font-weight:700;
        line-height:1;
        text-decoration:none;
        user-select:none;
        cursor:pointer;
        white-space:nowrap;
        position:relative;
        transition:
          transform .08s ease,
          background .18s ease,
          box-shadow .18s ease,
          color .18s ease,
          opacity .18s ease;
        display:flex;
        align-items:center;
        justify-content:flex-start;
        gap:var(--sb-link-gap);
        overflow:hidden;
        align-self:flex-start;
        margin:0;
        min-height:var(--sb-button-height);
        padding:9px var(--sb-link-pad-x);
        border:none;
        border-radius:10px;
        background:transparent;
        box-shadow:none;
        transform:none;
        opacity:1;
        z-index:0;
      }

      :where(html.aic-layout-refactor) .app-sidebar__link:hover{
        background:transparent;
        box-shadow:none;
        transform:none;
      }

      :where(html.aic-layout-refactor) .app-sidebar__link:active{
        transform:translateY(1px);
        background:transparent;
        box-shadow:
          var(--ui-shadow-input);
      }

      :where(html.aic-layout-refactor) .app-sidebar__link:focus-visible{
        outline:none;
        box-shadow:var(--ui-focus-ring);
        opacity:1;
      }

      :where(html.aic-layout-refactor) .app-sidebar__link--active{
        background:linear-gradient(
          180deg,
          var(--ui-surface-sidebar-active-top, rgba(226,232,240,.78)),
          var(--ui-surface-sidebar-active-bottom, rgba(241,245,249,.92))
        );
        border:none;
        box-shadow:var(
          --ui-shadow-sidebar-active,
          inset 0 2px 5px rgba(15,23,42,.14),
          inset 0 1px 0 rgba(255,255,255,.74),
          inset 0 -1px 0 rgba(255,255,255,.30)
        );
        transform:translateY(1px);
        color:var(--sb-text);
        z-index:1;
      }

      :where(html.aic-layout-refactor) .app-sidebar__link--active:hover{
        background:linear-gradient(
          180deg,
          var(--ui-surface-sidebar-active-hover-top, rgba(220,228,238,.86)),
          var(--ui-surface-sidebar-active-hover-bottom, rgba(239,244,249,.96))
        );
        box-shadow:var(
          --ui-shadow-sidebar-active-hover,
          inset 0 2px 5px rgba(15,23,42,.16),
          inset 0 1px 0 rgba(255,255,255,.78),
          inset 0 -1px 0 rgba(255,255,255,.32)
        );
        transform:translateY(1px);
      }

      :where(html.aic-layout-refactor) .app-sidebar__link--active .app-sidebar__icon,
:where(html.aic-layout-refactor) .app-sidebar__link--active .app-sidebar__text{
        color:#0f172a;
      }

      :where(html.aic-layout-refactor) .app-sidebar__icon{
        width:var(--sb-icon-size);
        min-width:var(--sb-icon-size);
        height:var(--sb-icon-size);
        display:flex;
        align-items:center;
        justify-content:center;
        margin:0;
        color:var(--ui-color-text);
        font-size:15px;
        line-height:1;
        flex:0 0 var(--sb-icon-size);
      }

      :where(html.aic-layout-refactor) .app-sidebar__text-wrap{
        display:block;
        min-width:0;
        flex:1 1 auto;
        overflow:hidden;
        transform-origin:left center;
        transition:opacity .12s ease, width .12s ease, max-width .12s ease, transform .12s ease;
      }

      :where(html.aic-layout-refactor) .app-sidebar__text-wrap--with-badge{
        display:flex;
        align-items:center;
        justify-content:space-between;
        gap:8px;
      }

      :where(html.aic-layout-refactor) .app-sidebar__text{
        display:block;
        color:var(--sb-text);
        font-size:13px;
        font-weight:700;
        line-height:1.2;
        white-space:nowrap;
        overflow:hidden;
        text-overflow:ellipsis;
        text-shadow:none;
      }

      :where(html.aic-layout-refactor) .app-sidebar__badge{
        display:inline-flex;
        align-items:center;
        justify-content:center;
        min-width:20px;
        height:20px;
        padding:0 6px;
        border-radius:999px;
        background:transparent;
        color:var(--ui-color-text);
        font-size:11px;
        font-weight:700;
        line-height:1;
        box-shadow:none;
        flex:0 0 auto;
      }

      :where(html.aic-layout-refactor) .app-sidebar__badge--error{
        background:transparent;
        box-shadow:none;
      }

      :where(html.aic-layout-refactor) .app-sidebar__badge--error{
        border:0;
        outline:0;
        box-shadow:none;
        padding:0;
        min-width:0;
        height:auto;
        background:transparent;
      }

      :where(html.aic-layout-refactor) .app-sidebar__bottom{
        display:flex;
        flex-direction:column;
        gap:10px;
        padding-top:10px;
        margin-top:auto;
        flex:0 0 auto;
        width:100%;
        align-items:stretch;
        justify-content:center;
      }

      :where(html.aic-layout-refactor) .app-sidebar__logo-box{
        width:100%;
        min-height:var(--sb-logo-open-height);
        padding:0;
        display:flex;
        align-items:center;
        justify-content:center;
      }

      :where(html.aic-layout-refactor) .app-sidebar__logo-surface{
        width:100%;
        min-height:var(--sb-logo-open-height);
        padding:0;
        display:flex;
        align-items:center;
        justify-content:center;
        border-radius:var(--sb-logo-surface-radius);
        position:relative;
        overflow:hidden;
        background:transparent;
        border:0;
        box-shadow:none;
      }

      :where(html.aic-layout-refactor) .app-sidebar__logo-surface::before{
        content:none;
        position:absolute;
        inset:8px;
        border-radius:calc(var(--sb-logo-surface-radius) - 8px);
        background:transparent;
        pointer-events:none;
        opacity:.9;
      }

      :where(html.aic-layout-refactor) .app-sidebar__logo-surface::after{
        content:none;
        position:absolute;
        inset:0;
        border-radius:var(--sb-logo-surface-radius);
        pointer-events:none;
        box-shadow:
          var(--ui-shadow-input);
      }

      :where(html.aic-layout-refactor) .app-sidebar__logo-image{
        position:relative;
        z-index:1;
        display:block;
        width:100%;
        max-width:var(--sb-logo-image-open-max-width);
        max-height:var(--sb-logo-image-open-max-height);
        height:auto;
        object-fit:contain;
        filter: var(--ui-filter-shadow-sm);
        mix-blend-mode:multiply;
      }

      :where(html.aic-layout-refactor) body.sidebar-collapsed .app-sidebar__profile-body,
:where(html.aic-layout-refactor) body.sidebar-collapsed .app-sidebar__brand-text{
        opacity:0;
        width:0;
        max-width:0;
        overflow:hidden;
        pointer-events:none;
        transform:scaleX(.96);
      }

      :where(html.aic-layout-refactor) body.sidebar-collapsed .app-sidebar__section-label{
        opacity:0;
        visibility:hidden;
        pointer-events:none;
      }

      :where(html.aic-layout-refactor) body.sidebar-collapsed .app-sidebar__developer-section{
        min-height:15px;
        margin:7px 0 2px;
        padding:8px 0 0;
      }

      :where(html.aic-layout-refactor) body.sidebar-collapsed .app-sidebar__topbar{
        justify-content:flex-start;
        align-items:flex-start;
        width:100%;
      }

      :where(html.aic-layout-refactor) body.sidebar-collapsed .app-sidebar__profile,
:where(html.aic-layout-refactor) body.sidebar-collapsed .app-sidebar__brand{
        justify-content:center;
        align-items:center;
      }

      :where(html.aic-layout-refactor) body.sidebar-collapsed .app-sidebar__profile{
        width:var(--sb-collapsed-profile-size);
        min-width:var(--sb-collapsed-profile-size);
        max-width:var(--sb-collapsed-profile-size);
        height:var(--sb-collapsed-profile-size);
        min-height:var(--sb-collapsed-profile-size);
        padding:0;
        margin:0;
        gap:0;
        border-radius:var(--ui-radius-md);
        display:flex;
        align-items:center;
        justify-content:center;
      }

      :where(html.aic-layout-refactor) body.sidebar-collapsed .app-sidebar__profile::after{
        border-radius:10px;
      }

      :where(html.aic-layout-refactor) body.sidebar-collapsed .app-sidebar__profile-icon{
        width:var(--sb-icon-size);
        min-width:var(--sb-icon-size);
        height:var(--sb-icon-size);
        flex:0 0 var(--sb-icon-size);
        margin:0;
        align-self:center;
        justify-self:center;
        display:flex;
        align-items:center;
        justify-content:center;
      }

      :where(html.aic-layout-refactor) body.sidebar-collapsed .app-sidebar__menu{
        gap:0;
        padding-top:0;
        margin-top:0;
        width:100%;
        align-items:flex-start;
      }

      :where(html.aic-layout-refactor) body.sidebar-collapsed .app-sidebar__item{
        width:100%;
      }

      :where(html.aic-layout-refactor) body.sidebar-collapsed .app-sidebar__link{
        width:100%;
        min-width:0;
        max-width:none;
        height:var(--sb-collapsed-btn-size);
        min-height:var(--sb-collapsed-btn-size);
        padding:0;
        justify-content:center;
        align-items:center;
        gap:0;
        margin:0;
        display:flex;
        border-radius:8px;
      }

      :where(html.aic-layout-refactor) body.sidebar-collapsed .app-sidebar__text-wrap{
        width:0;
        max-width:0;
        opacity:0;
        transform:scaleX(.96);
        pointer-events:none;
        display:none;
      }

      :where(html.aic-layout-refactor) body.sidebar-collapsed .app-sidebar__icon{
        margin:0;
        flex:0 0 var(--sb-icon-size);
        align-self:center;
        justify-self:center;
        display:flex;
        align-items:center;
        justify-content:center;
      }

      :where(html.aic-layout-refactor) body.sidebar-collapsed .app-sidebar__toggle{
        margin:0;
        left:0;
      }

      :where(html.aic-layout-refactor) body.sidebar-collapsed .app-sidebar__bottom{
        align-items:center;
        justify-content:center;
      }

      :where(html.aic-layout-refactor) body.sidebar-collapsed .app-sidebar__logo-box{
        width:auto;
        min-height:44px;
        padding:6px 0 0;
      }

      :where(html.aic-layout-refactor) body.sidebar-collapsed .app-sidebar__logo-surface{
        width:46px;
        min-width:46px;
        max-width:46px;
        height:46px;
        min-height:46px;
        padding:5px;
        border-radius:var(--sb-logo-surface-radius-collapsed);
        border:0;
        box-shadow:none;
      }

      :where(html.aic-layout-refactor) body.sidebar-collapsed .app-sidebar__logo-surface::before{
        inset:5px;
        border-radius:10px;
      }

      :where(html.aic-layout-refactor) body.sidebar-collapsed .app-sidebar__logo-surface::after{
        border-radius:var(--sb-logo-surface-radius-collapsed);
      }

      :where(html.aic-layout-refactor) body.sidebar-collapsed .app-sidebar__logo-image{
        width:auto;
        max-width:var(--sb-logo-collapsed-size);
        max-height:var(--sb-logo-collapsed-size);
        object-fit:contain;
      }

      :where(html.aic-layout-refactor) .app-sr-only{
        position:absolute;
        width:1px;
        height:1px;
        padding:0;
        margin:-1px;
        overflow:hidden;
        clip:rect(0,0,0,0);
        white-space:nowrap;
        border:0;
      }

      @media (max-width: 1024px){
        html.aic-layout-refactor{
          --sidebar-drawer-w:232px;
        }

        :where(html.aic-layout-refactor) .app-sidebar{
          left:0;
          right:auto;
          inset:0 auto 0 0;
          width:min(var(--sidebar-drawer-w), calc(100vw - 28px - var(--safe-left) - var(--safe-right)));
          transform:translateX(calc(-100% - 20px));
          padding:
            calc(12px + var(--safe-top))
            12px
            calc(12px + var(--safe-bottom))
            calc(12px + var(--safe-left));
          background:var(--ui-surface);
          box-shadow:
            var(--ui-shadow-edge-right);
          border-left:none;
          border-right:1px solid rgba(255,255,255,.65);
        }

        :where(html.aic-layout-refactor) body.sidebar-collapsed .app-sidebar{
          width:min(var(--sidebar-drawer-w), calc(100vw - 28px - var(--safe-left) - var(--safe-right)));
          padding:
            calc(12px + var(--safe-top))
            12px
            calc(12px + var(--safe-bottom))
            calc(12px + var(--safe-left));
        }

        :where(html.aic-layout-refactor) .app-sidebar.is-mobile-open{
          transform:translateX(0);
        }

        :where(html.aic-layout-refactor) .layout-sidebar-shell > .app-sidebar__backdrop{
          display:block;
          position:fixed;
          inset:0;
          background:rgba(15,23,42,.24);
          opacity:0;
          visibility:hidden;
          pointer-events:none;
          transition:opacity .22s ease, visibility .22s ease;
          z-index:1398;
        }

        :where(html.aic-layout-refactor) .app-sidebar.is-mobile-open + .app-sidebar__backdrop{
          opacity:1;
          visibility:visible;
          pointer-events:auto;
        }

        :where(html.aic-layout-refactor) .app-sidebar.is-mobile-open{
          z-index:1399;
        }

        :where(html.aic-layout-refactor) .app-sidebar__mobile-toggle{
          display:grid;
          place-items:center;
        }

        :where(html.aic-layout-refactor) .app-sidebar.is-mobile-open ~ .app-sidebar__mobile-toggle{
          display:none;
        }

        :where(html.aic-layout-refactor) .app-sidebar__topbar{
          display:flex;
          align-items:center;
          justify-content:flex-start;
          gap:12px;
          min-height:var(--sb-toggle-size);
          height:var(--sb-toggle-size);
          padding:0 0 2px;
        }

        :where(html.aic-layout-refactor) .app-sidebar__toggle{
          display:grid;
        }

        :where(html.aic-layout-refactor) .app-sidebar__topbar .office-switcher{
          display:block !important;
          width:100% !important;
          min-width:0 !important;
          max-width:none !important;
          height:var(--sb-toggle-size) !important;
          opacity:1 !important;
          overflow:visible !important;
          pointer-events:auto !important;
          flex:1 1 auto !important;
        }

        :where(html.aic-layout-refactor) .app-sidebar__topbar .office-switcher__trigger,
:where(html.aic-layout-refactor) .app-sidebar__topbar .office-switcher__static{
          height:var(--sb-toggle-size);
          min-height:var(--sb-toggle-size);
        }

        :where(html.aic-layout-refactor) .app-sidebar__inner{
          padding-top:0;
        }

        :where(html.aic-layout-refactor) body.sidebar-collapsed .app-sidebar__profile-body,
:where(html.aic-layout-refactor) body.sidebar-collapsed .app-sidebar__text-wrap{
          display:block;
          opacity:1;
          width:auto;
          max-width:none;
          overflow:visible;
          pointer-events:auto;
          transform:none;
        }

        :where(html.aic-layout-refactor) body.sidebar-collapsed .app-sidebar__section-label{
          opacity:1;
          visibility:visible;
          pointer-events:auto;
        }

        :where(html.aic-layout-refactor) body.sidebar-collapsed .app-sidebar__developer-section{
          min-height:30px;
          margin:8px 0 2px;
          padding:10px 0 0;
        }

        :where(html.aic-layout-refactor) body.sidebar-collapsed .app-sidebar__profile{
          width:100%;
          min-width:0;
          max-width:100%;
          height:auto;
          min-height:68px;
          justify-content:flex-start;
          align-items:center;
          padding:12px 14px;
          margin:0;
          gap:10px;
          border-radius:20px;
          display:flex;
        }

        :where(html.aic-layout-refactor) body.sidebar-collapsed .app-sidebar__profile::after{
          border-radius:var(--ui-radius-xl);
        }

        :where(html.aic-layout-refactor) body.sidebar-collapsed .app-sidebar__link{
          width:100%;
          min-width:0;
          max-width:100%;
          height:auto;
          min-height:var(--sb-button-height);
          padding:9px var(--sb-link-pad-x);
          justify-content:flex-start;
          gap:var(--sb-link-gap);
          margin:0;
          display:flex;
          border-radius:10px;
        }

        :where(html.aic-layout-refactor) body.sidebar-collapsed .app-sidebar__logo-box{
          width:100%;
          min-height:var(--sb-logo-open-height);
          padding:0;
        }

        :where(html.aic-layout-refactor) body.sidebar-collapsed .app-sidebar__logo-surface{
          width:100%;
          min-width:0;
          max-width:100%;
          height:auto;
          min-height:var(--sb-logo-open-height);
          padding:0;
          border-radius:var(--sb-logo-surface-radius);
        }

        :where(html.aic-layout-refactor) body.sidebar-collapsed .app-sidebar__logo-image{
          width:100%;
          max-width:var(--sb-logo-image-open-max-width);
          max-height:var(--sb-logo-image-open-max-height);
        }

        :where(html.aic-layout-refactor) body.sidebar-mobile-open{
          overflow:hidden;
        }
      }

      @media (max-width: 640px){
        html.aic-layout-refactor{
          --sidebar-drawer-w:232px;
          --sb-toggle-size:44px;
          --sb-button-height:44px;
          --sb-collapsed-btn-size:44px;
          --sb-collapsed-profile-size:44px;
          --sb-logo-open-height:78px;
          --sb-logo-image-open-max-height:70px;
        }

        :where(html.aic-layout-refactor) .app-sidebar{
          padding:
            calc(10px + var(--safe-top))
            10px
            calc(10px + var(--safe-bottom))
            calc(10px + var(--safe-left));
        }

        :where(html.aic-layout-refactor) .app-sidebar__mobile-toggle{
          top:calc(12px + var(--safe-top));
          left:calc(12px + var(--safe-left));
          right:auto;
          width:var(--sb-toggle-size);
          height:var(--sb-toggle-size);
          min-width:var(--sb-toggle-size);
          min-height:var(--sb-toggle-size);
        }

        :where(html.aic-layout-refactor) .app-sidebar__inner{
          padding-top:0;
        }

        :where(html.aic-layout-refactor) .app-sidebar__profile{
          min-height:64px;
        }

        :where(html.aic-layout-refactor) .app-sidebar__link{
          min-height:var(--sb-button-height);
          padding:8px var(--sb-link-pad-x);
        }

        :where(html.aic-layout-refactor) .app-sidebar__logo-surface{
          padding:0;
        }
      }

/* ============================================================
   Office switcher
   Source: app/views/layouts/_office_switcher.html.erb
   ============================================================ */

:where(html.aic-layout-refactor) .office-switcher,
:where(html.aic-layout-refactor) .office-switcher *{
  box-sizing:border-box;
}

:where(html.aic-layout-refactor) .office-switcher{
  position:relative;
  width:100%;
  min-width:0;
  flex:1 1 auto;
}

:where(html.aic-layout-refactor) .office-switcher__trigger,
:where(html.aic-layout-refactor) .office-switcher__static{
  appearance:none;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:8px;
  width:100%;
  min-width:0;
  height:48px;
  min-height:48px;
  padding:0 12px;
  border:none;
  border-radius:14px;
  color:var(--ui-color-text);
  background:transparent;
  box-shadow:none;
  line-height:1;
  text-align:left;
  text-decoration:none;
}

:where(html.aic-layout-refactor) .office-switcher__trigger{
  cursor:pointer;
  transition:
    background .18s ease,
    color .18s ease;
}

:where(html.aic-layout-refactor) .office-switcher__trigger:hover{
  background:transparent;
  color:var(--ui-color-text);
}

:where(html.aic-layout-refactor) .office-switcher__trigger:active{
  background:transparent;
}

:where(html.aic-layout-refactor) .office-switcher__trigger:focus-visible{
  outline:none;
  box-shadow:var(--ui-focus-ring);
}

:where(html.aic-layout-refactor) .office-switcher__trigger > i:first-child,
:where(html.aic-layout-refactor) .office-switcher__static > i:first-child{
  color:var(--ui-color-text);
  font-size:15px;
  line-height:1;
  flex:0 0 var(--sb-icon-size, 18px);
  width:var(--sb-icon-size, 18px);
  min-width:var(--sb-icon-size, 18px);
  display:flex;
  align-items:center;
  justify-content:center;
}

:where(html.aic-layout-refactor) .office-switcher__trigger-body{
  display:grid;
  min-width:0;
  flex:1 1 auto;
}

:where(html.aic-layout-refactor) .office-switcher__trigger-name{
  overflow:hidden;
  color:var(--ui-color-text);
  font-size:13px;
  font-weight:700;
  line-height:1.2;
  white-space:nowrap;
  text-overflow:ellipsis;
}

:where(html.aic-layout-refactor) .office-switcher__trigger-chevron{
  color:var(--ui-color-text);
  font-size:12px;
  line-height:1;
  flex:0 0 auto;
}

:where(html.aic-layout-refactor) .office-switcher-modal{
  position:fixed;
  inset:0;
  z-index:99999;
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
}

:where(html.aic-layout-refactor) .office-switcher-modal.is-open{
  display:flex;
}

:where(html.aic-layout-refactor) .office-switcher-modal__backdrop{
  position:absolute;
  inset:0;
  background:rgba(15,23,42,.46);
  backdrop-filter:blur(4px);
}

:where(html.aic-layout-refactor) .office-switcher-modal__panel{
  position:relative;
  z-index:1;
  width:min(720px, 100%);
  max-height:86vh;
  overflow:hidden;
  border:1px solid var(--border, #e5e7eb);
  border-radius:20px;
  background:var(--ui-surface);
  box-shadow:var(--ui-shadow-lg);
}

:where(html.aic-layout-refactor) .office-switcher-modal__header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 16px;
  border-bottom:1px solid var(--border, #e5e7eb);
  background:var(--ui-surface);
}

:where(html.aic-layout-refactor) .office-switcher-modal__title{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
  margin:0;
  color:#0f172a;
  font-size:15px;
  font-weight:700;
  line-height:1.4;
}

:where(html.aic-layout-refactor) .office-switcher-modal__title i{
  color:var(--ui-color-text);
  font-size:14px;
  flex:0 0 auto;
}

:where(html.aic-layout-refactor) .office-switcher-modal__close{
  appearance:none;
  display:flex;
  align-items:center;
  justify-content:center;
  width:36px;
  height:36px;
  border:1px solid var(--border, #e5e7eb);
  border-radius:999px;
  color:#334155;
  background:transparent;
  cursor:pointer;
  flex:0 0 auto;
  transition:
    transform .16s ease,
    box-shadow .16s ease,
    background .16s ease,
    border-color .16s ease;
}

:where(html.aic-layout-refactor) .office-switcher-modal__close:hover{
  transform:translateY(-1px);
  border-color:#cbd5e1;
  background:transparent;
  box-shadow:var(--ui-shadow-sm);
}

:where(html.aic-layout-refactor) .office-switcher-modal__close:focus-visible{
  outline:none;
  box-shadow:var(--ui-focus-ring);
}

:where(html.aic-layout-refactor) .office-switcher-modal__body{
  max-height:calc(86vh - 65px);
  overflow:auto;
  padding:16px;
}

:where(html.aic-layout-refactor) .office-switcher-modal__list{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:10px;
}

:where(html.aic-layout-refactor) .office-switcher-option-form{
  min-width:0;
  margin:0;
}

:where(html.aic-layout-refactor) .office-switcher-option{
  appearance:none;
  display:flex;
  align-items:center;
  gap:10px;
  width:100%;
  min-width:0;
  min-height:56px;
  padding:12px;
  border:1px solid var(--border, #e5e7eb);
  border-radius:var(--ui-radius-lg);
  background:transparent;
  color:#0f172a;
  text-align:left;
  cursor:pointer;
  transition:
    transform .16s ease,
    box-shadow .16s ease,
    border-color .16s ease,
    background .16s ease;
}

:where(html.aic-layout-refactor) .office-switcher-option:hover{
  transform:translateY(-1px);
  border-color:#cbd5e1;
  background:transparent;
  box-shadow:var(--ui-shadow-sm);
}

:where(html.aic-layout-refactor) .office-switcher-option.is-active{
  border-color:#bfdbfe;
  background:transparent;
  cursor:default;
}

:where(html.aic-layout-refactor) .office-switcher-option:disabled{
  opacity:1;
}

:where(html.aic-layout-refactor) .office-switcher-option__mark{
  display:flex;
  align-items:center;
  justify-content:center;
  width:28px;
  height:28px;
  border:1px solid var(--border, #e5e7eb);
  border-radius:999px;
  color:var(--ui-color-text);
  background:transparent;
  flex:0 0 auto;
}

:where(html.aic-layout-refactor) .office-switcher-option.is-active .office-switcher-option__mark{
  color:#2563eb;
  border-color:#bfdbfe;
  background:transparent;
}

:where(html.aic-layout-refactor) .office-switcher-option__body{
  display:block;
  min-width:0;
  flex:1 1 auto;
}

:where(html.aic-layout-refactor) .office-switcher-option__body strong{
  display:block;
  overflow:hidden;
  color:#0f172a;
  font-size:14px;
  font-weight:700;
  line-height:1.4;
  white-space:nowrap;
  text-overflow:ellipsis;
}

:where(html.aic-layout-refactor) .office-switcher-modal-open{
  overflow:hidden;
}

:where(html.aic-layout-refactor) body.sidebar-collapsed .office-switcher{
  width:0;
  min-width:0;
  max-width:0;
  opacity:0;
  overflow:hidden;
  pointer-events:none;
}

@media (max-width:768px){
  :where(html.aic-layout-refactor) .office-switcher{
    flex:1 1 auto;
  }

  :where(html.aic-layout-refactor) .office-switcher-modal{
    padding:12px;
  }

  :where(html.aic-layout-refactor) .office-switcher-modal__panel{
    width:100%;
    max-height:88vh;
    border-radius:var(--ui-radius-xl);
  }

  :where(html.aic-layout-refactor) .office-switcher-modal__header{
    padding:13px 14px;
  }

  :where(html.aic-layout-refactor) .office-switcher-modal__title{
    font-size:14px;
  }

  :where(html.aic-layout-refactor) .office-switcher-modal__body{
    max-height:calc(88vh - 63px);
    padding:14px;
  }

  :where(html.aic-layout-refactor) .office-switcher-modal__list{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }

  :where(html.aic-layout-refactor) .office-switcher-option{
    min-height:52px;
    padding:10px;
  }

  :where(html.aic-layout-refactor) .office-switcher-option__body strong{
    font-size:13px;
  }
}

@media (max-width:480px){
  :where(html.aic-layout-refactor) .office-switcher-modal__list{
    grid-template-columns:1fr;
  }
}

/* ============================================================
   Dashboard mini sidebar
   Source: app/views/my/dashboard/_mini_sidebar.html.erb
   ============================================================ */

:where(html.aic-layout-refactor) .dashboard-mini-sidebar__backdrop,
:where(html.aic-layout-refactor) .dashboard-mini-sidebar,
:where(html.aic-layout-refactor) .dashboard-mini-sidebar *{
  box-sizing:border-box;
}

:where(html.aic-layout-refactor) .dashboard-mini-sidebar{
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

:where(html.aic-layout-refactor) .dashboard-mini-sidebar__backdrop{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.10);
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transition:opacity .22s ease, visibility .22s ease;
  z-index:1088;
}

:where(html.aic-layout-refactor) .dashboard-mini-sidebar{
  position:fixed;
  top:calc(88px + var(--safe-top));
  right:calc(16px + var(--safe-right));
  left:auto;
  width:min(18vw, 220px);
  min-width:180px;
  max-height:calc(100dvh - 104px - var(--safe-top) - var(--safe-bottom));
  padding:
    12px
    12px
    calc(12px + var(--safe-bottom))
    12px;
  color:var(--ui-color-text);
  border-radius:24px;
  border:1px solid rgba(255,255,255,.72);
  background:var(--ui-surface);
  box-shadow:
    var(--ui-shadow-edge-right);
  backdrop-filter:blur(24px) saturate(155%);
  -webkit-backdrop-filter:blur(24px) saturate(155%);
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transform:translateY(-8px) scale(.98);
  transition:
    opacity .18s ease,
    visibility .18s ease,
    transform .18s ease;
  z-index:1089;
  overflow:hidden;
}

:where(html.aic-layout-refactor) .dashboard-mini-sidebar.is-open{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
  transform:translateY(0) scale(1);
}

:where(html.aic-layout-refactor) .dashboard-mini-sidebar__backdrop.is-open{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
}

:where(html.aic-layout-refactor) .dashboard-mini-sidebar__inner{
  height:100%;
  display:flex;
  flex-direction:column;
  gap:10px;
  min-height:0;
  align-items:flex-start;
  padding-top:0;
}

:where(html.aic-layout-refactor) .dashboard-mini-sidebar__header{
  width:100%;
  display:flex;
  align-items:flex-start;
  gap:8px;
}

:where(html.aic-layout-refactor) .dashboard-mini-sidebar__profile{
  flex:1 1 auto;
  display:flex;
  align-items:flex-start;
  gap:10px;
  min-height:68px;
  width:100%;
  max-width:100%;
  padding:12px 14px;
  border-radius:20px;
  background:transparent;
  border:1px solid rgba(255,255,255,.70);
  box-shadow:
    var(--ui-shadow-edge-top);
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
  position:relative;
  overflow:visible;
}

:where(html.aic-layout-refactor) .dashboard-mini-sidebar__profile::after{
  content:"";
  position:absolute;
  inset:1px;
  border-radius:var(--ui-radius-xl);
  pointer-events:none;
  box-shadow:
    var(--ui-ring-info);
  opacity:.9;
}

:where(html.aic-layout-refactor) .dashboard-mini-sidebar__profile-icon{
  width:18px;
  min-width:18px;
  height:18px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:var(--ui-color-text);
  font-size:18px;
  line-height:1;
  z-index:1;
  margin-top:2px;
}

:where(html.aic-layout-refactor) .dashboard-mini-sidebar__profile-body{
  min-width:0;
  flex:1 1 auto;
  display:flex;
  flex-direction:column;
  justify-content:center;
  overflow:visible;
  max-height:none;
  z-index:1;
}

:where(html.aic-layout-refactor) .dashboard-mini-sidebar__profile-name{
  font-size:13px;
  font-weight:700;
  color:var(--ui-color-text);
  line-height:1.3;
  white-space:normal;
  overflow:visible;
  text-overflow:clip;
  word-break:break-word;
  text-shadow:
    -1px 0 rgba(15,23,42,.14),
    1px 0 rgba(255,255,255,.72),
    0 1px 0 rgba(255,255,255,.96),
    0 8px 18px rgba(31,41,55,.10);
}

:where(html.aic-layout-refactor) .dashboard-mini-sidebar__profile-meta{
  margin-top:6px;
  display:flex;
  flex-wrap:wrap;
  gap:5px;
  align-items:center;
  min-width:0;
  overflow:visible;
}

:where(html.aic-layout-refactor) .dashboard-mini-sidebar__role,
:where(html.aic-layout-refactor) .dashboard-mini-sidebar__user-id{
  display:inline-flex;
  align-items:center;
  min-height:18px;
  padding:0 6px;
  border-radius:999px;
  font-size:9px;
  font-weight:700;
  letter-spacing:.03em;
  white-space:normal;
  word-break:break-word;
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  box-shadow:var(--ui-shadow-sm);
  flex:0 1 auto;
  max-width:100%;
}

:where(html.aic-layout-refactor) .dashboard-mini-sidebar__role{
  background:transparent;
  color:var(--ui-color-text);
  border:1px solid rgba(31,41,55,.12);
}

:where(html.aic-layout-refactor) .dashboard-mini-sidebar__user-id{
  background:transparent;
  color:#475569;
  border:1px solid rgba(255,255,255,.78);
}

:where(html.aic-layout-refactor) .dashboard-mini-sidebar__section-label{
  margin:0 4px;
  padding:0 8px;
  font-size:11px;
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:#94a3b8;
  line-height:1.2;
  white-space:nowrap;
  overflow:hidden;
  text-shadow:0 1px 0 rgba(255,255,255,.78);
}

:where(html.aic-layout-refactor) .dashboard-mini-sidebar__nav{
  min-height:0;
  flex:1 1 auto;
  width:100%;
  overflow:hidden;
}

:where(html.aic-layout-refactor) .dashboard-mini-sidebar__menu{
  list-style:none;
  margin:0;
  padding:0 0 8px;
  display:flex;
  flex-direction:column;
  gap:0;
  overflow:auto;
  max-height:100%;
  width:100%;
}

:where(html.aic-layout-refactor) .dashboard-mini-sidebar__menu::-webkit-scrollbar{
  width:8px;
}

:where(html.aic-layout-refactor) .dashboard-mini-sidebar__menu::-webkit-scrollbar-thumb{
  background:transparent;
  border-radius:999px;
}

:where(html.aic-layout-refactor) .dashboard-mini-sidebar__item{
  width:100%;
}

:where(html.aic-layout-refactor) .dashboard-mini-sidebar__link{
  width:100%;
  max-width:100%;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:8px;
  min-height:44px;
  padding:9px 10px;
  border:none;
  border-radius:10px;
  background:transparent;
  box-shadow:none;
  color:var(--ui-color-text);
  text-decoration:none;
  font-size:13px;
  font-weight:700;
  line-height:1;
  cursor:pointer;
  appearance:none;
  -webkit-appearance:none;
  transition:
    transform .08s ease,
    background .18s ease,
    box-shadow .18s ease,
    color .18s ease;
}

:where(html.aic-layout-refactor) .dashboard-mini-sidebar__link:hover{
  background:transparent;
  box-shadow:none;
  transform:none;
}

:where(html.aic-layout-refactor) .dashboard-mini-sidebar__link:active{
  transform:translateY(1px);
  background:transparent;
  box-shadow:
    var(--ui-shadow-input);
}

:where(html.aic-layout-refactor) .dashboard-mini-sidebar__link:focus-visible{
  outline:none;
  box-shadow:var(--ui-focus-ring);
}

:where(html.aic-layout-refactor) .dashboard-mini-sidebar__icon{
  width:18px;
  min-width:18px;
  height:18px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:var(--ui-color-text);
  font-size:15px;
  line-height:1;
  flex:0 0 18px;
}

:where(html.aic-layout-refactor) .dashboard-mini-sidebar__text{
  display:block;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:13px;
  font-weight:700;
  line-height:1.2;
  color:var(--ui-color-text);
  text-shadow:
    0 1px 0 rgba(255,255,255,.90),
    0 4px 10px rgba(31,41,55,.06);
}

:where(html.aic-layout-refactor) .dashboard-mini-sidebar__footer{
  width:100%;
  padding-top:10px;
  margin-top:auto;
}

:where(html.aic-layout-refactor) .dashboard-mini-sidebar__logo-box{
  width:100%;
  min-height:88px;
  display:flex;
  align-items:center;
  justify-content:center;
}

:where(html.aic-layout-refactor) .dashboard-mini-sidebar__logo-surface{
  width:100%;
  min-height:88px;
  padding:14px 14px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:22px;
  position:relative;
  overflow:hidden;
  background:transparent;
  border:1px solid rgba(255,255,255,.74);
  box-shadow:
    var(--ui-ring-info), var(--ui-shadow-xs);
}

:where(html.aic-layout-refactor) .dashboard-mini-sidebar__logo-surface::before{
  content:"";
  position:absolute;
  inset:8px;
  border-radius:14px;
  background:transparent;
  pointer-events:none;
  opacity:.9;
}

:where(html.aic-layout-refactor) .dashboard-mini-sidebar__logo-surface::after{
  content:"";
  position:absolute;
  inset:0;
  border-radius:22px;
  pointer-events:none;
  box-shadow:
    var(--ui-shadow-input);
}

:where(html.aic-layout-refactor) .dashboard-mini-sidebar__logo-image{
  position:relative;
  z-index:1;
  display:block;
  width:100%;
  max-width:100%;
  max-height:58px;
  height:auto;
  object-fit:contain;
  filter: var(--ui-filter-shadow-sm);
  mix-blend-mode:multiply;
}

@media (max-width: 1024px){
  :where(html.aic-layout-refactor) .dashboard-mini-sidebar__backdrop{
    display:block;
  }

  :where(html.aic-layout-refactor) body.dashboard-mini-sidebar-open{
    overflow:hidden;
  }
}

@media (max-width: 640px){
  :where(html.aic-layout-refactor) .dashboard-mini-sidebar{
    top:calc(88px + var(--safe-top));
    right:calc(12px + var(--safe-right));
    left:auto;
    width:min(56vw, 220px);
    min-width:180px;
    max-height:calc(100dvh - 104px - var(--safe-top) - var(--safe-bottom));
    height:auto;
    padding:
      12px
      12px
      calc(12px + var(--safe-bottom))
      12px;
    border-radius:24px;
    border:1px solid rgba(255,255,255,.72);
  }
}

/* ============================================================
   Profile modal
   Source: app/views/my/dashboard/_profile_modal.html.erb
   ============================================================ */

:where(html.aic-layout-refactor) .profile-modal{
  position:fixed;
  inset:0;
  z-index:9998;
  display:none;
}

:where(html.aic-layout-refactor) .profile-modal.is-open{
  display:block;
}

:where(html.aic-layout-refactor) .profile-modal__backdrop{
  position:absolute;
  inset:0;
  background:rgba(15, 23, 42, .36);
  backdrop-filter:blur(2px);
}

:where(html.aic-layout-refactor) .profile-modal__dialog{
  position:absolute;
  top:50%;
  left:50%;
  width:min(560px, calc(100vw - 24px));
  max-height:calc(100vh - 24px);
  transform:translate(-50%, -50%);
  background:var(--ui-surface);
  border:1px solid #e5e7eb;
  border-radius:var(--ui-radius-xl);
  box-shadow:var(--ui-shadow-lg);
  overflow:hidden;
}

:where(html.aic-layout-refactor) .profile-modal__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 16px;
  border-bottom:1px solid #e5e7eb;
}

:where(html.aic-layout-refactor) .profile-modal__head-actions{
  display:flex;
  align-items:center;
  gap:8px;
}

:where(html.aic-layout-refactor) .profile-modal__title{
  display:flex;
  align-items:center;
  gap:8px;
  margin:0;
  font-size:16px;
  font-weight:700;
  color:#1e2a3c;
}

:where(html.aic-layout-refactor) .profile-modal__title i{
  color:#3a69a8;
}

:where(html.aic-layout-refactor) .profile-modal__close{
  width:34px;
  height:34px;
  border-radius:10px;
  border:1px solid #dbe4f2;
  background:transparent;
  color:#375a7f;
  cursor:pointer;
}

:where(html.aic-layout-refactor) .profile-modal__body{
  padding:12px 16px 14px;
  overflow:auto;
  max-height:calc(100vh - 110px);
}

:where(html.aic-layout-refactor) .profile-modal__footer{
  margin-top:18px;
  padding-top:16px;
  border-top:1px solid rgba(15, 23, 42, .08);
}

:where(html.aic-layout-refactor) .profile-modal__footer form{
  margin:0;
}

:where(html.aic-layout-refactor) .profile-modal__logout-btn{
  width:100%;
  justify-content:center;
}

:where(html.aic-layout-refactor) .profile-modal .kv{
  margin:0;
}

:where(html.aic-layout-refactor) .profile-modal .kv--modal .kv__row{
  padding:6px 0;
}

:where(html.aic-layout-refactor) .profile-modal .kv__row{
  display:grid;
  grid-template-columns:8.5rem 1fr;
  gap:8px;
  padding:9px 0;
  border-top:1px dashed #e5e7eb;
}

:where(html.aic-layout-refactor) .profile-modal .kv__row:first-child{
  border-top:0;
  padding-top:2px;
}

:where(html.aic-layout-refactor) .profile-modal .kv dt{
  color:#6b7280;
  font-weight:700;
  font-size:12.5px;
  display:flex;
  align-items:center;
}

:where(html.aic-layout-refactor) .profile-modal .kv dd{
  margin:0;
  font-size:13px;
  line-height:1.3;
  word-break:break-word;
  display:flex;
  align-items:center;
  gap:8px;
  min-height:28px;
}

:where(html.aic-layout-refactor) .profile-modal .link{
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  gap:6px;
}

:where(html.aic-layout-refactor) .profile-modal .link--plain{
  color:var(--ui-color-text);
}

:where(html.aic-layout-refactor) .profile-modal .link--plain:hover{
  color:var(--ui-color-text);
}

:where(html.aic-layout-refactor) .profile-modal .copy-wrap{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
}

:where(html.aic-layout-refactor) .profile-modal .icon-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:28px;
  height:28px;
  border-radius:8px;
  border:1px solid #dbe4f2;
  background:transparent;
  color:#375a7f;
  cursor:pointer;
  transition:box-shadow .15s ease, transform .06s ease, color .15s ease, border-color .15s ease, background .15s ease;
  flex:0 0 28px;
  text-decoration:none;
}

:where(html.aic-layout-refactor) .profile-modal .icon-btn:hover{
  color:#1f4f8f;
  border-color:#cfdcf2;
  background:transparent;
}

:where(html.aic-layout-refactor) .profile-modal .icon-btn:active{
  transform:translateY(1px);
}

@media (max-width:640px){
  :where(html.aic-layout-refactor) .profile-modal__dialog{
    width:calc(100vw - 16px);
    max-height:calc(100vh - 16px);
  }

  :where(html.aic-layout-refactor) .profile-modal__head{
    flex-direction:row;
    align-items:center;
    justify-content:space-between;
    gap:8px;
    padding:10px 12px;
  }

  :where(html.aic-layout-refactor) .profile-modal__title{
    font-size:14px;
    min-width:0;
  }

  :where(html.aic-layout-refactor) .profile-modal__head-actions{
    flex:0 0 auto;
    justify-content:flex-end;
    gap:6px;
  }

  :where(html.aic-layout-refactor) .profile-modal__close{
    width:30px;
    height:30px;
    border-radius:8px;
  }

  :where(html.aic-layout-refactor) .profile-modal__body{
    padding:8px 12px 10px;
    max-height:calc(100vh - 92px);
  }

  :where(html.aic-layout-refactor) .profile-modal .kv__row{
    grid-template-columns:7rem minmax(0, 1fr);
    gap:6px;
  }

  :where(html.aic-layout-refactor) .profile-modal .kv--modal .kv__row{
    padding:3px 0;
  }

  :where(html.aic-layout-refactor) .profile-modal .kv dt{
    font-size:11.5px;
    line-height:1.1;
    min-width:0;
    white-space:nowrap;
  }

  :where(html.aic-layout-refactor) .profile-modal .kv dd{
    font-size:12px;
    line-height:1.15;
    min-height:26px;
    min-width:0;
  }
}

:where(html.aic-layout-refactor) body.is-modal-open {
  overflow: hidden;
}

/* R62: profile / office selector are one centered, independent stack. */
:where(html.aic-layout-refactor) .app-sidebar__profile {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-height: 70px;
  padding: 6px 8px;
  text-align: center;
}
:where(html.aic-layout-refactor) .app-sidebar__profile-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  max-height: none;
  overflow: visible;
  text-align: center;
  transform-origin: center center;
}
:where(html.aic-layout-refactor) .app-sidebar__profile-name-link {
  display: block;
  max-width: 100%;
  min-width: 0;
  color: var(--sb-text);
  text-align: center;
  text-decoration: none;
  border-radius: var(--ui-radius-sm);
}
:where(html.aic-layout-refactor) .app-sidebar__profile-name-link:hover {
  color: var(--sb-text);
  text-decoration: underline;
  text-underline-offset: 2px;
}
:where(html.aic-layout-refactor) .app-sidebar__profile-name-link:focus-visible {
  outline: none;
  box-shadow: var(--ui-focus-ring);
}
:where(html.aic-layout-refactor) .app-sidebar__profile-name {
  display: block;
  max-width: 100%;
  min-width: 0;
  text-align: center;
}
:where(html.aic-layout-refactor) .app-sidebar__profile .app-sidebar__user-id {
  display: inline-flex;
  align-self: center;
  justify-content: center;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
:where(html.aic-layout-refactor) .app-sidebar__profile .office-switcher {
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  text-align: center;
}
:where(html.aic-layout-refactor) .app-sidebar__profile .office-switcher__trigger,
:where(html.aic-layout-refactor) .app-sidebar__profile .office-switcher__static {
  position: relative;
  justify-content: center;
  width: 100%;
  height: 28px;
  min-height: 28px;
  padding: 0 16px;
  border-radius: var(--ui-radius-sm);
  line-height: 1.2;
  text-align: center;
}
:where(html.aic-layout-refactor) .app-sidebar__profile .office-switcher__trigger {
  background: var(--ui-surface-soft);
}
:where(html.aic-layout-refactor) .app-sidebar__profile .office-switcher__trigger:hover {
  background: var(--ui-surface-muted, var(--ui-surface-soft));
}
:where(html.aic-layout-refactor) .app-sidebar__profile .office-switcher__trigger-body {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  text-align: center;
}
:where(html.aic-layout-refactor) .app-sidebar__profile .office-switcher__trigger-name {
  display: block;
  width: 100%;
  text-align: center;
}
:where(html.aic-layout-refactor) .app-sidebar__profile .office-switcher__trigger-chevron {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
}

/* R63: center the office + ID as a single row below the user name. */
:where(html.aic-layout-refactor) .app-sidebar__profile .app-sidebar__profile-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin-top: 1px;
  overflow: visible;
}
:where(html.aic-layout-refactor) .app-sidebar__profile .app-sidebar__profile-meta .office-switcher {
  flex: 0 1 auto;
  width: auto;
  min-width: 0;
  /* Account ID owns the right edge; only the office name may shrink. */
  max-width: calc(100% - 62px);
}
:where(html.aic-layout-refactor) .app-sidebar__profile .app-sidebar__profile-meta .office-switcher__trigger,
:where(html.aic-layout-refactor) .app-sidebar__profile .app-sidebar__profile-meta .office-switcher__static {
  width: auto;
  max-width: 100%;
  min-width: 0;
  height: 25px;
  min-height: 25px;
  padding-left: 4px;
}
:where(html.aic-layout-refactor) .app-sidebar__profile .app-sidebar__profile-meta .office-switcher__trigger-body {
  min-width: 0;
  width: auto;
}
:where(html.aic-layout-refactor) .app-sidebar__profile .app-sidebar__profile-meta .office-switcher__trigger-name {
  min-width: 0;
  width: auto;
  font-size: 11px;
}
:where(html.aic-layout-refactor) .app-sidebar__profile .app-sidebar__profile-meta .app-sidebar__user-id {
  flex: 0 0 auto;
  min-width: max-content;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  padding: 0 5px;
  font-size: 10px;
}
:where(html.aic-layout-refactor) .app-sidebar__profile .office-switcher__trigger:hover .office-switcher__trigger-name,
:where(html.aic-layout-refactor) .app-sidebar__profile .office-switcher__trigger:focus-visible .office-switcher__trigger-name {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Desktop: the toggle is anchored to the same fixed X/Y in both widths. */
@media (min-width: 1025px) {
  :where(html.aic-layout-refactor) body.sidebar-collapsed .app-sidebar__profile {
    display: none;
  }
  :where(html.aic-layout-refactor) .app-sidebar__bottom,
  :where(html.aic-layout-refactor) body.sidebar-collapsed .app-sidebar__bottom {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    width: 100%;
    min-height: var(--sb-toggle-size);
    padding: 0 0 0 calc(var(--sb-toggle-size) + 8px);
    margin-top: auto;
  }
  :where(html.aic-layout-refactor) .app-sidebar__bottom .app-sidebar__toggle,
  :where(html.aic-layout-refactor) body.sidebar-collapsed .app-sidebar__bottom .app-sidebar__toggle {
    position: fixed;
    left: calc((var(--sidebar-w-collapsed) - var(--sb-toggle-size)) / 2);
    right: auto;
    bottom: calc(12px + var(--safe-bottom));
    top: auto;
    align-self: auto;
    margin: 0;
    transform: none;
    z-index: 1001;
  }
  :where(html.aic-layout-refactor) .app-sidebar__bottom .app-sidebar__toggle:active {
    transform: none;
  }
  :where(html.aic-layout-refactor) .app-sidebar__bottom .app-sidebar__logo-box {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    min-height: var(--sb-toggle-size);
    height: var(--sb-toggle-size);
    padding: 0;
  }
  :where(html.aic-layout-refactor) .app-sidebar__bottom .app-sidebar__logo-surface {
    min-height: var(--sb-toggle-size);
    height: var(--sb-toggle-size);
  }
  :where(html.aic-layout-refactor) .app-sidebar__bottom .app-sidebar__logo-image {
    max-height: 40px;
  }
  :where(html.aic-layout-refactor) body.sidebar-collapsed .app-sidebar__bottom {
    position: relative;
    display: block;
    height: calc(var(--sb-toggle-size) + 10px + 46px);
    min-height: calc(var(--sb-toggle-size) + 10px + 46px);
    padding: 0;
  }
  :where(html.aic-layout-refactor) body.sidebar-collapsed .app-sidebar__bottom .app-sidebar__logo-box {
    position: absolute;
    left: 50%;
    bottom: calc(var(--sb-toggle-size) + 10px);
    transform: translateX(-50%);
    width: 46px;
    min-width: 46px;
    height: 46px;
    min-height: 46px;
    padding: 0;
  }
  :where(html.aic-layout-refactor) body.sidebar-collapsed .app-sidebar__bottom .app-sidebar__logo-surface {
    height: 46px;
    min-height: 46px;
  }
}

/* Mobile is an off-canvas full-width menu even if desktop preference is folded. */
@media (max-width: 1024px) {
  :where(html.aic-layout-refactor) body.sidebar-collapsed .app-sidebar__profile {
    display: flex;
    align-items: center;
    justify-content: center;
    height: auto;
    min-height: 70px;
    padding: 6px 8px;
  }
  :where(html.aic-layout-refactor) body.sidebar-collapsed .app-sidebar__profile-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    max-height: none;
    overflow: visible;
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
  :where(html.aic-layout-refactor) body.sidebar-collapsed .app-sidebar__profile .office-switcher {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    opacity: 1;
    overflow: visible;
    pointer-events: auto;
  }
}

/* R64: mobile must reserve space for the ID even after desktop collapse. */
@media (max-width: 1024px) {
  :where(html.aic-layout-refactor) body.sidebar-collapsed .app-sidebar__profile .app-sidebar__profile-meta .office-switcher {
    flex: 0 1 auto;
    width: auto;
    min-width: 0;
    max-width: calc(100% - 62px);
  }
}

/* Mobile drawer dimensions are independent of the desktop collapsed preference. */
@media (max-width: 1024px) {
  :where(html.aic-layout-refactor) .app-sidebar,
  :where(html.aic-layout-refactor) body.sidebar-collapsed .app-sidebar {
    width: min(var(--sidebar-drawer-w), calc(100vw - 28px - var(--safe-left) - var(--safe-right)));
  }
}

/* R66: keep the account ID INSIDE the office+ID row in the real sidebar.
   The static office label must not occupy the whole row when an ID follows. */
:where(html.aic-layout-refactor) #appSidebar .app-sidebar__profile .app-sidebar__profile-body > .app-sidebar__profile-meta {
  display: flex;
  flex: 0 0 auto;
  align-self: stretch;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin-inline: 0;
  justify-content: center;
  align-items: center;
  gap: 6px;
  overflow: visible;
}
:where(html.aic-layout-refactor) #appSidebar .app-sidebar__profile .app-sidebar__profile-meta > .office-switcher {
  flex: 0 1 auto;
  width: max-content;
  min-width: 0;
  max-width: calc(100% - 63px);
}
:where(html.aic-layout-refactor) #appSidebar .app-sidebar__profile .app-sidebar__profile-meta > .app-sidebar__user-id {
  display: inline-flex;
  flex: 0 0 auto;
  min-width: max-content;
  max-width: none;
  overflow: visible;
  white-space: nowrap;
}

/* R70: Restore the prior soft white profile-card frame only.
   Keep R62/R66 centered identity, office switcher, and R69 drawer geometry. */
:where(html.aic-layout-refactor) .app-sidebar__profile {
  background: #fff;
  border-color: #dce4ee;
  border-radius: 20px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .035), 0 5px 12px rgba(15, 23, 42, .045);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
:where(html.aic-layout-refactor) .app-sidebar__profile--link:hover {
  background: #fff;
  border-color: #cbd5e1;
  box-shadow: 0 2px 7px rgba(15, 23, 42, .09);
}
:where(html.aic-layout-refactor) .app-sidebar__profile::after {
  box-shadow: none;
}
:where(html.aic-layout-refactor) .app-sidebar__profile-name {
  font-size: 11px;
}

/* R73: profile actions are visually compact without shrinking other UI buttons. */
:where(html.aic-layout-refactor) .profile-modal .profile-modal__edit-link {
  box-sizing:border-box; position:relative; min-height:30px; height:30px; padding:2px 9px; font-size:12px; border-width:1px;
}
/* The visual frame is compact, but its effective touch target remains >=44px. */
:where(html.aic-layout-refactor) .profile-modal .profile-modal__edit-link::after {
  content:""; position:absolute; inset:-7px 0;
}
:where(html.aic-layout-refactor) .profile-modal .copy-wrap,
:where(html.aic-layout-refactor) .profile-modal .kv dd { min-width:0; overflow-wrap:anywhere; }
@media (max-width: 1024px) {
  :where(html.aic-layout-refactor) .profile-modal .copy-wrap .copy-btn {
    width:28px; height:28px; min-width:28px; min-height:28px; flex:0 0 28px;
    margin:8px 0; position:relative;
  }
  :where(html.aic-layout-refactor) .profile-modal .copy-wrap .copy-btn::after {
    content:""; position:absolute; inset:-8px;
  }
}
