    :root {
      --bg: #f1f5f4;
      --surface: #ffffff;
      --primary: #005c5c;
      --primary-dark: #004346;
      --accent: #ff865e;
      --border: #d6dfdf;
      --danger-bg: #fee2e2;
      --danger: #b91c1c;
      --muted: #6b7280;
      --tab-bg: #e5eded;
    }
    * { box-sizing: border-box; }
    body {
      margin: 0;
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      background: var(--bg);
      color: #0f172a;
      min-height: 100vh;
    }
    header.topbar {
      background: var(--primary);
      color: #fff;
      padding: 0.9rem 1.5rem;
      display: flex;
      align-items: center;
      gap: 1rem;
    }
    header.topbar .logo {
      font-weight: 700;
      display: flex;
      gap: 0.4rem;
      align-items: center;
    }
    header.topbar .logo span.peach {
      font-size: 1.3rem;
    }
    header.topbar small {
      opacity: .85;
    }
    main {
      max-width: 1150px;
      margin: 1.4rem auto 2rem;
      padding: 0 1.2rem;
    }
    .tabs {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: .6rem .6rem 0 0;
      display: flex;
      gap: .05rem;
      overflow: hidden;
    }
    .tab {
      flex: 0 0 auto;
      padding: .6rem 1.1rem;
      cursor: pointer;
      font-weight: 500;
      font-size: 0.85rem;
      background: transparent;
      border: none;
      border-bottom: 2px solid transparent;
      display: flex;
      align-items: center;
      gap: .4rem;
    }
    .tab.active {
      background: #fff;
      border-bottom: 2px solid var(--accent);
    }
    .panel {
      background: #fff;
      border: 1px solid var(--border);
      border-top: none;
      padding: 1.3rem 1.3rem 1.5rem;
      border-radius: 0 0 .6rem .6rem;
    }
    .input-group {
      margin-bottom: 1rem;
    }
    .input-label {
      font-size: .7rem;
      text-transform: uppercase;
      letter-spacing: .04em;
      color: #4b5563;
      margin-bottom: .35rem;
      display: flex;
      align-items: center;
      gap: .4rem;
    }
    .label-pill {
      background:#10b98117;
      border:1px solid #10b9814a;
      border-radius:999px;
      padding:0.1rem .35rem;
      font-size:.6rem;
    }
    .input-inline {
      display: flex;
      gap: .6rem;
      align-items: center;
    }
    .input-inline input {
      flex: 1 1 auto;
      border: 1px solid #d1d5db;
      border-radius: .45rem;
      padding: .5rem .6rem;
      font-size: .85rem;
    }
    .input-inline select {
      flex: 1 1 auto;
      border: 1px solid #d1d5db;
      border-radius: .45rem;
      padding: .5rem .6rem;
      font-size: .85rem;
      min-width: 280px;
      background: #fff;
    }
    .input-help {
      font-size: .65rem;
      color: #6b7280;
      margin-top: .3rem;
    }
    .btn {
      background: var(--primary);
      color: #fff;
      border: none;
      border-radius: .45rem;
      padding: .45rem .85rem;
      font-weight: 600;
      cursor: pointer;
      font-size: 0.8rem;
    }
    .btn.compact {
      padding-left: .65rem;
      padding-right: .65rem;
      white-space: nowrap;
    }
    .btn.secondary {
      background: #e2e8f0;
      color: #111827;
    }
    .btn.danger {
      background: #dc2626;
    }
    .btn:disabled {
      opacity: .55;
      cursor: not-allowed;
    }
    .search-type-bar {
      display: flex;
      gap: 0;
      border: 1px solid #cbd5d5;
      border-radius: .5rem;
      overflow: hidden;
      margin-bottom: 1rem;
      background: #edf4f3;
    }
    .search-tab {
      flex: 1 1 0;
      text-align: center;
      padding: .55rem;
      font-weight: 600;
      font-size: .8rem;
      cursor: pointer;
      border-right: 1px solid #dbe3e2;
      background: transparent;
      color: #0f172a;
      display: flex;
      align-items: center;
      gap: .35rem;
      justify-content: center;
    }
    .search-tab:last-child {
      border-right: none;
    }
    .search-tab.active {
      background: var(--primary);
      color: #fff;
    }
    textarea {
      width: 100%;
      min-height: 140px;
      border: 1px solid #d1d5db;
      border-radius: .45rem;
      padding: .55rem .6rem;
      resize: vertical;
      font-family: inherit;
      font-size: .8rem;
    }
    .actions-row {
      display: flex;
      gap: .6rem;
      margin-top: .7rem;
      align-items: center;
    }
    .status-line {
      font-size: .7rem;
      color: #6b7280;
    }
    .status-line.error {
      color: #b91c1c;
      font-weight: 600;
    }
    .region-box {
      background: #ecf3f2;
      border: 1px solid rgba(0, 92, 92, .1);
      border-radius: .35rem;
      padding: .4rem .65rem .5rem;
      margin-top: .5rem;
      font-size: .7rem;
      line-height: 1.3;
      color: #0f172a;
    }
    .region-box strong {
      font-size: .65rem;
      text-transform: uppercase;
      letter-spacing: .04em;
    }
    .region-summary {
      margin-top: .1rem;
    }
    .region-details {
      margin-top: .3rem;
      color: #334155;
    }
    .region-details summary {
      cursor: pointer;
      font-size: .65rem;
      font-weight: 600;
      color: #0f4f52;
    }
    .region-details span {
      display: block;
      margin-top: .25rem;
      overflow-wrap: anywhere;
    }
    .region-warning {
      margin-top: .4rem;
      color: #8a2106;
      font-weight: 600;
    }
    .address-warning {
      display: none;
      margin-top: .55rem;
      padding: .55rem .65rem;
      border-radius: .45rem;
      border: 1px solid rgba(217, 119, 6, .28);
      background: #fff7ed;
      color: #9a3412;
      font-size: .72rem;
      line-height: 1.35;
    }
    .address-warning strong {
      display: block;
      font-size: .67rem;
      text-transform: uppercase;
      letter-spacing: .04em;
      margin-bottom: .15rem;
    }
    .notice-modal[hidden] {
      display: none;
    }
    .notice-modal {
      position: fixed;
      inset: 0;
      z-index: 1000;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 1rem;
      background: rgba(15, 23, 42, .44);
    }
    .notice-modal__panel {
      position: relative;
      width: min(100%, 480px);
      background: #fff;
      border: 1px solid rgba(15, 23, 42, .14);
      border-radius: .5rem;
      padding: 1.15rem 1.2rem 1.2rem;
      box-shadow: 0 22px 50px rgba(15, 23, 42, .22);
    }
    .notice-modal__eyebrow {
      font-size: .66rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: .06em;
      color: var(--primary);
      margin-bottom: .4rem;
    }
    .notice-modal__panel h2 {
      margin: 0;
      padding-right: 1.9rem;
      color: #0f172a;
      font-size: 1.15rem;
      line-height: 1.25;
      letter-spacing: 0;
    }
    .notice-modal__panel p {
      margin: .7rem 0 1rem;
      color: #334155;
      font-size: .88rem;
      line-height: 1.45;
    }
    .notice-modal__close {
      position: absolute;
      top: .65rem;
      right: .65rem;
      width: 2rem;
      height: 2rem;
      border: 1px solid #d1d5db;
      border-radius: 999px;
      background: #fff;
      color: #475569;
      font-size: 1.25rem;
      line-height: 1;
      cursor: pointer;
    }
    .notice-modal__close:hover,
    .notice-modal__close:focus-visible {
      border-color: var(--primary);
      color: var(--primary);
      outline: none;
    }
    .notice-modal__action {
      min-width: 5.5rem;
    }
    .filters {
      display: flex;
      gap: .35rem;
      margin: 1rem 0 .7rem;
      flex-wrap: wrap;
    }
    .filter-btn {
      border: 1px solid #d1d5db;
      background: #e5e7eb;
      border-radius: 9999px;
      padding: .25rem .6rem .3rem;
      font-size: .7rem;
      display: flex;
      gap: .3rem;
      align-items: center;
      cursor: pointer;
    }
    .filter-btn.active {
      background: #0f4f52;
      color: #fff;
      border-color: transparent;
    }
    .filter-separator {
      font-size: .7rem;
      color: #6b7280;
      align-self: center;
    }
    .cards {
      display: grid;
      gap: .75rem;
    }
    .card-product {
      background: #fff;
      border: 1px solid #d6dfdf;
      border-radius: .55rem;
      padding: .7rem .7rem .85rem;
      display: flex;
      gap: .7rem;
      align-items: flex-start;
    }
    .product-thumb {
      width: 65px;
      min-width: 65px;
      height: 65px;
      border-radius: .4rem;
      border: 1px solid rgba(209,213,219,.4);
      object-fit: cover;
      background: #edf1f3;
    }
    .badge {
      display: inline-block;
      background: #065f46;
      color: #fff;
      border-radius: 9999px;
      padding: .1rem .5rem .2rem;
      font-size: .6rem;
    }
    .badge.unavailable {
      background: #f59e0b;
    }
    .badge.not-found {
      background: #dc2626;
    }
    .product-content {
      flex: 1 1 auto;
    }
    .product-title-line {
      display: flex;
      gap: .4rem;
      align-items: center;
      flex-wrap: wrap;
    }
    .product-title {
      font-weight: 600;
      font-size: .85rem;
    }
    .product-meta {
      font-size: .63rem;
      color: #6b7280;
      margin-top: .25rem;
      display: flex;
      flex-wrap: wrap;
      gap: .45rem;
    }
    .price-line {
      display: flex;
      gap: .45rem;
      align-items: baseline;
      margin-top: .4rem;
    }
    .price-current {
      font-weight: 700;
      font-size: .85rem;
    }
    .price-original {
      text-decoration: line-through;
      font-size: .65rem;
      color: #94a3b8;
    }
    .discount-pill {
      background: rgba(255,134,94,.16);
      color: #c2410c;
      border-radius: 9999px;
      padding: .1rem .5rem .15rem;
      font-size: .6rem;
    }
    .offer-chips {
      display: flex;
      gap: .35rem;
      flex-wrap: wrap;
      margin-top: .45rem;
    }
    .offer-chip {
      background: rgba(5,150,105,.1);
      border: 1px solid rgba(5,150,105,.25);
      border-radius: .4rem;
      padding: .15rem .5rem .2rem;
      font-size: .6rem;
    }
    .offer-chips.loyalty .offer-chip {
      background: rgba(99,102,241,.12);
      border-color: rgba(99,102,241,.3);
      color: #3730a3;
    }
    .not-found-card {
      background: var(--danger-bg);
      border: 1px solid rgba(248,113,113,.5);
    }
    .not-found-title {
      font-weight: 700;
      color: var(--danger);
      margin-bottom: .35rem;
    }
    .product-extra {
      display: flex;
      flex-wrap: wrap;
      gap: .45rem;
      font-size: .65rem;
      margin-top: .35rem;
      color: #475569;
    }
    .icon-chip {
      background: rgba(30,64,175,.1);
      border: 1px solid rgba(30,64,175,.2);
      border-radius: .35rem;
      padding: .15rem .45rem .2rem;
      font-size: .6rem;
      color: #1e40af;
    }
    .badge.new {
      background: rgba(14,165,233,.18);
      color: #0369a1;
    }
    .export-row {
      margin-top: .75rem;
    }
    .progress-container {
      display: none;
      margin-top: .75rem;
    }
    .progress-phase {
      margin-top: .55rem;
    }
    .progress-phase:first-child {
      margin-top: 0;
    }
    .progress-phase-head {
      display: flex;
      justify-content: space-between;
      gap: .75rem;
      align-items: baseline;
      margin-bottom: .18rem;
    }
    .progress-phase-title {
      font-size: .68rem;
      font-weight: 700;
      color: #334155;
      text-transform: uppercase;
      letter-spacing: .04em;
    }
    .progress-phase-stats {
      font-size: .68rem;
      color: #64748b;
      font-variant-numeric: tabular-nums;
    }
    .progress-bar-outer {
      width: 100%;
      height: 10px;
      background: #e2e8f0;
      border-radius: 999px;
      overflow: hidden;
    }
    .progress-bar-outer.secondary {
      background: #e9edf5;
    }
    .progress-bar-inner {
      height: 100%;
      width: 0;
      background: linear-gradient(90deg, #0ea5e9, #0284c7);
      transition: width .25s ease;
    }
    .progress-bar-inner.secondary {
      background: linear-gradient(90deg, #10b981, #059669);
    }
    .progress-label {
      font-size: .7rem;
      color: #475569;
      margin-top: .35rem;
    }

    @media (max-width: 820px) {
      .card-product {
        flex-direction: row;
      }
      .input-inline {
        flex-direction: column;
        align-items: stretch;
      }
      .actions-row {
        flex-wrap: wrap;
      }
      .filter-separator {
        display: none;
      }
    }

    /* ---------- Promo Forecast tab ---------- */
    #panel-forecast {
      accent-color: var(--primary);
      caret-color: var(--primary);
    }
    #panel-forecast ::selection {
      background: rgba(0, 92, 92, .16);
    }
    #panel-forecast :is(input, textarea, button, summary, a):focus-visible {
      outline: 2px solid var(--primary);
      outline-offset: 2px;
    }
    #panel-forecast :is(.text-input, textarea):focus {
      border-color: var(--primary);
    }
    .forecast-header {
      margin-bottom: 1.25rem;
    }
    .forecast-title {
      margin: 0 0 .35rem;
      font-size: 1rem;
    }
    .forecast-intro {
      margin: 0;
      font-size: .8rem;
      line-height: 1.5;
      color: #374151;
      max-width: 72ch;
    }
    .forecast-privacy {
      margin: .45rem 0 0;
      font-size: .7rem;
      color: var(--muted);
    }

    /* Workbook drop zone */
    .file-drop {
      position: relative;
      display: flex;
      align-items: center;
      gap: .85rem;
      border: 1.5px dashed #9fb4b4;
      border-radius: .55rem;
      padding: 1rem 1.1rem;
      background: #f7fbfa;
      cursor: pointer;
      transition: border-color .15s ease-out, background-color .15s ease-out;
    }
    .file-drop:hover,
    .file-drop.is-dragging {
      border-color: var(--primary);
      background: #eef7f5;
    }
    .file-drop.is-dragging {
      border-style: solid;
    }
    .file-drop.is-invalid {
      border-color: var(--danger);
      background: #fef7f7;
    }
    .file-drop input[type="file"] {
      position: absolute;
      width: 1px;
      height: 1px;
      opacity: 0;
    }
    .file-drop:focus-within {
      outline: 2px solid var(--primary);
      outline-offset: 2px;
    }
    .file-drop__icon {
      flex: none;
      font-size: 1.5rem;
      line-height: 1;
    }
    .file-drop__text {
      flex: 1 1 auto;
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: .2rem;
    }
    .file-drop__title {
      font-weight: 600;
      font-size: .85rem;
      color: var(--primary-dark);
    }
    .file-drop__hint {
      font-size: .7rem;
      line-height: 1.4;
      color: var(--muted);
    }
    .file-drop__cta {
      flex: none;
      display: inline-block;
      pointer-events: none;
    }
    .file-drop:hover .file-drop__cta {
      background: #d5dee8;
    }

    /* Selected workbooks */
    .file-list {
      list-style: none;
      margin: .55rem 0 0;
      padding: 0;
      display: flex;
      flex-wrap: wrap;
      gap: .4rem;
    }
    .file-list:empty {
      display: none;
    }
    .file-list li {
      display: flex;
      align-items: center;
      gap: .4rem;
      max-width: 100%;
      background: #eef2f2;
      border: 1px solid var(--border);
      border-radius: 999px;
      padding: .1rem .15rem .1rem .75rem;
      font-size: .72rem;
    }
    .file-list__name {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .file-list__size {
      flex: none;
      color: var(--muted);
      font-variant-numeric: tabular-nums;
    }
    .file-list__remove {
      flex: none;
      display: inline-grid;
      place-items: center;
      width: 1.9rem;
      height: 1.9rem;
      border: none;
      border-radius: 999px;
      background: transparent;
      cursor: pointer;
      font-size: .75rem;
      color: var(--muted);
      transition: background-color .15s ease-out, color .15s ease-out;
    }
    .file-list__remove:hover {
      background: var(--danger-bg);
      color: var(--danger);
    }

    /* Pasted promo lines: keep each Excel row on one line */
    .forecast-lines {
      min-height: 112px;
      line-height: 1.45;
      white-space: pre;
      overflow-x: auto;
    }

    .text-input {
      border: 1px solid #d1d5db;
      border-radius: .45rem;
      padding: .45rem .6rem;
      font-size: .85rem;
      font-family: inherit;
      max-width: 100%;
      background: #fff;
    }
    .forecast-week .text-input {
      min-width: 11rem;
    }

    /* Advanced settings disclosure */
    .forecast-advanced {
      font-size: .8rem;
      border: 1px solid var(--border);
      border-radius: .55rem;
      background: #fafcfc;
    }
    .forecast-advanced summary {
      list-style: none;
      display: flex;
      align-items: center;
      gap: .55rem;
      padding: .6rem .85rem;
      border-radius: .55rem;
      cursor: pointer;
      font-weight: 600;
      color: var(--primary);
    }
    .forecast-advanced summary::-webkit-details-marker {
      display: none;
    }
    .forecast-advanced summary::before {
      content: "";
      flex: none;
      width: .4rem;
      height: .4rem;
      margin: 0 .1rem 0 .05rem;
      border-right: 2px solid currentColor;
      border-bottom: 2px solid currentColor;
      transform: rotate(-45deg);
      transition: transform .15s ease-out;
    }
    .forecast-advanced[open] summary::before {
      transform: rotate(45deg);
    }
    .forecast-advanced summary:hover .forecast-advanced__label {
      text-decoration: underline;
      text-underline-offset: .2em;
    }
    .forecast-advanced__current {
      margin-left: auto;
      font-weight: 400;
      font-size: .72rem;
      color: var(--muted);
      font-variant-numeric: tabular-nums;
      text-align: right;
    }
    .forecast-advanced__body {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
      gap: 0 1.5rem;
      padding: .15rem .85rem 0;
      border-top: 1px solid var(--border);
    }
    .forecast-advanced__body .input-group {
      margin: .7rem 0 .85rem;
    }

    /* Run + status */
    .forecast-actions {
      margin-top: 1.25rem;
      flex-wrap: wrap;
    }
    .forecast-run {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: .45rem;
      min-width: 9.5rem;
    }
    .forecast-run:not(:disabled):hover {
      background: var(--primary-dark);
    }
    .forecast-run__spinner {
      display: none;
      width: .8rem;
      height: .8rem;
      border: 2px solid rgba(255, 255, 255, .35);
      border-top-color: #fff;
      border-radius: 50%;
      animation: fc-spin .7s linear infinite;
    }
    .forecast-run.is-running .forecast-run__spinner {
      display: inline-block;
    }
    .forecast-run.is-running:disabled {
      opacity: .85;
      cursor: progress;
    }
    @keyframes fc-spin {
      to { transform: rotate(360deg); }
    }
    @media (prefers-reduced-motion: reduce) {
      .forecast-run__spinner { animation: none; }
      .file-drop,
      .file-list__remove,
      .forecast-advanced summary::before { transition: none; }
    }
    .forecast-elapsed {
      font-size: .7rem;
      color: var(--muted);
      font-variant-numeric: tabular-nums;
    }

    /* Result */
    .forecast-result {
      margin-top: 1rem;
      border: 1px solid #b7dfcf;
      background: #f0faf5;
      border-radius: .55rem;
      padding: .85rem 1rem .95rem;
      font-size: .8rem;
    }
    .forecast-result__top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: .6rem 1rem;
    }
    .forecast-result__head {
      font-weight: 700;
      font-size: .95rem;
      color: #0f3d36;
      font-variant-numeric: tabular-nums;
    }
    .btn.forecast-result__again {
      text-decoration: none;
      background: #fff;
      border: 1px solid #b7dfcf;
      color: var(--primary-dark);
    }
    .btn.forecast-result__again:hover {
      border-color: var(--primary);
    }
    .forecast-result__facts {
      display: grid;
      grid-template-columns: max-content minmax(0, 1fr);
      gap: .3rem 1.1rem;
      margin: .75rem 0 0;
    }
    .forecast-result__facts dt {
      padding-top: .1rem;
      font-size: .68rem;
      text-transform: uppercase;
      letter-spacing: .04em;
      color: #4b6360;
    }
    .forecast-result__facts dd {
      margin: 0;
      color: #1f2937;
      overflow-wrap: anywhere;
      font-variant-numeric: tabular-nums;
    }
    .forecast-result__warn {
      margin-top: .8rem;
      padding: .5rem .65rem;
      background: #fff7e6;
      border: 1px solid #f5d08a;
      border-radius: .4rem;
      color: #713f12;
      line-height: 1.45;
    }

    @media (max-width: 640px) {
      .tabs {
        overflow-x: auto;
        scrollbar-width: none;
      }
      .file-drop {
        padding: .9rem;
        gap: .7rem;
      }
      .file-drop__cta {
        display: none;
      }
      .forecast-advanced summary {
        flex-wrap: wrap;
        row-gap: .15rem;
      }
      .forecast-advanced__current {
        flex-basis: 100%;
        margin-left: 1.1rem;
        text-align: left;
      }
      .forecast-run {
        flex: 1 1 100%;
        padding-top: .6rem;
        padding-bottom: .6rem;
      }
    }
