:root{
    /* surfaces â warm-neutral with cool undertone */
    --bg:           #F6F6F4;
    --surface:      #FFFFFF;
    --surface-2:    #FAFAF8;
    --surface-3:    #F1F1EE;
    --line:         #E8E8E3;
    --line-2:       #EFEFEB;
    --line-strong:  #DCDCD6;

    /* ink */
    --ink:          #111210;
    --ink-2:        #2A2B28;
    --ink-3:        #5B5D58;
    --ink-4:        #8A8C86;
    --ink-5:        #B6B8B0;

    /* brand â refined deep emerald */
    --brand:        oklch(56% 0.12 155);
    --brand-ink:    oklch(34% 0.08 155);
    --brand-soft:   oklch(96% 0.025 155);
    --brand-tint:   oklch(92% 0.04 155);
    --brand-line:   oklch(86% 0.05 155);

    /* accents (single hue family) */
    --amber:        oklch(72% 0.13 75);
    --amber-soft:   oklch(95% 0.04 80);
    --violet:       oklch(58% 0.11 295);
    --violet-soft:  oklch(95% 0.025 295);
    --blue:         oklch(58% 0.11 240);
    --blue-soft:    oklch(95% 0.025 240);
    --rose:         oklch(62% 0.13 20);
    --rose-soft:    oklch(95% 0.035 20);

    --radius:       10px;
    --radius-sm:    7px;
    --radius-lg:    14px;

    --shadow-sm:    0 1px 0 rgba(17,18,16,.04), 0 1px 2px rgba(17,18,16,.04);
    --shadow-md:    0 1px 0 rgba(17,18,16,.04), 0 6px 16px -8px rgba(17,18,16,.10);
    --shadow-pop:   0 1px 0 rgba(17,18,16,.04), 0 18px 40px -16px rgba(17,18,16,.18);
  }

  *{ box-sizing: border-box; }
  html,body{ margin:0; padding:0; }
  body{
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-feature-settings: 'cv11','ss01','ss03','cv02';
    background: var(--bg);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    font-size: 13px;
    line-height: 1.45;
    letter-spacing: -0.005em;
  }

  /* ============ App shell ============ */
  .app{
    display:grid;
    grid-template-columns: 248px 1fr 320px;
    grid-template-rows: 52px minmax(0, 1fr) 28px;
    height: 100vh;
    min-height: 760px;
  }
  .main{ min-height: 0; }

  /* ============ Top bar ============ */
  .topbar{
    grid-column: 1 / -1;
    display:grid;
    grid-template-columns: 248px 1fr auto;
    align-items: center;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    height: 52px;
  }
  .brand{
    display:flex; align-items:center; gap:9px;
    padding: 0 16px;
    border-right: 1px solid var(--line);
    height: 100%;
  }
  .brand-mark{
    width:24px; height:24px; border-radius:6px;
    background: var(--ink);
    display:grid; place-items:center;
    color:#fff;
    position:relative;
  }
  .brand-mark::before{
    content:""; position:absolute; inset:5px;
    background:
      linear-gradient(90deg, transparent 49%, rgba(255,255,255,.55) 49%, rgba(255,255,255,.55) 51%, transparent 51%),
      linear-gradient(0deg, transparent 49%, rgba(255,255,255,.55) 49%, rgba(255,255,255,.55) 51%, transparent 51%);
    border: 1px solid rgba(255,255,255,.7);
    border-radius: 2px;
  }
  .brand-mark::after{
    content:""; position:absolute; right:-2px; bottom:-2px;
    width:9px; height:9px; border-radius:50%;
    background: var(--brand); border:2px solid var(--surface);
  }
  .brand-name{
    font-weight:600; letter-spacing:-0.02em; font-size:14.5px;
  }
  .brand-name .dot{ color: var(--brand); }

  .topbar-search{
    display:flex; align-items:center; justify-content:center;
    padding: 0 16px;
  }

  .top-actions{
    display:flex; align-items:center; gap:8px;
    padding: 0 14px 0 8px;
  }

  /* Command/search */
  .cmd{
    display:flex; align-items:center; gap:8px;
    background: var(--surface-2);
    border:1px solid var(--line);
    padding: 5px 8px 5px 10px;
    border-radius: 8px;
    color: var(--ink-4);
    font-size: 12.5px;
    min-width: 240px;
    cursor: text;
  }
  .cmd .kbd{
    margin-left:auto;
    display:inline-flex; gap:2px;
  }

  .kbd-key{
    font-family:'Inter'; font-size:10.5px; font-weight:550;
    color: var(--ink-3);
    background: var(--surface);
    border:1px solid var(--line);
    border-bottom-width:1.5px;
    padding: 1px 5px; border-radius: 4px;
    min-width: 16px; text-align:center;
  }

  .icon-btn{
    width: 30px; height: 30px;
    display:grid; place-items:center;
    border-radius: 7px;
    color: var(--ink-3);
    background: transparent;
    border:1px solid transparent;
    cursor: pointer;
    position: relative;
  }
  .icon-btn:hover{ background: var(--surface-2); color: var(--ink); }
  .icon-btn .dot{
    position:absolute; top:6px; right:6px;
    width:6px; height:6px; border-radius:50%;
    background: var(--brand);
    border: 1.5px solid var(--surface);
  }

  .btn{
    display:inline-flex; align-items:center; gap:6px;
    height: 30px;
    padding: 0 11px;
    border-radius: 7px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    font-size: 12.5px;
    font-weight: 550;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
  }
  .btn:hover{ background: var(--surface-2); }
  .btn-ghost{ border-color: transparent; box-shadow:none; }
  .btn-ghost:hover{ background: var(--surface-2); }

  .btn-primary{
    background: var(--ink);
    color: #fff;
    border-color: var(--ink);
    box-shadow:
      0 1px 0 rgba(255,255,255,.08) inset,
      0 1px 2px rgba(0,0,0,.18);
  }
  .btn-primary:hover{ background: #000; }
  .btn-primary .split{
    width:1px; height:14px; background: rgba(255,255,255,.18); margin: 0 2px;
  }

  .avatar-pill{
    display:inline-flex; align-items:center; gap:6px;
    height: 30px; padding: 0 10px 0 4px;
    border-radius: 999px;
    background: var(--surface-2);
    border:1px solid var(--line);
    cursor: pointer;
  }
  .avatar{
    width: 22px; height:22px; border-radius:50%;
    background: linear-gradient(135deg, #2c2c28, #54564f);
    color:#fff; font-size:10.5px; font-weight:600;
    display:grid; place-items:center;
    letter-spacing:0;
  }
  .avatar-pill .name{ font-size:12.5px; font-weight:550; }

  /* ============ Sidebar ============ */
  .sidebar{
    background: var(--surface);
    border-right: 1px solid var(--line);
    display:flex; flex-direction:column;
    padding: 12px 10px 10px;
    min-width: 0;
  }
  .ws-switcher{
    display:flex; align-items:center; gap:9px;
    padding: 7px 8px;
    border-radius: 8px;
    cursor: pointer;
  }
  .ws-switcher:hover{ background: var(--surface-2); }
  .ws-logo{
    width:26px; height:26px; border-radius:6px;
    background: linear-gradient(135deg, #1c1c1a, #3a3b37);
    color:#fff;
    display:grid; place-items:center; font-weight:600; font-size:11.5px;
    letter-spacing:-0.02em;
  }
  .ws-meta{ display:flex; flex-direction:column; line-height:1.2; min-width:0; flex:1; }
  .ws-name{ font-weight:600; font-size:13px; }
  .ws-plan{ font-size:11px; color: var(--ink-4); }
  .ws-chev{ color: var(--ink-4); }

  .sidebar-section{
    display:flex; align-items:center; justify-content:space-between;
    padding: 14px 8px 6px;
    color: var(--ink-4);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  .sidebar-section .add{
    color: var(--ink-4); cursor:pointer;
    width: 18px; height:18px; border-radius:4px; display:grid; place-items:center;
  }
  .sidebar-section .add:hover{ background: var(--surface-3); color: var(--ink-2); }

  .nav-item{
    display:flex; align-items:center; gap:9px;
    padding: 6px 8px;
    border-radius: 7px;
    color: var(--ink-2);
    cursor: pointer;
    font-size: 13px;
    font-weight: 450;
    position: relative;
    white-space: nowrap;
  }
  .nav-item > span:not(.count):not(.kbd-key):not(.ico){ flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .nav-item:hover{ background: var(--surface-2); }
  .nav-item .ico{ color: var(--ink-4); flex-shrink:0; }
  .nav-item .count{
    margin-left:auto;
    font-size: 10.5px; font-weight:550;
    color: var(--ink-4);
    background: var(--surface-3);
    padding: 1px 6px; border-radius: 4px;
    font-variant-numeric: tabular-nums;
  }
  .nav-item.active{
    background: var(--surface-3);
    color: var(--ink);
    font-weight: 550;
  }
  .nav-item.active .ico{ color: var(--ink); }
  .nav-item .kbd-key{ margin-left:auto; opacity:0; transition: opacity .12s; }
  .nav-item:hover .kbd-key{ opacity:1; }
  .nav-item:hover .count{ display:none; }

  /* file tree-ish recents */
  .file-row{
    display:flex; align-items:center; gap:8px;
    padding: 5px 8px 5px 10px;
    border-radius: 6px;
    color: var(--ink-2);
    cursor: pointer;
    font-size: 12.5px;
  }
  .file-row:hover{ background: var(--surface-2); }
  .file-row.active{
    background: var(--brand-soft);
    color: var(--brand-ink);
    font-weight: 550;
  }
  .file-row .dot{
    width:6px; height:6px; border-radius:50%;
    background: var(--ink-5);
    flex-shrink:0;
  }
  .file-row.active .dot{ background: var(--brand); }
  .file-row .name{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .file-row .meta{ font-size:10.5px; color: var(--ink-4); font-variant-numeric:tabular-nums; }

  .sidebar-spacer{ flex:1; }

  .upsell{
    margin-top: 8px;
    padding: 12px;
    background: var(--ink);
    color: #fff;
    border-radius: var(--radius);
    position: relative;
    overflow: hidden;
  }
  .upsell::before{
    content:""; position:absolute; right:-30px; top:-30px;
    width: 110px; height:110px; border-radius:50%;
    background: radial-gradient(circle, var(--brand) 0%, transparent 65%);
    opacity: 0.45;
  }
  .upsell-eyebrow{
    font-size:10px; font-weight:600; letter-spacing:0.1em;
    color: var(--brand); text-transform: uppercase;
    margin-bottom: 6px;
  }
  .upsell-title{
    font-family: 'Instrument Serif', serif;
    font-size: 19px; line-height: 1.25;
    font-weight: 400; letter-spacing: -0.01em;
    margin: 0 0 6px;
  }
  .upsell-title em{ font-style: italic; color: var(--brand); }
  .upsell-sub{ font-size: 11.5px; color: rgba(255,255,255,.65); margin: 0 0 10px; line-height: 1.4; }
  .upsell .progress{
    height: 4px; background: rgba(255,255,255,.1); border-radius:2px;
    overflow: hidden; margin-bottom: 10px;
    position: relative; z-index:1;
  }
  .upsell .progress > div{
    height:100%; width: 100%;
    background: linear-gradient(90deg, var(--brand) 0%, oklch(75% 0.13 155) 100%);
  }
  .upsell .progress-meta{
    display:flex; justify-content: space-between;
    font-size: 11px; color: rgba(255,255,255,.65);
    margin-bottom: 12px;
    font-variant-numeric: tabular-nums;
  }
  .upsell-cta{
    display:flex; align-items:center; justify-content:space-between;
    background: rgba(255,255,255,.07);
    border:1px solid rgba(255,255,255,.1);
    padding: 7px 10px; border-radius: 7px;
    color: #fff; font-size: 12px; font-weight: 550;
    cursor: pointer;
    position: relative; z-index:1;
  }
  .upsell-cta .price{
    font-family: 'JetBrains Mono';
    font-size: 11px; color: rgba(255,255,255,.65); font-weight:500;
  }
  .upsell-cta:hover{ background: rgba(255,255,255,.12); }

  /* ============ Main ============ */
  .main{
    display:flex; flex-direction:column;
    min-width: 0;
    background: var(--bg);
    overflow-y: auto;
    overflow-x: hidden;
  }
  .main::-webkit-scrollbar{ width: 10px; }
  .main::-webkit-scrollbar-track{ background: transparent; }
  .main::-webkit-scrollbar-thumb{ background: var(--line-strong); border-radius: 99px; border: 2px solid var(--bg); }
  .main::-webkit-scrollbar-thumb:hover{ background: var(--ink-5); }

  /* file header strip with tabs */
  .file-header{
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 10px 18px 0;
    position: sticky; top: 0; z-index: 5;
    flex-shrink: 0;
  }
  .file-title-row{
    display:flex; align-items:center; gap: 10px;
    margin-bottom: 8px;
  }
  .file-icon{
    width: 22px; height: 22px; border-radius: 5px;
    background: var(--brand-soft);
    color: var(--brand);
    display:grid; place-items:center;
    border: 1px solid var(--brand-line);
  }
  .file-title{
    font-family: 'Instrument Serif', serif;
    font-size: 22px; font-weight: 400; letter-spacing: -0.01em;
    color: var(--ink);
    white-space: nowrap; flex-shrink: 0;
    line-height: 1.1;
  }
  .file-meta{
    margin-left: 4px;
    display:flex; align-items:center; gap: 10px;
    color: var(--ink-4);
    font-size: 12px;
    white-space: nowrap; flex-shrink: 0;
    min-width: 0;
    overflow: hidden;
  }
  .file-meta .dot-sep{ color: var(--ink-5); }
  .file-meta .saved{
    display:inline-flex; align-items:center; gap:5px;
    color: var(--ink-3);
  }
  .file-meta .saved .pulse{
    width:6px; height:6px; border-radius:50%; background: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
  }

  .file-actions{ margin-left:auto; display:flex; align-items:center; gap: 6px; }

  .collab-stack{ display:flex; align-items:center; padding-right: 6px; }
  .collab{
    width: 24px; height:24px; border-radius:50%;
    border: 2px solid var(--surface);
    margin-left: -6px;
    display:grid; place-items:center;
    font-size: 10px; font-weight:600; color:#fff;
    letter-spacing:0;
  }
  .collab:first-child{ margin-left:0; }
  .collab.c1{ background: linear-gradient(135deg, oklch(64% 0.14 155), oklch(50% 0.12 155)); }
  .collab.c2{ background: linear-gradient(135deg, oklch(64% 0.14 295), oklch(50% 0.12 295)); }
  .collab.c3{ background: linear-gradient(135deg, oklch(64% 0.14 75), oklch(50% 0.12 75)); }

  .view-tabs{
    display:flex; align-items:center; gap: 2px;
    position: relative;
  }
  .view-tab{
    display:inline-flex; align-items:center; gap: 6px;
    padding: 8px 12px 10px;
    color: var(--ink-3);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
  }
  .view-tab .ico{ color: var(--ink-4); }
  .view-tab .count{
    font-size: 10.5px; color: var(--ink-4);
    font-variant-numeric: tabular-nums;
  }
  .view-tab:hover{ color: var(--ink); }
  .view-tab.active{
    color: var(--ink);
    font-weight: 550;
    border-bottom-color: var(--ink);
  }
  .view-tab.active .ico{ color: var(--ink); }
  .view-tab .new{
    color: var(--ink-4);
    font-size: 12px;
  }

  /* ============ Toolbar ============ */
  .toolbar{
    display:flex; align-items:center; gap: 2px;
    padding: 6px 12px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
  }
  .tb-group{ display:flex; align-items:center; gap:1px; }
  .tb-sep{
    width:1px; height: 18px;
    background: var(--line);
    margin: 0 6px;
  }
  .tb-btn{
    height: 28px; min-width: 28px;
    padding: 0 6px;
    border-radius: 6px;
    display:inline-flex; align-items:center; justify-content:center; gap:4px;
    color: var(--ink-2);
    cursor: pointer;
    font-size: 12.5px;
    border:1px solid transparent;
    background: transparent;
  }
  .tb-btn:hover{ background: var(--surface-2); }
  .tb-btn.active{ background: var(--surface-3); color: var(--ink); }
  .tb-btn svg{ color: var(--ink-3); }
  .tb-btn .chev{ color: var(--ink-5); }

  .tb-select{
    height: 28px;
    padding: 0 6px 0 9px;
    border-radius: 6px;
    display:inline-flex; align-items:center; gap:6px;
    color: var(--ink-2);
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 500;
    background: transparent;
    border:1px solid transparent;
    min-width: 110px;
  }
  .tb-select:hover{ background: var(--surface-2); }
  .tb-select .label{ flex:1; }
  .tb-select.mono{ font-family: 'JetBrains Mono'; font-size:11.5px; min-width: 56px; }

  .tb-spacer{ flex:1; }

  .tb-pill{
    display:inline-flex; align-items:center; gap: 6px;
    height: 28px; padding: 0 10px;
    border-radius: 999px;
    background: var(--brand-soft);
    border: 1px solid var(--brand-line);
    color: var(--brand-ink);
    font-size: 11.5px; font-weight: 550;
    cursor: pointer;
    white-space: nowrap; flex-shrink: 0;
  }
  .tb-pill:hover{ background: var(--brand-tint); }
  .tb-pill .kbd-key{
    background: rgba(255,255,255,.7);
    border-color: var(--brand-line);
    color: var(--brand-ink);
  }

  /* ============ SHOPIFY LAYOUT ============ */
  .shopify-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    grid-template-rows: 52px 1fr auto auto;
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(135deg, #F6F6F4 0%, #FAFAF8 100%);
  }
  .shopify-layout.ai-panel-open {
    grid-template-columns: 200px 1fr 320px;
  }

  /* ============ STATS ROW (Card Layout) ============ */
  .sf-stats-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px 12px;
    background: #FFFFFF;
    border-bottom: 1px solid rgba(232, 232, 227, 0.5);
    overflow-x: auto;
    grid-column: 2 / -1;
    grid-row: 2;
  }

  .sf-stat-card {
    flex: 1;
    min-width: 120px;
    background: #FFFFFF;
    border: 1px solid #E8E8E3;
    border-radius: 13px;
    padding: 13px 16px;
    display: flex;
    align-items: center;
    gap: 11px;
    transition: all 0.2s ease;
  }

  .sf-stat-card:hover {
    background: #FAFAF8;
    border-color: #DCDCD6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  }

  .sf-stat-icon-box {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
    background: rgba(56, 141, 106, 0.1);
  }

  .sf-stat-value {
    font-size: 16px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-ink) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-variant-numeric: tabular-nums;
  }

  .sf-stat-label {
    color: #8A8C86;
    font-size: 11px;
    font-weight: 500;
  }

  .btn-view-analytics {
    padding: 8px 14px;
    border-radius: 8px;
    border: none;
    background: #FFFFFF;
    color: var(--brand);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    white-space: nowrap;
  }

  .btn-view-analytics:hover {
    background: var(--brand-soft);
  }

  /* ============ MAIN CONTENT ROW (Table + AI Panel) ============ */
  .sf-main-content-row {
    display: flex;
    gap: 16px;
    padding: 0 24px;
    grid-column: 2 / 3;
    grid-row: 3;
    min-height: 0;
    min-width: 0;
    overflow-x: hidden;
  }

  /* ============ VIEW CONTAINERS ============ */
  #dashboard-view, #products-view, #collections-view, #ai-actions-view,
  #validation-view, #import-view, #export-view, #history-view,
  #settings-view, #ai-chat-view {
    grid-column: 2;
    min-width: 0;
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
  }

  #ai-chat-view {
    grid-row: 2 / -1;
    overflow: hidden;
  }

  /* ============ TABLE PANEL ============ */
  .sf-table-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
    background: #FFFFFF;
    border: 1px solid #E8E8E3;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), inset 0 -1px 0 rgba(0, 0, 0, 0.02);
  }

  .sf-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid #EEF1EF;
    flex-shrink: 0;
    background: #FAFAF8;
  }

  .sf-search-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    max-width: 320px;
    background: #F5F7F5;
    border: 1px solid #E7EBE8;
    border-radius: 9px;
    padding: 8px 12px;
  }

  .sf-search-wrap input {
    border: none;
    background: none;
    font-size: 12.5px;
    outline: none;
    flex: 1;
    font-family: inherit;
    color: var(--ink);
  }

  .sf-search-wrap input::placeholder {
    color: #8A8C86;
  }

  .sf-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 11px;
    background: transparent;
    border: 1px solid #E7EBE8;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 500;
    color: #3A423D;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .sf-filter-btn:hover {
    background: #F5F7F5;
    border-color: #DCDCD6;
  }

  .sf-table-scroll {
    flex: 1;
    overflow: auto;
    min-height: 0;
  }

  /* ============ PRODUCT TABLE ============ */
  .sf-product-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    background: #FFFFFF;
  }

  .sf-product-table thead tr {
    position: sticky;
    top: 0;
    background: #FBFCFB;
    z-index: 10;
  }

  .sf-product-table th {
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid #EEF1EF;
    font-weight: 600;
    color: #5C655E;
    white-space: nowrap;
    background: #FBFCFB;
  }

  .sf-product-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #F1F3F1;
    color: #2A2B28;
  }

  .sf-product-table tr:hover td {
    background: #FAFBFA;
  }

  .sf-img-cell {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    object-fit: cover;
    display: block;
    border: 1px solid #E7EBE8;
  }

  .sf-img-placeholder {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: #EEF4F0;
    border: 1px solid #D3D9D5;
    display: block;
  }

  .sf-status-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 600;
  }

  .sf-status-active {
    background: #EEF4F0;
    color: #1F7A4D;
  }

  .sf-status-draft {
    background: #F5F5F5;
    color: #8B948E;
  }

  .sf-status-archived {
    background: #FBF1F0;
    color: #A85A4E;
  }

  .sf-sort-arrow {
    color: #C4CAC6;
    font-size: 10px;
    margin-left: 4px;
    opacity: 0.6;
  }

  .sf-empty-row {
    text-align: center;
    padding: 40px;
    color: #8B948E;
  }

  /* ============ SHEET TABS ============ */
  .sf-sheet-tabs {
    display: flex;
    align-items: center;
    gap: 1px;
    padding: 11px 16px;
    border-top: 1px solid #EEF1EF;
    flex-shrink: 0;
    background: #FAFAF8;
  }

  .sf-sheet-tab {
    padding: 7px 13px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #5C655E;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .sf-sheet-tab.active {
    background: #EEF4F0;
    color: #1F7A4D;
    font-weight: 700;
  }

  .sf-sheet-tab:hover:not(.active) {
    background: #F5F7F5;
  }

  .sf-sheet-count {
    font-size: 11px;
    color: #8A8C86;
    font-weight: 500;
  }

  /* ============ BOTTOM STRIP ============ */
  .sf-bottom-strip {
    display: flex;
    gap: 16px;
    padding: 0 24px 20px;
    grid-column: 2 / -1;
    grid-row: 5;
    flex-shrink: 0;
  }

  .sf-bottom-card {
    flex: 1;
    background: #FFFFFF;
    border: 1px solid #E8E8E3;
    border-radius: 13px;
    padding: 14px 18px;
    transition: all 0.2s ease;
  }

  .sf-bottom-card:hover {
    border-color: #DCDCD6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  }

  /* ============ SECTION PANELS ============ */
  .sf-section-panel {
    grid-column: 2 / 3;
    grid-row: 3;
    padding: 24px;
    overflow-y: auto;
    background: #FAFAF8;
    min-height: 0;
  }

  .ssp-header { margin-bottom: 24px; }
  .ssp-title { font-size: 18px; font-weight: 600; display: flex; align-items: center; gap: 8px; margin-bottom: 4px; color: var(--ink); }
  .ssp-desc { font-size: 13px; color: var(--ink-4); }
  .ssp-section-label { font-size: 11px; font-weight: 600; color: var(--ink-4); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; }

  .ssp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
  .ssp-action-card, .ssp-template-card { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 16px; cursor: pointer; transition: all 0.2s; }
  .ssp-action-card:hover, .ssp-template-card:hover { border-color: var(--brand); box-shadow: 0 2px 8px rgba(56,141,106,0.1); }
  .ssp-action-icon { font-size: 22px; margin-bottom: 8px; }
  .ssp-action-label, .ssp-template-name { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
  .ssp-action-desc, .ssp-template-desc { font-size: 11px; color: var(--ink-4); margin-bottom: 6px; }
  .ssp-template-badge { font-size: 24px; margin-bottom: 8px; }
  .ssp-template-count { font-size: 11px; background: var(--brand-soft); color: var(--brand); padding: 2px 8px; border-radius: 10px; display: inline-block; }

  .ssp-custom-input { width: 100%; height: 80px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; font-family: 'Inter', sans-serif; resize: vertical; margin-bottom: 8px; box-sizing: border-box; }
  .ssp-primary-btn { background: var(--brand); color: white; border: none; border-radius: 8px; padding: 8px 16px; font-size: 13px; font-weight: 550; cursor: pointer; }
  .ssp-primary-btn:hover { opacity: 0.9; }

  .ssp-empty { text-align: center; padding: 40px; color: var(--ink-4); font-size: 13px; }

  .ssp-form-group { margin-bottom: 20px; }
  .ssp-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; color: var(--ink); }
  .ssp-select, .ssp-input { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: 13px; background: white; font-family: 'Inter', sans-serif; }
  .ssp-input { width: 100px; }

  .ssp-table { width: 100%; border-collapse: collapse; font-size: 12.5px; background: white; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
  .ssp-table th { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-weight: 600; background: var(--surface-2); font-size: 11px; color: var(--ink-4); }
  .ssp-table td { padding: 10px 12px; border-bottom: 1px solid #f5f5f3; }
  .ssp-issue-badge { background: #fff3cd; color: #856404; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 550; }
  .ssp-badge-success { background: #d1e7dd; color: #0a3622; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 550; }
  .ssp-validation-summary { font-size: 14px; font-weight: 600; margin-bottom: 12px; color: #dc3545; }
  .ssp-success { color: #198754; font-size: 14px; font-weight: 600; text-align: center; padding: 24px; }

  /* ============ WORKSPACE REPORTS ============ */
  .wsr-wrapper { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; padding: 16px 24px 24px; background: #FAFAF8; }
  .wsr-card { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
  .wsr-card-title { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 14px; display: flex; align-items: center; gap: 6px; }
  .wsr-stats-row { display: flex; gap: 12px; flex-wrap: wrap; }
  .wsr-stat { flex: 1; min-width: 60px; text-align: center; }
  .wsr-stat-val { font-size: 20px; font-weight: 700; color: var(--ink); line-height: 1.2; }
  .wsr-stat-lbl { font-size: 10px; color: var(--ink-4); margin-top: 2px; }
  .wsr-green { color: var(--brand) !important; }
  .wsr-orange { color: #f59e0b !important; }
  .wsr-gray { color: #9ca3af !important; }
  .wsr-blue { color: #3b82f6 !important; }
  .wsr-red { color: #ef4444 !important; }
  .wsr-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
  .wsr-bar-lbl { font-size: 11px; color: var(--ink-3); width: 60px; flex-shrink: 0; }
  .wsr-bar-track { flex: 1; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
  .wsr-bar-fill { height: 100%; border-radius: 3px; transition: width 0.3s; }
  .wsr-bar-pct { font-size: 11px; font-weight: 600; color: var(--ink); width: 32px; text-align: right; flex-shrink: 0; }
  .wsr-activity-list { list-style: none; padding: 0; margin: 0; }
  .wsr-activity-list li { display: flex; gap: 8px; padding: 6px 0; border-bottom: 1px solid #f5f5f3; font-size: 12px; }
  .wsr-activity-list li:last-child { border-bottom: none; }
  .wsr-act-time { color: var(--ink-4); flex-shrink: 0; }
  .wsr-act-text { color: var(--ink); }
  .wsr-empty { font-size: 12px; color: var(--ink-4); text-align: center; padding: 16px 0; }

  /* ============ CATALOG CANVAS ============ */
  .pc-view-btns { display: flex; gap: 2px; margin-left: 8px; }
  .pc-view-btn { padding: 4px 8px; border: 1px solid var(--line); background: white; border-radius: 5px; cursor: pointer; font-size: 14px; color: var(--ink-3); transition: all 0.15s; }
  .pc-view-btn.active { background: var(--brand); color: white; border-color: var(--brand); }
  .pc-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--line); background: white; position: sticky; top: 0; z-index: 2; }
  .pc-toolbar-info { font-size: 12px; color: var(--ink-3); font-weight: 500; }
  .pc-toolbar-actions { display: flex; gap: 8px; }
  .pc-ai-btn { padding: 6px 14px; background: #f0fdf4; color: var(--brand); border: 1px solid var(--brand); border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 5px; transition: all 0.2s; }
  .pc-ai-btn:hover { background: var(--brand); color: white; }
  .pc-push-btn { padding: 6px 14px; background: var(--brand); color: white; border: none; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 5px; transition: all 0.2s; }
  .pc-push-btn:hover { opacity: 0.9; }
  .pc-push-btn:disabled { opacity: 0.6; cursor: not-allowed; }
  .pc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; padding: 14px; background: #FAFAF8; }
  .pc-card { background: white; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; transition: box-shadow 0.2s, transform 0.15s; }
  .pc-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.09); transform: translateY(-1px); }
  .pc-card-image-wrap { width: 100%; aspect-ratio: 1; background: #f5f5f3; display: flex; align-items: center; justify-content: center; overflow: hidden; }
  .pc-card-img { width: 100%; height: 100%; object-fit: cover; }
  .pc-card-img-ph { font-size: 36px; opacity: 0.25; }
  .pc-card-body { padding: 9px 10px 10px; }
  .pc-card-badges { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 5px; }
  .pc-status { font-size: 9.5px; padding: 1.5px 5px; border-radius: 3px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
  .pc-status-active { background: #dcfce7; color: #166534; }
  .pc-status-draft { background: #fef9c3; color: #854d0e; }
  .pc-status-archived { background: #f1f5f9; color: #475569; }
  .pc-stock { font-size: 9.5px; padding: 1.5px 5px; border-radius: 3px; background: #f1f5f9; color: #64748b; }
  .pc-stock-zero { background: #fee2e2 !important; color: #991b1b !important; }
  .pc-stock-low { background: #fef3c7 !important; color: #92400e !important; }
  .pc-card-title { font-size: 12px; font-weight: 600; color: var(--ink); margin-bottom: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pc-card-vendor { font-size: 10px; color: var(--ink-4); margin-bottom: 4px; }
  .pc-card-desc { font-size: 11px; color: var(--ink-3); line-height: 1.45; margin-bottom: 7px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 32px; }
  .pc-card-price { display: flex; align-items: baseline; gap: 5px; }
  .pc-price { font-size: 13px; font-weight: 700; color: var(--ink); }
  .pc-compare-price { font-size: 10.5px; color: var(--ink-4); text-decoration: line-through; }
  .pc-empty { text-align: center; padding: 80px 40px; color: var(--ink-4); font-size: 14px; }

  /* ============ AI PANEL (Inside Main Content Row) ============ */
  .sf-ai-panel {
    display: none;
    flex-direction: column;
    width: 320px;
    min-height: 0;
    background: #FFFFFF;
    border: 1px solid #E8E8E3;
    border-radius: 14px;
    overflow: hidden;
    flex-shrink: 0;
  }

  .sf-ai-panel[style*="display: flex"] {
    display: flex !important;
  }

  .sf-ai-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 12px;
    border-bottom: 1px solid #EEF1EF;
    flex-shrink: 0;
  }

  .sf-ai-title {
    font-weight: 700;
    font-size: 14.5px;
    color: var(--ink);
  }

  .sf-ai-close {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8A8C86;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .sf-ai-close:hover {
    background: #F5F7F5;
    color: var(--ink);
  }

  .sf-ai-tabs {
    display: flex;
    gap: 4px;
    background: #F2F6F3;
    border-radius: 9px;
    padding: 3px;
    margin: 0 16px 12px;
    flex-shrink: 0;
  }

  .sf-ai-tab {
    flex: 1;
    text-align: center;
    padding: 7px 0;
    border-radius: 7px;
    font-size: 12.5px;
    font-weight: 700;
    color: #8B948E;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .sf-ai-tab.active {
    background: #FFFFFF;
    color: var(--brand);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  }

  .sf-ai-content {
    flex: 1;
    overflow-y: auto;
    padding: 14px 18px;
    min-height: 0;
  }

  .sf-ai-section-label {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.07em;
    color: #8A8C86;
    margin-bottom: 10px;
  }

  .sf-quick-action-item {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 11px 12px;
    border-radius: 11px;
    border: 1px solid #EEF1EF;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .sf-quick-action-item:hover {
    background: #FAFCFA;
    border-color: #DCEADD;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  }

  .sf-quick-action-label {
    font-weight: 600;
    font-size: 12.5px;
    color: var(--ink);
    line-height: 1.2;
  }

  .sf-quick-action-desc {
    font-size: 11.5px;
    color: #8B948E;
    margin-top: 1px;
    line-height: 1.3;
  }

  .sf-custom-action-input {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid #E7EBE8;
    border-radius: 8px;
    font-size: 12px;
    font-family: inherit;
    color: var(--ink);
    background: #FFFFFF;
    resize: vertical;
    min-height: 60px;
    margin-bottom: 10px;
  }

  .sf-custom-action-input::placeholder {
    color: #8A8C86;
  }

  .sf-create-action-btn {
    width: 100%;
    padding: 9px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-ink) 100%);
    color: white;
    font-size: 12.5px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .sf-create-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(56, 141, 106, 0.2);
  }

  .sf-sidebar {
    grid-row: 1 / -1;
    grid-column: 1;
    background: #FFFFFF;
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(232, 232, 227, 0.5);
    display: flex;
    flex-direction: column;
    padding: 12px 10px 10px;
    min-width: 0;
    overflow-y: auto;
    height: 100vh;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.05);
  }

  .sf-sidebar::-webkit-scrollbar { width: 6px; }
  .sf-sidebar::-webkit-scrollbar-track { background: transparent; }
  .sf-sidebar::-webkit-scrollbar-thumb { background: rgba(138, 140, 134, 0.3); border-radius: 99px; transition: background 0.2s; }
  .sf-sidebar::-webkit-scrollbar-thumb:hover { background: rgba(138, 140, 134, 0.5); }

  .sf-topbar {
    grid-column: 2 / -1;
    grid-row: 1;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    background: #FFFFFF;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(232, 232, 227, 0.5);
    height: 52px;
    padding: 0 20px;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    position: relative;
    z-index: 200;
  }

  .sf-topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
  }

  .sf-topbar-file-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 6px;
    background: var(--surface-2);
    border-radius: 4px;
    font-size: 11px;
    color: var(--ink-3);
  }

  .sf-topbar-title {
    font-size: 16px;
    font-weight: 550;
    color: var(--ink);
    white-space: nowrap;
    cursor: pointer;
  }

  .sf-topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-self: end;
  }

  .sf-sync-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 16px;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-ink) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 550;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(56, 141, 106, 0.2);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
  }

  .sf-sync-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 100%);
    opacity: 0;
    transition: opacity 0.2s ease;
  }

  .sf-sync-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 141, 106, 0.3);
  }

  .sf-sync-btn:hover::before {
    opacity: 1;
  }

  .sf-sync-btn:active {
    transform: translateY(0);
  }

  .sf-shopify-connect-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 32px;
    padding: 0 14px;
    background: #FFFFFF;
    color: #1F2937;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 550;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
  }

  .sf-shopify-connect-btn:hover {
    border-color: #95BF47;
    background: #F7FBF0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(149, 191, 71, 0.18);
  }

  .sf-shopify-connect-btn:active {
    transform: translateY(0);
  }

  .sf-shopify-connect-btn svg {
    flex-shrink: 0;
  }

  .sf-stats-bar {
    grid-column: 2 / 3;
    grid-row: 2;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: #FFFFFF;
    border-bottom: 1px solid rgba(232, 232, 227, 0.5);
    font-size: 12.5px;
    overflow-x: auto;
    backdrop-filter: blur(8px);
  }

  .sf-stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
    flex-shrink: 0;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(232, 232, 227, 0.6);
    border-radius: 10px;
    transition: all 0.2s ease;
  }

  .sf-stat-item:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(232, 232, 227, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  }

  .sf-stat-value {
    font-size: 16px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-ink) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-variant-numeric: tabular-nums;
  }

  .sf-stat-label {
    color: var(--ink-3);
    font-size: 11px;
    font-weight: 500;
  }

  .sf-stat-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    border-radius: 8px;
    font-size: 14px;
    flex-shrink: 0;
  }

  .sf-stat-icon.brand {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-ink) 100%);
  }

  .sf-stat-icon.amber {
    background: linear-gradient(135deg, var(--amber) 0%, #D4A574 100%);
  }

  .sf-stat-icon.rose {
    background: linear-gradient(135deg, var(--rose) 0%, #C73959 100%);
  }

  .sf-stat-icon.blue {
    background: linear-gradient(135deg, var(--blue) 0%, #5CA8D4 100%);
  }

  .sf-filter-bar {
    grid-column: 2 / 3;
    grid-row: 3;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: #FFFFFF;
    border-bottom: 1px solid rgba(232, 232, 227, 0.5);
    backdrop-filter: blur(8px);
  }

  .sf-search-input {
    flex: 1;
    height: 32px;
    padding: 0 12px;
    border: 1px solid rgba(232, 232, 227, 0.8);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.8);
    color: var(--ink);
    font-size: 12.5px;
    transition: all 0.2s ease;
  }

  .sf-search-input:focus {
    outline: none;
    background: white;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(56, 141, 106, 0.1);
  }

  .sf-search-input::placeholder {
    color: var(--ink-4);
  }

  .sf-filter-btn {
    height: 32px;
    padding: 0 12px;
    border: 1px solid rgba(232, 232, 227, 0.8);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.7);
    color: var(--ink-2);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
  }

  .sf-filter-btn:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(232, 232, 227, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    transform: translateY(-1px);
  }

  .sf-filter-btn:active {
    transform: translateY(0);
  }

  .sf-grid-wrap {
    grid-column: 2 / 3;
    grid-row: 4;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #FFFFFF;
    overflow: auto;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), inset 0 -1px 0 rgba(0, 0, 0, 0.02);
  }

  .sf-sheet-tabs {
    grid-column: 2 / 3;
    grid-row: 5;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: #FFFFFF;
    border-top: 1px solid rgba(232, 232, 227, 0.5);
    border-bottom: 1px solid rgba(232, 232, 227, 0.5);
    overflow-x: auto;
    flex-shrink: 0;
    height: 44px;
    backdrop-filter: blur(8px);
  }

  .sf-sheet-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    height: 30px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(232, 232, 227, 0.6);
    border-radius: 8px;
    cursor: pointer;
    font-size: 12.5px;
    color: var(--ink-2);
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s ease;
    font-weight: 500;
  }

  .sf-sheet-tab.active {
    background: linear-gradient(135deg, var(--brand-soft) 0%, rgba(56, 141, 106, 0.08) 100%);
    border-color: var(--brand-line);
    color: var(--brand-ink);
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(56, 141, 106, 0.1), inset 0 0 0 1px var(--brand-line);
  }

  .sf-sheet-tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(232, 232, 227, 1);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
    transform: translateY(-1px);
  }

  .sf-sheet-count {
    font-size: 10px;
    color: var(--ink-4);
    font-variant-numeric: tabular-nums;
    opacity: 0.7;
  }

  .sf-bottom-footer {
    grid-column: 2 / 3;
    grid-row: 6;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    background: #FFFFFF;
    border-top: 1px solid rgba(232, 232, 227, 0.5);
    padding: 12px;
    backdrop-filter: blur(8px);
  }

  .sf-footer-section {
    background: linear-gradient(135deg, rgba(255,255,255,0.8) 0%, rgba(250,250,248,0.8) 100%);
    border: 1px solid rgba(232, 232, 227, 0.6);
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.2s ease;
  }

  .sf-footer-section:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(232, 232, 227, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  }

  .sf-footer-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--brand);
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .sf-footer-stat {
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-ink) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-variant-numeric: tabular-nums;
  }

  .sf-footer-desc {
    font-size: 11px;
    color: var(--ink-3);
    line-height: 1.4;
  }

  .sf-footer-link {
    font-size: 11px;
    color: var(--brand);
    cursor: pointer;
    font-weight: 600;
    transition: color 0.2s ease;
    text-decoration: none;
  }

  .sf-footer-link:hover {
    color: var(--brand-ink);
    text-decoration: underline;
  }

  .sf-ai-panel {
    grid-row: 2 / -1;
    grid-column: 3;
    background: #FFFFFF;
    backdrop-filter: blur(10px);
    border-left: 1px solid rgba(232, 232, 227, 0.5);
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow-y: auto;
    box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.8), inset -1px 0 0 rgba(0, 0, 0, 0.02);
  }

  .sf-ai-panel::-webkit-scrollbar { width: 6px; }
  .sf-ai-panel::-webkit-scrollbar-track { background: transparent; }
  .sf-ai-panel::-webkit-scrollbar-thumb { background: rgba(138, 140, 134, 0.3); border-radius: 99px; transition: background 0.2s; }
  .sf-ai-panel::-webkit-scrollbar-thumb:hover { background: rgba(138, 140, 134, 0.5); }

  .sf-ai-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(232, 232, 227, 0.5);
    flex-shrink: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.5) 0%, rgba(250,250,248,0.3) 100%);
  }

  .sf-ai-title {
    font-size: 14px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-ink) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .sf-ai-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--ink-3);
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 18px;
  }

  .sf-ai-close:hover {
    background: rgba(56, 141, 106, 0.1);
    color: var(--brand);
  }

  .sf-ai-tabs {
    display: flex;
    gap: 0;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(232, 232, 227, 0.5);
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.3);
  }

  .sf-ai-tab {
    flex: 1;
    padding: 8px 12px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-3);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    position: relative;
  }

  .sf-ai-tab:hover:not(.active) {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.5);
  }

  .sf-ai-tab.active {
    color: white;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-ink) 100%);
    box-shadow: 0 2px 6px rgba(56, 141, 106, 0.2);
  }

  .sf-ai-content {
    flex: 1;
    padding: 16px 20px;
    overflow-y: auto;
  }

  .sf-quick-action-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, rgba(255,255,255,0.8) 0%, rgba(250,250,248,0.8) 100%);
    border: 1px solid rgba(232, 232, 227, 0.6);
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
  }

  .sf-quick-action-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(56, 141, 106, 0.05) 0%, rgba(56, 141, 106, 0) 100%);
    opacity: 0;
    transition: opacity 0.2s ease;
  }

  .sf-quick-action-item:hover {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(250,250,248,0.95) 100%);
    border-color: rgba(232, 232, 227, 1);
    box-shadow: 0 2px 8px rgba(56, 141, 106, 0.1);
    transform: translateY(-1px);
  }

  .sf-quick-action-item:hover::before {
    opacity: 1;
  }

  .sf-quick-action-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .sf-quick-action-desc {
    font-size: 11px;
    color: var(--ink-3);
    line-height: 1.3;
  }

  .sf-ai-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--brand);
    margin: 16px 0 10px;
    opacity: 0.8;
  }

  .sf-custom-action-input {
    width: 100%;
    min-height: 60px;
    padding: 12px;
    border: 1px solid rgba(232, 232, 227, 0.8);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.8);
    color: var(--ink);
    font-size: 12px;
    font-family: inherit;
    resize: none;
    transition: all 0.2s ease;
  }

  .sf-custom-action-input:focus {
    outline: none;
    background: white;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(56, 141, 106, 0.1);
  }

  .sf-custom-action-input::placeholder {
    color: var(--ink-4);
  }

  .sf-create-action-btn {
    width: 100%;
    height: 34px;
    margin-top: 10px;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-ink) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(56, 141, 106, 0.2);
    position: relative;
    overflow: hidden;
  }

  .sf-create-action-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 100%);
    opacity: 0;
    transition: opacity 0.2s ease;
  }

  .sf-create-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(56, 141, 106, 0.3);
  }

  .sf-create-action-btn:hover::before {
    opacity: 1;
  }

  .sf-create-action-btn:active {
    transform: translateY(0);
  }

  /* Sidebar Shopify specific */
  .sf-nav-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 8px 6px;
    color: var(--ink-4);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .sf-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 9px;
    color: var(--ink-2);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
  }

  .sf-nav-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(56, 141, 106, 0.1) 0%, rgba(56, 141, 106, 0) 100%);
    opacity: 0;
    transition: opacity 0.2s ease;
  }

  .sf-nav-item:hover {
    background: rgba(255, 255, 255, 0.6);
    color: var(--brand);
    box-shadow: inset 0 0 0 1px rgba(56, 141, 106, 0.1);
  }

  .sf-nav-item:hover::before {
    opacity: 1;
  }

  .sf-nav-item.active {
    background: linear-gradient(135deg, var(--brand-soft) 0%, rgba(56, 141, 106, 0.08) 100%);
    color: var(--brand-ink);
    font-weight: 600;
    box-shadow: inset 0 0 0 1px var(--brand-line), 0 2px 6px rgba(56, 141, 106, 0.1);
  }

  .sf-nav-item .ti {
    font-size: 15px;
    flex-shrink: 0;
    transition: color 0.2s ease;
  }

  .sf-data-badge {
    margin-left: auto;
    font-size: 10.5px;
    font-weight: 550;
    color: var(--ink-4);
    background: var(--surface-3);
    padding: 1px 6px;
    border-radius: 4px;
    font-variant-numeric: tabular-nums;
  }

  .sf-sidebar-spacer {
    flex: 1;
  }

  .sf-sidebar-plan-section {
    margin-top: 8px;
    padding: 12px;
    background: var(--ink);
    color: #fff;
    border-radius: var(--radius);
    position: relative;
    overflow: hidden;
  }

  .sf-plan-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--brand);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
  }

  .sf-plan-name {
    font-size: 14px;
    font-weight: 550;
    margin-bottom: 8px;
  }

  .sf-usage-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
  }

  .sf-usage-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand), oklch(75% 0.13 155));
    width: 78%;
  }

  .sf-usage-text {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 12px;
  }

  .sf-upgrade-btn {
    width: 100%;
    height: 30px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    font-size: 12px;
    font-weight: 550;
    cursor: pointer;
  }

  .sf-upgrade-btn:hover {
    background: rgba(255, 255, 255, 0.12);
  }

  /* Visual Polish — Transitions & Tabler Icons */
  .sf-nav-item {
    transition: background 0.1s ease, color 0.1s ease;
  }

  .sf-nav-item .ti {
    font-size: 16px;
    color: var(--ink-4);
    flex-shrink: 0;
    width: 18px;
    text-align: center;
    transition: color 0.1s ease;
  }

  .sf-nav-item.active .ti {
    color: var(--brand);
  }

  .sf-sheet-tab {
    transition: background 0.1s ease, color 0.1s ease, border-color 0.1s ease;
  }

  .sf-quick-action-item {
    transition: background 0.1s ease;
  }

  /* Colored stat icon variants */
  .sf-stat-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    flex-shrink: 0;
  }

  .sf-stat-icon.brand {
    background: var(--brand-soft);
    color: var(--brand);
  }

  .sf-stat-icon.amber {
    background: var(--amber-soft);
    color: var(--amber);
  }

  .sf-stat-icon.rose {
    background: var(--rose-soft);
    color: var(--rose);
  }

  .sf-stat-icon.blue {
    background: var(--blue-soft);
    color: var(--blue);
  }

  .sf-stat-icon .ti {
    font-size: 16px;
  }

  /* Grid table specific */
  .sf-grid-table {
    flex: 1;
    overflow: auto;
  }

  .sf-img-cell {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 4px;
  }

  /* Spreadsheet grid styles */
  .sheet {
    display: grid;
    grid-template-columns: 30px 1fr;
    grid-template-rows: 24px 1fr;
    height: 100%;
  }

  .sheet-corner {
    grid-column: 1;
    grid-row: 1;
    background: var(--surface);
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-4);
  }

  .col-headers-wrap {
    grid-column: 2;
    grid-row: 1;
    overflow-x: auto;
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
  }

  .col-headers {
    display: flex;
    gap: 0;
  }

  .row-headers {
    grid-column: 1;
    grid-row: 2;
    background: var(--surface-2);
    border-right: 1px solid var(--line);
    overflow-y: auto;
  }

  #grid-scroll {
    grid-column: 2;
    grid-row: 2;
    overflow: auto;
    position: relative;
  }

  .grid-body {
    display: contents;
  }

  .row {
    display: contents;
  }

  .cell {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    min-height: 36px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 120px;
  }

  .cell.header {
    background: var(--surface-2);
    font-weight: 550;
    color: var(--ink);
    sticky-position: top;
  }
  }

  /* ============ Formula bar ============ */
  .formula-bar{
    display:grid;
    grid-template-columns: 80px 28px 1fr auto;
    align-items: center;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    height: 32px;
    font-size: 12.5px;
  }
  .name-box{
    display:flex; align-items:center; gap:6px;
    padding: 0 10px;
    height: 100%;
    border-right: 1px solid var(--line);
    color: var(--ink-3);
    cursor: pointer;
  }
  .name-box .cell{
    font-family: 'JetBrains Mono'; font-size: 11.5px; font-weight: 600;
    color: var(--ink);
  }
  .fx{
    display:grid; place-items:center;
    color: var(--ink-4);
    font-family: 'Instrument Serif', serif;
    font-style: italic;
    font-size: 14px;
    height: 100%;
    border-right: 1px solid var(--line);
    cursor: pointer;
  }
  .formula-input{
    padding: 0 12px;
    color: var(--ink-4);
    font-family: 'JetBrains Mono';
    font-size: 11.5px;
  }
  .formula-input span{ color: var(--ink-5); }
  .formula-meta{
    padding: 0 12px;
    color: var(--ink-4);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    display:flex; align-items:center; gap:10px;
  }

  /* ============ Canvas (sheet area) ============ */
  .canvas-wrap{
    height: 560px;
    flex-shrink: 0;
    overflow: hidden;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    position: relative;
  }

  .sheet{
    flex: 1;
    overflow: hidden;
    position: relative;
    background: var(--surface);
  }
  .sheet-corner{
    position: absolute; left:0; top:0;
    width: 40px; height: 28px;
    background: var(--surface-2);
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    display:grid; place-items:center;
    color: var(--ink-4);
  }
  .col-headers-wrap{
    position:absolute; left:40px; top:0; right:0; height:28px;
    overflow:hidden;
    z-index:2;
  }
  .col-headers{
    position:relative; width:2496px; height:28px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    display:flex;
    font-family: 'Inter';
    font-size: 11px; font-weight:550;
    color: var(--ink-3);
  }
  .col-headers > div{
    width: 96px;
    height: 100%;
    display:flex; align-items:center; justify-content:center;
    border-right: 1px solid var(--line);
    letter-spacing: 0.04em;
  }
  .row-headers{
    position: absolute; left:0; top:28px; bottom:0; width:40px;
    overflow:hidden;
    background: var(--surface-2);
    border-right: 1px solid var(--line);
    font-family: 'Inter';
    font-size: 11px; font-weight: 450;
    color: var(--ink-4);
    z-index:2;
  }
  #grid-scroll{
    position:absolute; top:28px; left:40px; right:0; bottom:0;
    overflow:auto;
  }
  .grid-body{
    position:relative;
    width:2496px;
    height:784px;
  }
  .row-headers > div{
    height: 28px;
    display:flex; align-items:center; justify-content:center;
    border-bottom: 1px solid var(--line-2);
    font-variant-numeric: tabular-nums;
  }

  /* selected cell highlight */
  .sel-cell{
    position: absolute;
    left: calc(96px * 4); /* col E — inside grid-scroll, no row-header offset */
    top: calc(28px * 2); /* row 3 — inside grid-scroll, no col-header offset */
    width: 96px; height: 28px;
    border: 1.5px solid var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
    pointer-events: none;
  }
  .sel-cell::after{
    content:""; position: absolute; right:-4px; bottom:-4px;
    width: 7px; height: 7px;
    background: var(--brand); border: 1.5px solid #fff;
  }

  /* empty state */
  .empty{
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    width: 480px;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 28px 28px 22px;
    box-shadow: var(--shadow-md);
  }
  .empty-art{
    width: 64px; height: 64px; margin: 0 auto 14px;
    border-radius: 14px;
    background: var(--surface-2);
    border:1px solid var(--line);
    position: relative;
    display:grid; place-items:center;
  }
  .empty-art::before{
    content:"";
    position:absolute; inset: 12px;
    border: 1.5px solid var(--brand);
    border-radius: 4px;
    background:
      linear-gradient(var(--brand) 1px, transparent 1px) 0 0/ 100% 8px,
      linear-gradient(90deg, var(--brand) 1px, transparent 1px) 0 0/ 12px 100%;
    opacity: .55;
  }
  .empty-art::after{
    content:""; position:absolute; right:-6px; bottom:-6px;
    width: 22px; height:22px; border-radius: 6px;
    background: var(--brand); color:#fff;
    box-shadow: 0 4px 10px -2px oklch(56% 0.12 155 / 0.4);
  }
  .empty-art .plus{
    position:absolute; right:-6px; bottom:-6px;
    width:22px; height:22px; display:grid; place-items:center;
    color: #fff; font-size: 14px; font-weight: 600;
    z-index: 2;
  }
  .empty h2{
    font-family: 'Instrument Serif', serif;
    font-weight: 400; font-size: 26px; line-height: 1.15;
    letter-spacing: -0.01em;
    margin: 0 0 6px;
  }
  .empty h2 em{ font-style: italic; color: var(--ink-3); }
  .empty p{
    font-size: 13px; color: var(--ink-3);
    margin: 0 0 18px;
    max-width: 360px; margin-left:auto; margin-right:auto;
  }
  .empty-cta{
    display:flex; gap: 8px; justify-content: center;
    margin-bottom: 16px;
  }
  .cta-primary{
    display:inline-flex; align-items:center; gap:7px;
    height: 34px; padding: 0 14px;
    background: var(--ink); color:#fff;
    border-radius: 8px;
    font-weight: 550; font-size: 12.5px;
    border: 1px solid var(--ink);
    cursor:pointer;
    box-shadow:
      0 1px 0 rgba(255,255,255,.08) inset,
      0 6px 16px -6px rgba(0,0,0,.3);
  }
  .cta-secondary{
    display:inline-flex; align-items:center; gap:7px;
    height: 34px; padding: 0 14px;
    background: var(--surface); color: var(--ink);
    border-radius: 8px;
    font-weight: 550; font-size: 12.5px;
    border: 1px solid var(--line-strong);
    cursor:pointer;
  }
  .empty-hint{
    display:flex; align-items:center; justify-content: center; gap: 6px;
    color: var(--ink-4);
    font-size: 11.5px;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
  }

  /* ============ Sheet tabs footer ============ */
  .sheet-tabs{
    display:flex; align-items: stretch;
    background: var(--surface-2);
    border-top: 1px solid var(--line);
    height: 32px;
    padding: 0 8px;
  }
  .sheet-tabs .tt-btn{
    width: 26px;
    display:grid; place-items: center;
    color: var(--ink-4); cursor: pointer;
  }
  .sheet-tabs .tt-btn:hover{ color: var(--ink-2); }
  .stab{
    display:inline-flex; align-items:center; gap:6px;
    padding: 0 12px;
    color: var(--ink-3);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    position: relative;
    border-right: 1px solid var(--line);
  }
  .stab .swatch{
    width:8px; height:8px; border-radius: 2px;
  }
  .stab.active{
    background: var(--surface);
    color: var(--ink);
    font-weight: 550;
  }
  .stab.active::after{
    content:""; position:absolute; left:0; right:0; top:0; height:2px;
    background: var(--brand);
  }
  .stab .chev{ color: var(--ink-5); }
  .sheet-tabs .add{
    display:inline-flex; align-items:center; gap:5px;
    padding: 0 10px;
    color: var(--ink-4); font-size: 12px;
    cursor: pointer;
  }
  .sheet-tabs .add:hover{ color: var(--ink-2); }
  .sheet-tabs .right{ margin-left:auto; display:flex; align-items:center; }

  .zoom{
    display:flex; align-items: center; gap: 4px;
    padding: 0 6px;
    color: var(--ink-3);
    font-size: 11.5px;
    font-variant-numeric: tabular-nums;
  }
  .zoom .tt-btn{ width:22px; height:22px; border-radius:4px; }
  .zoom .tt-btn:hover{ background: var(--surface-3); }
  .zoom .level{
    min-width: 38px; text-align:center;
    font-weight: 550; color: var(--ink-2);
  }

  /* ============ Below-canvas sections ============ */
  .below{
    padding: 20px 24px 32px;
    display: flex; flex-direction: column; gap: 20px;
    background: var(--bg);
  }

  .section-head{
    display: flex; align-items: baseline; gap: 12px;
    margin-bottom: 12px;
  }
  .section-head h3{
    margin: 0;
    font-family: 'Instrument Serif', serif;
    font-size: 22px; font-weight: 400; letter-spacing: -0.01em;
    color: var(--ink);
  }
  .section-head .sub{
    color: var(--ink-4);
    font-size: 12.5px;
    flex: 1;
  }
  .section-head .pill{
    display:inline-flex; align-items:center; gap:5px;
    font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 2px 7px; border-radius: 99px;
    background: var(--amber-soft);
    color: oklch(48% 0.12 75);
    border: 1px solid oklch(88% 0.05 80);
  }
  .section-head .link{
    color: var(--ink-3);
    font-size: 12px; font-weight: 500;
    cursor: pointer;
    display:inline-flex; align-items:center; gap:4px;
  }
  .section-head .link:hover{ color: var(--ink); }

  /* Templates */
  .tpl-grid{
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }
  .tpl{
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 16px 16px 14px;
    cursor: pointer;
    position: relative;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
    display: flex; flex-direction: column;
    min-width: 0;
  }
  .tpl:hover{
    border-color: var(--line-strong);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
  }
  .tpl-head{
    display:flex; align-items:center; gap: 8px;
    margin-bottom: 14px;
  }
  .tpl-ico{
    width: 32px; height: 32px;
    border-radius: 8px;
    display: grid; place-items: center;
    border: 1px solid;
  }
  .tpl-ico.brand{ background: var(--brand-soft); color: var(--brand); border-color: var(--brand-line); }
  .tpl-ico.amber{ background: var(--amber-soft); color: oklch(52% 0.12 75); border-color: oklch(88% 0.05 80); }
  .tpl-ico.violet{ background: var(--violet-soft); color: var(--violet); border-color: oklch(88% 0.04 295); }
  .tpl-ico.blue{ background: var(--blue-soft); color: var(--blue); border-color: oklch(88% 0.04 240); }
  .tpl-tag{
    margin-left: auto;
    font-family: 'JetBrains Mono';
    font-size: 10px; font-weight: 500;
    color: var(--ink-4);
    background: var(--surface-2);
    border: 1px solid var(--line);
    padding: 1px 5px; border-radius: 4px;
    font-variant-numeric: tabular-nums;
  }
  .tpl-name{
    font-size: 14px; font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.01em;
    margin-bottom: 3px;
  }
  .tpl-desc{
    font-size: 12px; color: var(--ink-4);
    line-height: 1.4;
    margin-bottom: 14px;
  }
  .tpl-foot{
    margin-top: auto;
    display: flex; align-items: center; gap: 6px;
    font-size: 11.5px;
    color: var(--ink-3);
    padding-top: 12px;
    border-top: 1px dashed var(--line);
  }
  .tpl-foot .cols{
    font-family: 'JetBrains Mono';
    font-size: 10.5px;
    font-variant-numeric: tabular-nums;
  }
  .tpl-foot .dot-sep{ color: var(--ink-5); }
  .tpl-foot .use{
    margin-left: auto;
    color: var(--ink);
    font-weight: 550;
    display:inline-flex; align-items:center; gap: 3px;
  }
  .tpl:hover .tpl-foot .use{ color: var(--brand); }

  /* Automations */
  .autom-card{
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
  }
  .autom-toolbar{
    display:flex; align-items: center; gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
  }
  .autom-filter{
    display:inline-flex; align-items: center; gap: 6px;
    height: 26px; padding: 0 9px;
    border-radius: 6px;
    background: var(--surface);
    border: 1px solid var(--line);
    font-size: 11.5px; font-weight: 500;
    color: var(--ink-2);
    cursor: pointer;
  }
  .autom-filter.active{ background: var(--ink); color: #fff; border-color: var(--ink); }
  .autom-filter .num{
    color: var(--ink-4);
    font-variant-numeric: tabular-nums;
    font-size: 10.5px;
  }
  .autom-filter.active .num{ color: rgba(255,255,255,.6); }
  .autom-toolbar .right{
    margin-left: auto;
    display: flex; align-items: center; gap: 6px;
  }
  .autom-row{
    display: grid;
    grid-template-columns: 32px 1fr 200px 130px 90px 28px;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line-2);
    cursor: pointer;
  }
  .autom-row:last-child{ border-bottom: none; }
  .autom-row:hover{ background: var(--surface-2); }

  .autom-ico{
    width: 32px; height: 32px;
    border-radius: 8px;
    display:grid; place-items:center;
    border: 1px solid;
  }
  .autom-name{
    display: flex; flex-direction: column; gap: 2px;
    min-width: 0;
  }
  .autom-title-row{
    display: flex; align-items: center; gap: 8px;
  }
  .autom-title{
    font-size: 13px; font-weight: 600; color: var(--ink);
    letter-spacing: -0.005em;
  }
  .badge-status{
    display:inline-flex; align-items:center; gap:4px;
    font-size: 10.5px; font-weight: 600;
    padding: 1px 7px 1px 6px;
    border-radius: 99px;
    border: 1px solid;
  }
  .badge-status.active{
    background: var(--brand-soft);
    color: var(--brand-ink);
    border-color: var(--brand-line);
  }
  .badge-status.active .pip{
    width: 5px; height: 5px; border-radius: 50%;
    background: var(--brand);
    box-shadow: 0 0 0 2px oklch(56% 0.12 155 / 0.2);
  }
  .badge-status.paused{
    background: var(--surface-3);
    color: var(--ink-3);
    border-color: var(--line);
  }
  .badge-status.paused .pip{
    width: 5px; height: 5px; border-radius: 50%;
    background: var(--ink-5);
  }
  .badge-status.draft{
    background: var(--amber-soft);
    color: oklch(48% 0.12 75);
    border-color: oklch(88% 0.05 80);
  }
  .badge-status.draft .pip{
    width: 5px; height: 5px; border-radius: 50%;
    background: var(--amber);
  }
  .autom-desc{
    font-size: 11.5px;
    color: var(--ink-4);
    line-height: 1.4;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .autom-trigger{
    display: flex; flex-direction: column; gap: 2px;
    min-width: 0;
  }
  .autom-trigger .label{
    font-size: 10px; color: var(--ink-4);
    text-transform: uppercase; letter-spacing: 0.05em;
    font-weight: 600;
  }
  .autom-trigger .val{
    font-family: 'JetBrains Mono';
    font-size: 11.5px;
    color: var(--ink-2);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .autom-runs{
    display: flex; flex-direction: column; gap: 2px;
    font-variant-numeric: tabular-nums;
  }
  .autom-runs .label{
    font-size: 10px; color: var(--ink-4);
    text-transform: uppercase; letter-spacing: 0.05em;
    font-weight: 600;
  }
  .autom-runs .val{
    font-size: 12px;
    color: var(--ink-2);
  }
  .autom-runs .val b{ color: var(--ink); font-weight: 600; }

  /* iOS-like toggle */
  .switch{
    width: 30px; height: 18px; border-radius: 99px;
    background: var(--line-strong);
    position: relative;
    cursor: pointer;
    transition: background .15s;
  }
  .switch::after{
    content:""; position: absolute;
    top: 2px; left: 2px;
    width: 14px; height: 14px; border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
    transition: transform .15s;
  }
  .switch.on{ background: var(--brand); }
  .switch.on::after{ transform: translateX(12px); }

  .autom-row .more{
    color: var(--ink-4);
    width: 24px; height: 24px; display:grid; place-items: center;
    border-radius: 5px;
  }
  .autom-row:hover .more{ color: var(--ink-2); }

  .autom-foot{
    padding: 12px 14px;
    display: flex; align-items: center; gap: 8px;
    background: var(--surface-2);
    border-top: 1px solid var(--line-2);
    font-size: 12px;
    color: var(--ink-3);
  }
  .autom-foot .cta{
    display: inline-flex; align-items: center; gap: 5px;
    color: var(--ink); font-weight: 550;
    cursor: pointer;
  }
  .autom-foot .cta:hover{ color: var(--brand); }
  .autom-foot .sep{ color: var(--ink-5); }

  /* Resources strip */
  .resources{
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
  .resource{
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    display:flex; align-items: flex-start; gap: 12px;
    cursor: pointer;
  }
  .resource:hover{ background: var(--surface-2); }
  .resource-ico{
    width: 30px; height: 30px;
    border-radius: 7px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    display:grid; place-items: center;
    color: var(--ink-3);
    flex-shrink: 0;
  }
  .resource-meta{ display:flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
  .resource-title{ font-size: 12.5px; font-weight: 600; color: var(--ink); }
  .resource-desc{ font-size: 11.5px; color: var(--ink-4); line-height: 1.35; }
  .resource-arrow{
    color: var(--ink-5);
    align-self: center;
  }
  .resource:hover .resource-arrow{ color: var(--ink-2); }

  /* ============ Right rail (AI + utilities) ============ */
  .rail{
    background: var(--surface);
    border-left: 1px solid var(--line);
    display:flex; flex-direction: column;
    min-width: 0;
    overflow: hidden;
  }
  .rail-tabs{
    display:flex; gap:0;
    padding: 8px 10px 0;
    border-bottom: 1px solid var(--line);
  }
  .rail-tab{
    padding: 8px 10px 10px;
    font-size: 12px; font-weight: 500;
    color: var(--ink-3);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    display:inline-flex; align-items:center; gap: 6px;
  }
  .rail-tab.active{
    color: var(--ink);
    font-weight: 550;
    border-bottom-color: var(--brand);
  }
  .rail-tab .pip{
    background: var(--brand-soft);
    color: var(--brand-ink);
    font-size: 9.5px; font-weight: 600;
    padding: 1px 5px; border-radius: 3px;
    letter-spacing: 0.04em;
  }
  .rail-tab .count{
    font-size: 10.5px; color: var(--ink-4);
    background: var(--surface-3);
    padding: 0 5px; border-radius: 3px;
    font-variant-numeric: tabular-nums;
  }

  .rail-body{
    flex: 1;
    overflow-y: auto;
    padding: 14px 14px 18px;
    display:flex; flex-direction: column; gap: 14px;
  }

  /* AI hero */
  .ai-hero{
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    position: relative;
    overflow: hidden;
  }
  .ai-hero::before{
    content:"";
    position:absolute; right:-40px; top:-40px;
    width: 140px; height: 140px; border-radius: 50%;
    background: radial-gradient(circle, var(--brand-tint) 0%, transparent 70%);
    pointer-events:none;
  }
  .ai-head{
    display:flex; align-items:center; gap:8px;
    margin-bottom: 10px;
    position: relative;
  }
  .ai-icon{
    width: 22px; height:22px; border-radius: 6px;
    background: var(--ink); color: #fff;
    display:grid; place-items: center;
    position: relative;
  }
  .ai-title{
    font-weight: 600; font-size: 13px;
  }
  .ai-pill{
    font-size: 9.5px; font-weight:600; letter-spacing: 0.06em;
    background: var(--brand); color:#fff;
    padding: 2px 5px; border-radius: 3px;
  }
  .ai-status{
    margin-left: auto;
    display:inline-flex; align-items:center; gap:5px;
    font-size: 10.5px; color: var(--ink-4);
  }
  .ai-status .dot{
    width:5px; height:5px; border-radius:50%;
    background: var(--brand);
    box-shadow: 0 0 0 2px var(--brand-soft);
  }

  .ai-suggest{
    font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
    color: var(--ink-4); text-transform: uppercase;
    margin-bottom: 8px;
    position: relative;
  }
  .chip-row{ display:flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; position:relative; }
  .chip{
    display:inline-flex; align-items:center; gap:5px;
    padding: 4px 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 99px;
    font-size: 11.5px;
    color: var(--ink-2);
    cursor: pointer;
  }
  .chip:hover{ border-color: var(--ink-4); }
  .chip .ico{ color: var(--ink-4); }

  .ai-input{
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 10px 10px 8px;
    position: relative;
  }
  .ai-input textarea{
    width: 100%; min-height: 50px;
    border: none; outline: none; resize: none;
    font-family: 'Inter'; font-size: 12.5px;
    color: var(--ink);
    background: transparent;
    padding: 0; margin: 0;
  }
  .ai-input textarea::placeholder{ color: var(--ink-4); }
  .ai-input-foot{
    display:flex; align-items:center; gap: 6px;
    margin-top: 8px;
  }
  .ai-tool{
    width: 24px; height:24px; border-radius: 5px;
    display:grid; place-items:center;
    color: var(--ink-4); cursor:pointer;
  }
  .ai-tool:hover{ background: var(--surface-2); color: var(--ink-2); }
  .ai-improve:hover{ background: var(--surface-2); color: #7c6af7; }
  .ai-improve.loading{ opacity: 0.4; pointer-events: none; cursor: default; }
  .ai-model{
    margin-left: auto;
    display:inline-flex; align-items:center; gap:5px;
    height: 24px; padding: 0 8px;
    background: var(--surface-2); border:1px solid var(--line);
    border-radius: 6px;
    font-size: 11px; color: var(--ink-3);
    cursor: pointer;
  }
  .ai-send{
    width: 26px; height: 26px;
    border-radius: 6px;
    background: var(--ink); color:#fff;
    display:grid; place-items:center;
    cursor: pointer;
    border:1px solid var(--ink);
  }

  /* Insight card */
  .card{
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
  }
  .card-head{
    display:flex; align-items:center; gap:8px;
    padding: 11px 12px 10px;
  }
  .card-title{ font-size: 12.5px; font-weight: 600; white-space: nowrap; }
  .card-head .more{ margin-left:auto; color: var(--ink-4); cursor: pointer; }
  .card-head .pip{
    font-size: 10px; font-weight: 600;
    padding: 1px 5px; border-radius: 3px;
    color: var(--brand-ink); background: var(--brand-soft);
    letter-spacing: 0.04em;
  }

  .action-list{
    display:flex; flex-direction: column;
  }
  .action-item{
    display:grid;
    grid-template-columns: 28px 1fr auto;
    align-items: start;
    gap: 10px;
    padding: 10px 12px;
    border-top: 1px solid var(--line-2);
    cursor: pointer;
  }
  .action-item:hover{ background: var(--surface-2); }
  .action-icon{
    width: 28px; height: 28px;
    border-radius: 7px;
    display:grid; place-items:center;
    border:1px solid var(--line);
    background: var(--surface-2);
    color: var(--ink-3);
  }
  .action-icon.brand{
    background: var(--brand-soft); color: var(--brand);
    border-color: var(--brand-line);
  }
  .action-icon.amber{ background: var(--amber-soft); color: var(--amber); border-color: oklch(88% 0.04 80); }
  .action-icon.violet{ background: var(--violet-soft); color: var(--violet); border-color: oklch(88% 0.04 295); }
  .action-icon.blue{ background: var(--blue-soft); color: var(--blue); border-color: oklch(88% 0.04 240); }

  .action-body .t{
    font-size: 12.5px; font-weight: 550; color: var(--ink); margin-bottom: 1px;
    display:flex; align-items:center; gap: 6px;
  }
  .action-body .t .kbd-key{ font-size: 9.5px; }
  .action-body .d{ font-size: 11.5px; color: var(--ink-4); line-height: 1.35; }
  .action-go{
    color: var(--ink-5);
    align-self: center;
  }
  .action-item:hover .action-go{ color: var(--ink-2); }

  /* Activity */
  .activity{
    display:flex; flex-direction: column;
  }
  .act-item{
    display:grid; grid-template-columns: 22px 1fr auto;
    gap: 10px;
    padding: 9px 12px;
    border-top: 1px solid var(--line-2);
    align-items: start;
  }
  .act-avatar{
    width: 22px; height: 22px; border-radius: 50%;
    font-size: 9.5px; font-weight: 600; color:#fff;
    display: grid; place-items: center;
    letter-spacing: 0;
  }
  .act-avatar.a1{ background: linear-gradient(135deg, oklch(64% 0.14 155), oklch(50% 0.12 155)); }
  .act-avatar.a2{ background: linear-gradient(135deg, oklch(64% 0.14 295), oklch(50% 0.12 295)); }
  .act-avatar.a3{ background: linear-gradient(135deg, oklch(64% 0.14 75), oklch(50% 0.12 75)); }
  .act-avatar.sys{ background: var(--ink); color:#fff; font-size: 11px;}
  .act-msg{ font-size: 12px; color: var(--ink-2); line-height: 1.4; }
  .act-msg b{ font-weight: 600; color: var(--ink); }
  .act-msg .tag{
    display:inline-block;
    font-family: 'JetBrains Mono'; font-size: 10.5px;
    background: var(--surface-2);
    color: var(--ink-3);
    border:1px solid var(--line);
    padding: 0 4px; border-radius: 3px;
    margin: 0 1px;
  }
  .act-time{ font-size: 10.5px; color: var(--ink-4); white-space: nowrap; font-variant-numeric: tabular-nums; }

  .card-foot{
    display:flex; align-items:center; justify-content:space-between;
    padding: 9px 12px;
    border-top: 1px solid var(--line-2);
    font-size: 11.5px;
    color: var(--ink-3);
    cursor: pointer;
  }
  .card-foot:hover{ background: var(--surface-2); color: var(--ink); }
  .card-foot .arrow{ color: var(--ink-4); }

  /* ============ Status bar ============ */
  .statusbar{
    grid-column: 1 / -1;
    background: var(--surface);
    border-top: 1px solid var(--line);
    display: flex; align-items: center;
    padding: 0 14px;
    font-size: 11px;
    color: var(--ink-4);
    gap: 16px;
    font-variant-numeric: tabular-nums;
  }
  .status-item{ display:inline-flex; align-items:center; gap: 6px; }
  .status-item .dot{ width:6px; height:6px; border-radius:50%; }
  .status-item .dot.ok{ background: var(--brand); }
  .status-item .dot.idle{ background: var(--ink-5); }
  .status-item b{ color: var(--ink-2); font-weight: 600; }
  .status-spacer{ flex: 1; }

  /* misc */
  .ds-art{
    position: absolute;
    pointer-events: none;
  }
  /* tiny "sparkles" within empty-state */
  .sparkle{
    position:absolute;
    width:6px; height:6px; opacity:.5;
    background:
      linear-gradient(var(--brand) 1px, transparent 1px) 50% 0/ 100% 50% no-repeat,
      linear-gradient(90deg, var(--brand) 1px, transparent 1px) 0 50%/ 50% 100% no-repeat;
  }

/* #features — responsive + dark mode */
@media (max-width: 768px) {
  #features .features-grid { grid-template-columns: 1fr !important; }
  #features .sector-grid   { grid-template-columns: 1fr 1fr !important; }
}
[data-theme="dark"] #features .step-card-bg {
  background: var(--surface, #1a1a1a) !important;
  border-color: var(--line, #333) !important;
}
[data-theme="dark"] #features h2,
[data-theme="dark"] #features h3 { color: var(--fg, #f9fafb) !important; }


/* ============ Tablet (≤1024px) ============ */
@media (max-width: 1024px) {
  .app {
    grid-template-columns: 220px 1fr;
  }
  .topbar {
    grid-template-columns: 220px 1fr auto;
  }
  .rail {
    display: none;
    position: fixed; top: 0; right: 0; bottom: 0;
    width: 320px; z-index: 300;
    transform: translateX(100%);
    transition: transform 0.25s ease;
  }
  .rail.open {
    display: flex;
    transform: translateX(0);
  }
  .cmd { min-width: 160px; }
}

/* ============ Mobile (≤768px) ============ */
@media (max-width: 768px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: 52px minmax(0, 1fr);
    min-height: 0;
  }
  .topbar {
    grid-template-columns: auto 1fr auto;
  }
  .brand { border-right: none; padding: 0 12px; }
  .brand-name { display: none; }
  .topbar-search { justify-content: flex-start; padding: 0 8px; }
  .cmd { min-width: 0; width: 100%; max-width: 220px; }

  /* Sidebar → left drawer */
  .sidebar {
    display: none;
    position: fixed; top: 0; left: 0; bottom: 60px;
    width: 280px; z-index: 300;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
  }
  .sidebar.open {
    display: flex;
    transform: translateX(0);
  }

  /* Rail → right drawer */
  .rail {
    display: none;
    position: fixed; top: 0; right: 0; bottom: 60px;
    width: min(320px, 92vw); z-index: 300;
    transform: translateX(100%);
    transition: transform 0.25s ease;
  }
  .rail.open {
    display: flex;
    transform: translateX(0);
  }

  /* Statusbar hidden on mobile */
  .statusbar { display: none; }

  /* Toolbar: allow wrap on very small screens */
  .toolbar { flex-wrap: nowrap; overflow-x: auto; }

  /* Toolbar buttons slightly smaller */
  .tb-btn { height: 26px !important; padding: 0 6px !important; font-size: 11px !important; }
  .tb-icon { width: 26px !important; height: 26px !important; }

  /* ========== ADVANCED MODERN DESIGN EFFECTS ========== */

  /* Smooth animations and transitions */
  @keyframes slideInFromLeft {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
  }

  @keyframes slideInFromRight {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
  }

  @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  @keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
  }

  @keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
  }

  /* Navigation item animation */
  .sf-nav-item {
    animation: slideInFromLeft 0.3s ease;
  }

  /* Stat items with smooth entrance */
  .sf-stat-item {
    animation: slideInFromLeft 0.3s ease;
  }

  /* Modern focus states for better accessibility */
  .sf-search-input:focus,
  .sf-filter-btn:focus,
  .sf-create-action-btn:focus,
  .sf-sync-btn:focus {
    outline: none;
  }

  /* Enhanced button interactivity */
  button {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  }

  button:active {
    transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* Modern scrollbar styling */
  ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }

  ::-webkit-scrollbar-track {
    background: transparent;
  }

  ::-webkit-scrollbar-thumb {
    background: rgba(138, 140, 134, 0.3);
    border-radius: 4px;
    transition: background 0.2s ease;
  }

  ::-webkit-scrollbar-thumb:hover {
    background: rgba(138, 140, 134, 0.5);
  }

  /* Enhanced text selection */
  ::selection {
    background: rgba(56, 141, 106, 0.2);
    color: var(--ink);
  }

  /* Modern input placeholders */
  input::placeholder,
  textarea::placeholder {
    color: var(--ink-4);
    opacity: 0.7;
  }

  /* Smooth color transitions for interactive elements */
  .sf-topbar-title,
  .sf-ai-title {
    transition: color 0.2s ease;
  }

  .sf-topbar-title:hover {
    cursor: pointer;
  }

  /* Enhanced visibility for data badges */
  .sf-data-badge {
    transition: all 0.2s ease;
    font-weight: 600;
    letter-spacing: 0.03em;
  }

  .sf-data-badge:hover {
    transform: scale(1.05);
  }

  /* Smooth panel transitions */
  .sf-sidebar,
  .sf-topbar,
  .sf-ai-panel {
    transition: all 0.3s ease;
  }

  /* Premium upgrade button styling */
  .sf-upgrade-btn {
    transition: all 0.2s ease;
    font-weight: 600;
    letter-spacing: 0.03em;
  }

  .sf-upgrade-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
  }

  /* Modern footer link interactivity */
  .sf-footer-link {
    transition: all 0.2s ease;
    position: relative;
  }

  .sf-footer-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, var(--brand), transparent);
    opacity: 0;
    transition: opacity 0.2s ease;
  }

  .sf-footer-link:hover::after {
    opacity: 1;
  }

  /* AI content smooth scroll */
  .sf-ai-content {
    scroll-behavior: smooth;
  }

  /* Modern backdrop filter support detection */
  @supports (backdrop-filter: blur(10px)) {
    .sf-sidebar,
    .sf-topbar,
    .sf-ai-panel,
    .sf-stats-bar,
    .sf-filter-bar {
      /* Already has backdrop-filter applied */
    }
  }

  /* Elegant typography improvements */
  .sf-footer-title {
    letter-spacing: 0.03em;
    transition: color 0.2s ease;
  }

  .sf-topbar-title {
    letter-spacing: -0.01em;
  }

  .sf-ai-title {
    letter-spacing: -0.01em;
  }

  /* Modern icon transitions */
  .ti {
    transition: color 0.2s ease, transform 0.2s ease;
  }

  .sf-nav-item:hover .ti {
    color: var(--brand);
    transform: translateX(2px);
  }

  /* Enhanced stat icon animations */
  .sf-stat-icon {
    transition: all 0.2s ease;
  }

  .sf-stat-item:hover .sf-stat-icon {
    transform: scale(1.1);
  }

  /* Modern dividers and separators */
  .sf-ai-tabs {
    gap: 0;
    transition: background 0.2s ease;
  }

  /* Smooth grid item interactions */
  .cell {
    transition: background 0.1s ease, color 0.1s ease;
  }

  .cell:hover:not(.header) {
    background: linear-gradient(180deg, rgba(56, 141, 106, 0.05) 0%, rgba(56, 141, 106, 0) 100%);
  }

  /* Premium input styling */
  input[type="text"],
  textarea {
    transition: all 0.2s ease;
  }

  input[type="text"]:focus,
  textarea:focus {
    transition: all 0.3s ease;
  }

  /* Modern box shadow enhancements */
  .sf-sync-btn,
  .sf-create-action-btn,
  .sf-sheet-tab.active,
  .sf-quick-action-item:hover {
    box-shadow: 0 2px 8px rgba(56, 141, 106, 0.15);
  }

  /* Ultra-modern floating effect on hover */
  .sf-sync-btn:hover,
  .sf-create-action-btn:hover,
  .sf-sheet-tab:hover:not(.active) {
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  /* Modern aspect ratio for profile images */
  .sf-img-cell {
    transition: all 0.2s ease;
  }

  .sf-img-cell:hover {
    transform: scale(1.05);
  }

  /* Smooth color gradients for text elements */
  .sf-stat-value,
  .sf-footer-stat,
  .sf-ai-title {
    transition: background 0.2s ease;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   AI PREVIEW MODAL (.aip-*)
   Shopify AI suggestions review before write-back
   ═══════════════════════════════════════════════════════════════════ */
.aip-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: aip-fade-in 0.15s ease-out;
}
@keyframes aip-fade-in { from { opacity: 0; } to { opacity: 1; } }

.aip-modal {
  background: white;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 780px;
  max-height: 85vh;
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: aip-slide-up 0.2s ease-out;
}
@keyframes aip-slide-up { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.aip-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
}
.aip-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 16px; font-weight: 700; color: #065f46;
}
.aip-title i { font-size: 20px; color: #10b981; }
.aip-count {
  font-size: 12px; font-weight: 500; color: #059669;
  background: white; padding: 3px 10px; border-radius: 999px;
  border: 1px solid #a7f3d0;
}
.aip-close {
  background: transparent; border: none; cursor: pointer;
  width: 32px; height: 32px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: #64748b; font-size: 18px;
  transition: background 0.15s;
}
.aip-close:hover { background: rgba(0, 0, 0, 0.05); color: #1e293b; }

.aip-body {
  flex: 1; overflow-y: auto;
  padding: 12px 20px;
  background: #fafaf9;
}

.aip-row {
  background: white;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.aip-row.accepted {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
  background: #f0fdf4;
}
.aip-row.rejected {
  border-color: #ef4444;
  background: #fef2f2;
  opacity: 0.7;
}
.aip-row-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.aip-product-title {
  font-size: 13px; font-weight: 600; color: #1e293b;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 500px;
}
.aip-field-badge {
  font-size: 10px; font-weight: 700;
  padding: 3px 8px; border-radius: 4px;
  background: #e0f2fe; color: #0369a1;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.aip-diff {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 10px;
  font-size: 12.5px; line-height: 1.7;
}
.aip-diff-old {
  padding: 8px 10px;
  background: #fef9f9; color: #374151;
  border-radius: 6px;
  max-height: 120px; overflow-y: auto;
  min-height: 20px;
}
.aip-diff-old em { color: #9ca3af; font-style: italic; }
.aip-diff-arrow { color: #94a3b8; font-size: 13px; text-align: center; }
.aip-diff-new {
  padding: 8px 10px;
  background: #f9fefa; color: #374151;
  border-radius: 6px;
  max-height: 120px; overflow-y: auto;
  min-height: 20px;
}
.aip-actions {
  display: flex; gap: 8px; justify-content: flex-end;
}
.aip-btn-accept, .aip-btn-reject, .aip-btn-edit {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px;
  font-size: 12px; font-weight: 600;
  border-radius: 6px; cursor: pointer;
  border: 1.5px solid;
  transition: all 0.15s;
}
.aip-btn-accept {
  background: white; color: #059669; border-color: #a7f3d0;
}
.aip-btn-accept:hover { background: #f0fdf4; border-color: #10b981; }
.aip-btn-accept.active {
  background: #10b981; color: white; border-color: #10b981;
}
.aip-btn-reject {
  background: white; color: #dc2626; border-color: #fecaca;
}
.aip-btn-reject:hover { background: #fef2f2; border-color: #ef4444; }
.aip-btn-reject.active {
  background: #ef4444; color: white; border-color: #ef4444;
}
.aip-btn-edit {
  background: white; color: #6366f1; border-color: #c7d2fe;
}
.aip-btn-edit:hover { background: #eef2ff; border-color: #818cf8; }

.aip-footer {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid #e5e7eb;
  background: white;
}
.aip-btn-primary, .aip-btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  font-size: 13px; font-weight: 600;
  border-radius: 8px; cursor: pointer;
  border: 1px solid; transition: all 0.15s;
}
.aip-btn-primary {
  background: #10b981; color: white; border-color: #10b981;
}
.aip-btn-primary:hover:not(:disabled) { background: #059669; border-color: #059669; }
.aip-btn-primary:disabled {
  background: #d1d5db; border-color: #d1d5db; cursor: not-allowed; opacity: 0.6;
}
.aip-btn-ghost {
  background: white; color: #475569; border-color: #cbd5e1;
}
.aip-btn-ghost:hover { background: #f8fafc; border-color: #94a3b8; }

/* ============ MOBILE (≤768px) — horizontal overflow guard ============ */
html, body { overflow-x: hidden; max-width: 100%; }

@media (max-width: 768px) {
  .shopify-layout,
  .shopify-layout.ai-panel-open {
    grid-template-columns: 1fr !important;
    grid-template-rows: 52px auto 1fr auto !important;
    height: auto;
    min-height: 100vh;
    overflow-x: hidden;
  }
  .sf-sidebar { display: none !important; }
  .sf-topbar,
  .sf-main-content-row,
  .sf-stats-row {
    grid-column: 1 / -1 !important;
  }
  .sf-topbar { padding: 0 12px !important; }
  .sf-main-content-row { padding: 0 12px !important; gap: 8px !important; }
  .sf-stats-row { padding: 12px 12px 8px !important; gap: 8px; }

  .sf-table-panel { min-width: 0; }
  .sf-table-scroll { overflow-x: auto; }
  .sf-toolbar { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

@media (max-width: 480px) {
  .sf-topbar { height: auto !important; padding: 8px 12px !important; flex-wrap: wrap; }
  .sf-stat-card { min-width: 140px; }
}
