/* Merchant / platform look, in the spirit of the big cloud consoles: a light sidebar with a pill on the current page, flat cards with a
   hairline border, quiet tables, solid buttons. The accent is the panel's own --primary-* scale (set by the chosen theme).
   Surfaces are styled for light mode; buttons are fine in both. */
:root{--ui-ink:#202124;--ui-sub:#5f6368;--ui-line:#dadce0;--ui-bg:#f8f9fa;--ui-hover:#f1f3f4;--ui-success:#188038;--ui-success-hover:#137333}

/* ---- sidebar: light, a softly rounded highlight on the current page ---- */
html:not(.dark) .fi-sidebar,html:not(.dark) .fi-sidebar-header,html:not(.dark) .fi-sidebar-nav{background:#fff !important}
html:not(.dark) .fi-sidebar{border-right:1px solid var(--ui-line) !important;box-shadow:none !important}
.fi-sidebar-item-btn{border-radius:.375rem}
html:not(.dark) .fi-sidebar-item-btn,html:not(.dark) .fi-sidebar-item-btn .fi-sidebar-item-label{color:#3c4043 !important}
html:not(.dark) .fi-sidebar-item-btn .fi-icon{color:var(--ui-sub) !important}
html:not(.dark) .fi-sidebar-item-btn:hover{background:var(--ui-hover) !important}
html:not(.dark) .fi-sidebar-item.fi-active>.fi-sidebar-item-btn{background:var(--primary-50) !important;box-shadow:none}
html:not(.dark) .fi-sidebar-item.fi-active>.fi-sidebar-item-btn,html:not(.dark) .fi-sidebar-item.fi-active>.fi-sidebar-item-btn .fi-sidebar-item-label,html:not(.dark) .fi-sidebar-item.fi-active>.fi-sidebar-item-btn .fi-icon{color:var(--primary-700) !important;font-weight:600}
.fi-sidebar-group-label{font-size:.7rem;letter-spacing:.07em;text-transform:uppercase;font-weight:600}
html:not(.dark) .fi-sidebar-group-label{color:var(--ui-sub) !important}

/* ---- page ground, top bar, flat cards ---- */
html:not(.dark) body{background:var(--ui-bg);color:var(--ui-ink)}
html:not(.dark) .fi-topbar{background:#fff;box-shadow:0 1px 0 var(--ui-line)}
html:not(.dark) .fi-section,html:not(.dark) .fi-ta-ctn,html:not(.dark) .fi-wi-stats-overview-stat,html:not(.dark) .fi-in-ctn{border-radius:.375rem;box-shadow:0 0 0 1px var(--ui-line) !important}
.fi-header-heading{font-weight:600;letter-spacing:-.01em}
.fi-section-header-heading{font-weight:600}

/* ---- buttons: flat and solid ---- */
.fi-btn{border-radius:.25rem}
.fi-btn.fi-color-primary:not(.fi-outlined){background-color:var(--primary-600) !important;color:#fff !important;box-shadow:none}
.fi-btn.fi-color-primary:not(.fi-outlined):hover{background-color:var(--primary-700) !important}
.fi-btn.fi-color-primary:not(.fi-outlined) .fi-icon,.fi-btn.fi-color-primary:not(.fi-outlined) .fi-btn-label{color:#fff !important}
.fi-btn.fi-color-success:not(.fi-outlined){background-color:var(--ui-success) !important;color:#fff !important;box-shadow:none}
.fi-btn.fi-color-success:not(.fi-outlined):hover{background-color:var(--ui-success-hover) !important}
.fi-btn.fi-color-success:not(.fi-outlined) .fi-icon,.fi-btn.fi-color-success:not(.fi-outlined) .fi-btn-label{color:#fff !important}
html:not(.dark) .fi-btn:not(.fi-color-primary):not(.fi-color-success):not(.fi-color-danger):not(.fi-color-warning){box-shadow:0 0 0 1px var(--ui-line) !important}

/* ---- tables: quiet header, soft row hover ---- */
html:not(.dark) .fi-ta-header-cell{background:var(--ui-bg) !important}
.fi-ta-header-cell-label{font-size:.75rem;font-weight:600}
html:not(.dark) .fi-ta-header-cell-label{color:var(--ui-sub)}
html:not(.dark) .fi-ta-row:hover{background:var(--ui-hover)}

/* ---- inputs: an accent focus ring ---- */
.fi-input-wrp:focus-within{box-shadow:0 0 0 2px var(--primary-600) !important}

/* ---- more buttons: danger / warning solid, secondary with a hairline, round icon buttons ---- */
.fi-btn.fi-color-danger:not(.fi-outlined){background-color:#c5221f !important;color:#fff !important;box-shadow:none}
.fi-btn.fi-color-danger:not(.fi-outlined):hover{background-color:#a50e0e !important}
.fi-btn.fi-color-danger:not(.fi-outlined) .fi-icon,.fi-btn.fi-color-danger:not(.fi-outlined) .fi-btn-label{color:#fff !important}
.fi-btn.fi-color-warning:not(.fi-outlined){background-color:#b06000 !important;color:#fff !important;box-shadow:none}
.fi-btn.fi-color-warning:not(.fi-outlined):hover{background-color:#8f4e00 !important}
.fi-btn.fi-color-warning:not(.fi-outlined) .fi-icon,.fi-btn.fi-color-warning:not(.fi-outlined) .fi-btn-label{color:#fff !important}
.fi-btn{font-weight:500;transition:background-color .12s,box-shadow .12s}
.fi-btn:focus-visible{outline:2px solid var(--primary-600);outline-offset:2px}
html:not(.dark) .fi-btn:not(.fi-color-primary):not(.fi-color-success):not(.fi-color-danger):not(.fi-color-warning):hover{background:var(--ui-bg) !important}
.fi-icon-btn{border-radius:.375rem}
html:not(.dark) .fi-icon-btn:hover{background:var(--ui-hover)}

/* ---- badges: soft tints with a readable dark text, like status chips ---- */
.fi-badge{border-radius:.25rem;font-weight:500}
html:not(.dark) .fi-badge.fi-color-primary{background:var(--primary-50) !important;color:var(--primary-700) !important}
html:not(.dark) .fi-badge.fi-color-success{background:#e6f4ea !important;color:#137333 !important}
html:not(.dark) .fi-badge.fi-color-warning{background:#fef7e0 !important;color:#b06000 !important}
html:not(.dark) .fi-badge.fi-color-danger{background:#fce8e6 !important;color:#c5221f !important}
html:not(.dark) .fi-badge.fi-color-info{background:#e8f0fe !important;color:#1967d2 !important}
html:not(.dark) .fi-badge.fi-color-gray{background:var(--ui-hover) !important;color:#3c4043 !important}

/* ---- fields: hairline border, a darker one on hover, accent ring on focus ---- */
html:not(.dark) .fi-input-wrp{box-shadow:0 0 0 1px var(--ui-line) !important;border-radius:.25rem;background:#fff}
html:not(.dark) .fi-input-wrp:hover{box-shadow:0 0 0 1px #bdc1c6 !important}
.fi-input-wrp:focus-within,html:not(.dark) .fi-input-wrp:focus-within{box-shadow:0 0 0 2px var(--primary-600) !important}
.fi-fo-field-label{font-weight:500}
html:not(.dark) .fi-fo-field-label{color:var(--ui-ink)}
.fi-fo-field-helper-text,.fi-fo-field-wrp-hint{color:var(--ui-sub)}

/* ---- modals, menus, notifications ---- */
html:not(.dark) .fi-modal-window{border-radius:.5rem;box-shadow:0 0 0 1px var(--ui-line),0 24px 48px -12px rgba(32,33,36,.28) !important}
html:not(.dark) .fi-dropdown-panel{border-radius:.375rem;box-shadow:0 0 0 1px var(--ui-line),0 8px 24px rgba(32,33,36,.16) !important}
html:not(.dark) .fi-no-notification{border-radius:.375rem;box-shadow:0 0 0 1px var(--ui-line),0 8px 24px rgba(32,33,36,.16) !important}

/* ---- compact density on desktop (touch screens keep the roomy sizes) ---- */
@media (min-width:768px) and (hover:hover){
  .fi-btn.fi-size-md{padding:.3125rem .75rem !important;font-size:.8125rem}
  .fi-btn.fi-size-lg{padding:.4rem .9rem !important;font-size:.875rem}
  .fi-btn.fi-size-sm{padding:.2rem .55rem !important;font-size:.78rem}
  .fi-input-wrp .fi-input,.fi-input-wrp .fi-select-input{padding-top:.3125rem !important;padding-bottom:.3125rem !important;font-size:.8125rem}
  .fi-ta-cell>*{padding-top:.4rem !important;padding-bottom:.4rem !important}
  .fi-ta-header-cell{padding-top:.5rem !important;padding-bottom:.5rem !important}
}

/* ---- spacing utilities some of our pages use (space-y-N / space-x-N) but the panel's compiled CSS does not contain ---- */
.space-y-1>*+*{margin-top:.25rem}.space-y-2>*+*{margin-top:.5rem}.space-y-3>*+*{margin-top:.75rem}.space-y-4>*+*{margin-top:1rem}
.space-y-5>*+*{margin-top:1.25rem}.space-y-6>*+*{margin-top:1.5rem}.space-y-8>*+*{margin-top:2rem}
.space-x-1>*+*{margin-left:.25rem}.space-x-2>*+*{margin-left:.5rem}.space-x-3>*+*{margin-left:.75rem}.space-x-4>*+*{margin-left:1rem}

/* ---- product page: title, then who the product is, then the action buttons, then the tabs ---- */
.fi-resource-edit-record-page.fi-resource-products .fi-header{flex-direction:column;align-items:stretch;gap:.6rem}
.fi-resource-edit-record-page.fi-resource-products .fi-header>div:first-child{display:contents}
.fi-resource-edit-record-page.fi-resource-products .fi-header .fi-breadcrumbs{order:1}
.fi-resource-edit-record-page.fi-resource-products .fi-header .fi-header-heading{order:2}
.fi-resource-edit-record-page.fi-resource-products .fi-header .pim-ph-info{order:3;margin-bottom:0 !important}
.fi-resource-edit-record-page.fi-resource-products .fi-header .fi-header-actions-ctn{order:4;align-self:flex-start;justify-content:flex-start;width:auto;margin-inline-start:0;margin-inline-end:auto}
.fi-resource-edit-record-page.fi-resource-products .fi-header .fi-header-actions-ctn .fi-ac{justify-content:flex-start}
.fi-resource-edit-record-page.fi-resource-products .fi-header .pim-tabs{order:5;margin-bottom:0}
.fi-resource-edit-record-page.fi-resource-products .fi-header .fi-header-subheading{order:6}

/* ---- page actions: when a page has four or more buttons together they become one toolbar of icons; the label opens on hover / keyboard focus.
   Only buttons that HAVE an icon are collapsed, so a text-only button never disappears. Touch and narrow screens keep the labels. ---- */
.fi-header-actions-ctn .fi-ac:has(> :nth-child(4)){display:inline-flex !important;flex-wrap:wrap;align-items:center;gap:.125rem;padding:.2rem;border:1px solid var(--ui-line);border-radius:.375rem;width:fit-content}
html:not(.dark) .fi-header-actions-ctn .fi-ac:has(> :nth-child(4)){background:#fff}
.fi-header-actions-ctn .fi-ac:has(> :nth-child(4)) .fi-btn{border-radius:.25rem;box-shadow:none !important}
.fi-header-actions-ctn .fi-ac:has(> :nth-child(4)) .fi-btn:not(.fi-color-primary):not(.fi-color-success):not(.fi-color-danger):not(.fi-color-warning),
.fi-header-actions-ctn .fi-ac:has(> :nth-child(4)) .fi-btn.fi-outlined{background:transparent !important}
html:not(.dark) .fi-header-actions-ctn .fi-ac:has(> :nth-child(4)) .fi-btn:not(.fi-color-primary):not(.fi-color-success):not(.fi-color-danger):not(.fi-color-warning):hover,
html:not(.dark) .fi-header-actions-ctn .fi-ac:has(> :nth-child(4)) .fi-btn.fi-outlined:hover{background:var(--ui-hover) !important}
@media (hover:hover) and (min-width:768px){
  .fi-header-actions-ctn .fi-ac:has(> :nth-child(4)) .fi-btn:has(> .fi-icon:not(.fi-loading-indicator)){font-size:0 !important;gap:0 !important;padding:.3125rem .55rem !important;transition:font-size .15s ease,gap .15s ease}
  .fi-header-actions-ctn .fi-ac:has(> :nth-child(4)) .fi-btn:has(> .fi-icon:not(.fi-loading-indicator)):hover,
  .fi-header-actions-ctn .fi-ac:has(> :nth-child(4)) .fi-btn:has(> .fi-icon:not(.fi-loading-indicator)):focus-visible{font-size:.8125rem !important;gap:.4rem !important}
}

/* ---- product page: a few clear buttons with their words (the rest is under ⋮), not the icon toolbar ---- */
html .fi-resource-edit-record-page.fi-resource-products .fi-header-actions-ctn .fi-ac{display:flex !important;flex-wrap:wrap;gap:.5rem;padding:0;border:0;background:transparent !important;width:auto}
html .fi-resource-edit-record-page.fi-resource-products .fi-header-actions-ctn .fi-ac .fi-btn:has(> .fi-icon:not(.fi-loading-indicator)){font-size:.8125rem !important;gap:.4rem !important;padding:.4rem .8rem !important}
html .fi-resource-edit-record-page.fi-resource-products .fi-header-actions-ctn .fi-ac .fi-btn{box-shadow:none}

/* ---- the hand-written buttons inside pages (Photo Studio, Photo settings, Billing…) follow the same look: hairline, small radius, accent instead of amber ---- */
html body :is(.ac-btn,.bl-btn,.cu-btn,.cur-btn,.mb-btn,.pd-btn,.ps-btn,.pst-btn,.si-btn,.pg-btn){border:1px solid var(--ui-line);border-radius:.25rem;font-weight:500;color:inherit}
html:not(.dark) body :is(.ac-btn,.bl-btn,.cu-btn,.cur-btn,.mb-btn,.pd-btn,.ps-btn,.pst-btn,.si-btn,.pg-btn){background:#fff}
html body :is(.ac-btn,.bl-btn,.cu-btn,.cur-btn,.mb-btn,.pd-btn,.ps-btn,.pst-btn,.si-btn,.pg-btn):hover{border-color:#bdc1c6;background:var(--ui-hover)}
html body :is(.ps-btn.on,.pd-btn.on,.bl-btn.main,.pst-primary,.dpp-btn){background:var(--primary-600);border-color:var(--primary-600);color:#fff;font-weight:600}
html body :is(.ps-btn.on,.pd-btn.on,.bl-btn.main,.pst-primary,.dpp-btn):hover{background:var(--primary-700);border-color:var(--primary-700)}
html body .ps-btn.danger{border-color:#c5221f;color:#c5221f}
html body .ps-btn.danger:hover{background:#fce8e6}
/* product page: the title is the last word of the breadcrumb, so the empty big heading takes no room */
.fi-resource-edit-record-page.fi-resource-products .fi-header .fi-header-heading{display:none}

/* ---- two-level menu (merchant): a rail of sections + the pages of the chosen section. The normal list is hidden only when this exists and the merchant did not switch back. ---- */
.pim-nav2{display:none}
html.pim-nav2-on{--sidebar-width:20rem}
html.pim-nav2-on .fi-sidebar-nav:has(.pim-nav2) .fi-sidebar-nav-groups{display:none}
html.pim-nav2-on .fi-sidebar-nav:has(.pim-nav2){padding:0}
html.pim-nav2-on .pim-nav2{display:flex;min-height:calc(100vh - 4.5rem);align-items:stretch}
.pim-nav2 .pn-rail{flex:none;width:5.2rem;display:flex;flex-direction:column;gap:.15rem;padding:.5rem .3rem;border-right:1px solid var(--ui-line)}
.pim-nav2 .pn-rb{display:flex;flex-direction:column;align-items:center;gap:.2rem;padding:.55rem .15rem;border-radius:.5rem;border:0;background:transparent;color:var(--ui-sub);cursor:pointer;font-size:.66rem;line-height:1.15;text-align:center;overflow-wrap:anywhere}
.pim-nav2 .pn-rb:hover{background:var(--ui-hover)}
.pim-nav2 .pn-rb.on{background:var(--primary-50);color:var(--primary-700)}
html.dark .pim-nav2 .pn-rb.on{background:rgba(255,255,255,.08);color:#fff}
.pim-nav2 .pn-ic{width:1.5rem;height:1.5rem}
.pim-nav2 .pn-old{margin-top:auto;font-size:.6rem;opacity:.6}
.pim-nav2 .pn-sub{flex:1;min-width:0;padding:.8rem .6rem}
.pim-nav2 .pn-sub h4{font-size:.7rem;letter-spacing:.07em;text-transform:uppercase;font-weight:600;color:var(--ui-sub);margin:0 0 .5rem .4rem}
.pim-nav2 .pn-sub ul{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.1rem}
.pim-nav2 .pn-sub a{display:flex;align-items:center;gap:.5rem;padding:.45rem .55rem;border-radius:.4rem;font-size:.85rem;color:inherit;text-decoration:none}
.pim-nav2 .pn-sub a:hover{background:var(--ui-hover)}
.pim-nav2 .pn-sub a[aria-current]{background:var(--primary-50);color:var(--primary-700);font-weight:600}
html.dark .pim-nav2 .pn-sub a[aria-current]{background:rgba(255,255,255,.08);color:#fff}
.pim-nav2 .pn-ii{width:1.1rem;height:1.1rem;flex:none;opacity:.7}
.pim-nav2 .pn-sub em{margin-left:auto;font-style:normal;font-size:.68rem;background:var(--primary-600);color:#fff;border-radius:999px;padding:0 .4rem}

/* ---- product page: the tabs become a vertical "Product navigation" on the left (like Akeneo); the language tabs inside a card stay horizontal ---- */
@media (min-width:1024px){
  .fi-resource-edit-record-page.fi-resource-products .fi-sc-tabs:not(.fi-sc-tabs .fi-sc-tabs){display:flex;flex-direction:row;align-items:flex-start;gap:1.5rem}
  .fi-resource-edit-record-page.fi-resource-products .fi-sc-tabs:not(.fi-sc-tabs .fi-sc-tabs)>.fi-tabs{flex:none;width:13.5rem;margin:0;flex-direction:column;align-items:stretch;gap:.1rem;position:sticky;top:4.5rem;border:0;box-shadow:none;background:transparent;padding:0;overflow:visible}
  .fi-resource-edit-record-page.fi-resource-products .fi-sc-tabs:not(.fi-sc-tabs .fi-sc-tabs)>.fi-tabs .fi-tabs-item{justify-content:flex-start;width:100%;border-radius:.4rem;padding:.55rem .75rem;text-align:left}
  .fi-resource-edit-record-page.fi-resource-products .fi-sc-tabs:not(.fi-sc-tabs .fi-sc-tabs)>.fi-sc-tabs-tab{flex:1;min-width:0}
}
.pim-comp{display:inline-flex;align-items:center;gap:.4rem;font-size:.8rem}
.pim-comp b{border-radius:.375rem;padding:.05rem .45rem;font-weight:700}
.pim-comp .hi{background:rgba(22,163,74,.18);color:#15803d}.pim-comp .mid{background:rgba(245,158,11,.2);color:#b45309}.pim-comp .lo{background:rgba(239,68,68,.18);color:#b91c1c}

/* menu collapsed to icons: the rail shows icons only and the pages of a section open as a small panel next to the icon (hover or click) */
.pim-nav2.pn-collapsed .pn-rail{width:100%;border-right:0;padding-inline:.2rem}
.pim-nav2.pn-collapsed .pn-rb span{display:none}
.pim-nav2.pn-collapsed .pn-old{display:none}
.pim-nav2 .pn-sub.pn-fly{position:fixed;z-index:60;width:15.5rem;max-height:80vh;overflow:auto;background:#fff;border:1px solid var(--ui-line);border-radius:.6rem;box-shadow:0 10px 28px rgba(0,0,0,.16);padding:.6rem}
html.dark .pim-nav2 .pn-sub.pn-fly{background:#18181b}
/* media library folder tree under the "Images & Files" menu */
.pim-nav2 .pn-folders{margin-top:.8rem;border-top:1px solid var(--ui-line);padding-top:.5rem}
.pim-nav2 .pn-folders summary{cursor:pointer;font-size:.7rem;letter-spacing:.07em;text-transform:uppercase;font-weight:600;color:var(--ui-sub);margin:0 0 .3rem .4rem}
.pim-nav2 .pn-folders .pn-cnt{margin-left:auto;font-style:normal;font-size:.68rem;background:transparent;color:var(--ui-sub);border-radius:0;padding:0 .2rem}
.pim-nav2 .pn-folders .pn-fx{width:1rem;flex:none;background:none;border:0;cursor:pointer;color:var(--ui-sub);font-size:.8rem;padding:0}
.pim-nav2 .pn-folders .pn-ib{flex:none;background:none;border:0;cursor:pointer;color:var(--ui-sub);font-size:.8rem;padding:.1rem .2rem;border-radius:.3rem}
.pim-nav2 .pn-folders .pn-ib:hover{background:var(--ui-hover)}
.pim-nav2 .pn-folders .pn-in{min-width:0;flex:1;font-size:.8rem;padding:.3rem .5rem;border-radius:.4rem;border:1px solid var(--ui-line);background:transparent;color:inherit}
.pim-nav2 .pn-folders .pn-sel{margin:.1rem .2rem;max-width:95%;font-size:.78rem;border:1px solid var(--ui-line);border-radius:.4rem;background:transparent;color:inherit}
