@charset "UTF-8";
:root {
  color-scheme: light;
  --brand: #168252;
  --brand-deep: #0e6841;
  --brand-soft: #e7f4ed;
  --brand-tint: #f3faf6;
  --ink: #18322a;
  --muted: #687a72;
  --line: #e4ece7;
  --surface: #ffffff;
  --canvas: #f5f8f6;
  --warning: #9a6110;
  --error: #a13e37;
  --shadow: 0 12px 32px rgba(25, 57, 43, .06);
  font-family: "Noto Sans Arabic", "Noto Naskh Arabic", Tahoma, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--canvas); }
body { margin: 0; color: var(--ink); background: var(--canvas); line-height: 1.55; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(22, 130, 82, .24); outline-offset: 2px; }
.app-frame { min-height: 100vh; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 1180px; margin: 0 auto; padding: 14px 28px; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: inherit; min-width: 0; }
.brand img { display: block; width: 66px; height: 66px; padding: 4px; border: 1px solid #edf2ee; background: #fff; object-fit: contain; border-radius: 14px; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.25; }
.brand-copy strong { color: var(--brand-deep); font-size: 17px; letter-spacing: .07em; }
.brand-copy small { color: var(--muted); font-size: 12px; margin-top: 3px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.read-only-badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid #d5eadc; border-radius: 999px; color: var(--brand-deep); background: var(--brand-tint); font-size: 12px; font-weight: 700; white-space: nowrap; }
.status-dot { width: 8px; height: 8px; background: #38a76e; border-radius: 50%; box-shadow: 0 0 0 3px rgba(56, 167, 110, .13); }
.icon-button { display: inline-grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; transition: border-color .16s ease, transform .16s ease; }
.icon-button:hover { border-color: #9dcab0; transform: translateY(-1px); }
.icon-button svg, .view-tab svg, .secondary-button svg, .select-wrap > svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.main-content { max-width: 960px; margin: 0 auto; padding: 12px 28px 56px; }
.intro-row { position: relative; display: flex; align-items: center; justify-content: space-between; min-height: 142px; margin: 4px 0 16px; padding: 26px 30px; overflow: hidden; border: 1px solid #deeee4; border-radius: 24px; background: linear-gradient(115deg, #f3faf6 0%, #ffffff 75%); }
.intro-row::after { position: absolute; content: ""; left: 7%; bottom: -70px; width: 210px; height: 210px; border-radius: 50%; background: rgba(22, 130, 82, .045); }
.eyebrow { margin: 0 0 5px; color: var(--brand); font-size: 12px; font-weight: 800; letter-spacing: .02em; }
h1, h2, h3, p { margin-top: 0; }
.intro-row h1 { margin: 0; font-size: clamp(23px, 4vw, 31px); line-height: 1.35; letter-spacing: -.025em; }
.intro-copy { margin: 7px 0 0; color: var(--muted); font-size: 14px; }
.intro-mark { display: grid; place-items: center; width: 78px; height: 78px; flex: 0 0 auto; margin-inline-start: 20px; border-radius: 25px; color: var(--brand); background: #e7f4ed; }
.intro-mark svg { width: 42px; height: 42px; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.view-tabs { display: flex; align-items: center; gap: 7px; margin: 18px 0 14px; padding: 5px; width: fit-content; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.view-tab { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 15px; border: 0; border-radius: 12px; color: var(--muted); background: transparent; cursor: pointer; font-size: 13px; font-weight: 700; transition: color .16s ease, background .16s ease; }
.view-tab svg { width: 18px; height: 18px; }
.view-tab.is-active { color: #fff; background: var(--brand); box-shadow: 0 5px 14px rgba(22, 130, 82, .18); }
.nav-count { min-width: 20px; padding: 1px 5px; border-radius: 999px; color: var(--brand-deep); background: #eff7f2; font-size: 11px; text-align: center; }
.view-panel { animation: appear .18s ease-out; }
.view-panel[hidden] { display: none; }
@keyframes appear { from { opacity: .5; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin: 22px 0 14px; }
.panel-heading h2 { margin: 0 0 4px; font-size: 20px; }
.panel-heading p, .search-panel-heading p, .settings-section-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 13px; border: 1px solid #d9e9df; border-radius: 12px; color: var(--brand-deep); background: var(--surface); cursor: pointer; font-weight: 700; font-size: 13px; transition: background .16s ease, border-color .16s ease; }
.secondary-button:hover { border-color: #abd2b8; background: var(--brand-tint); }
.secondary-button:disabled { cursor: wait; opacity: .65; }
.secondary-button svg { width: 17px; height: 17px; }
.sheet-picker-card, .search-panel, .settings-section { padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.sheet-picker-card { margin-bottom: 14px; }
.sheet-picker-card > label, .search-field label { display: block; margin-bottom: 7px; color: #51635b; font-size: 12px; font-weight: 800; }
.sheet-picker-row { display: flex; align-items: center; gap: 12px; }
.select-wrap { position: relative; flex: 1; min-width: 0; }
.select-wrap > svg { position: absolute; z-index: 1; top: 50%; right: 14px; width: 19px; height: 19px; color: var(--brand); transform: translateY(-50%); pointer-events: none; }
.select-wrap select { width: 100%; min-height: 48px; padding: 0 44px 0 36px; border: 1px solid var(--line); border-radius: 13px; appearance: none; color: var(--ink); background-color: var(--brand-tint); cursor: pointer; font-weight: 700; }
.sheet-count { color: var(--muted); font-size: 12px; white-space: nowrap; }
.search-panel { padding: 20px; }
.search-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.search-panel-heading h3, .results-heading h3, .settings-section-heading h3 { margin: 0 0 3px; font-size: 15px; }
.text-button { padding: 4px 0; border: 0; color: var(--brand-deep); background: transparent; cursor: pointer; font-size: 12px; font-weight: 800; text-decoration: none; }
.text-button:hover { text-decoration: underline; }
.search-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.search-field { min-width: 0; }
.search-field input { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid #dfe8e2; border-radius: 13px; color: var(--ink); background: #fbfdfc; transition: border-color .15s ease, box-shadow .15s ease, background .15s ease; }
.search-field input:disabled { cursor: wait; opacity: .6; }
.load-progress { display: flex; align-items: center; gap: 10px; margin: -4px 0 14px; color: var(--brand-deep); font-size: 12px; font-variant-numeric: tabular-nums; font-weight: 800; }
.load-progress[hidden] { display: none !important; }
.load-progress-track { height: 9px; flex: 1; overflow: hidden; border-radius: 999px; background: var(--brand-soft); }
.load-progress-fill { width: 5%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #168252, #45b879); transition: width .25s ease; }
.load-progress > span { min-width: 35px; text-align: right; }
.search-field input::placeholder { color: #92a099; }
.search-field input:focus { border-color: #8dc5a3; outline: 0; background: var(--surface); box-shadow: 0 0 0 3px rgba(22, 130, 82, .1); }
.search-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 28px; margin-top: 12px; color: var(--muted); font-size: 12px; }
.live-status { display: inline-flex; align-items: center; gap: 6px; }
.live-status.is-error { color: var(--error); }
.live-status.is-loading::before { content: ""; width: 11px; height: 11px; border: 2px solid #cfe2d5; border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.result-count { font-weight: 700; color: var(--brand-deep); }
.results-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 23px 2px 10px; }
.results-heading h3 { margin: 0; font-size: 16px; }
.sheet-label { max-width: 55%; overflow: hidden; padding: 4px 9px; border-radius: 999px; color: var(--brand-deep); background: var(--brand-soft); font-size: 11px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.results-list { display: flex; flex-direction: column; gap: 10px; }
.result-card { padding: 16px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: 0 5px 16px rgba(25, 57, 43, .035); transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.result-card:hover { border-color: #c3dfce; transform: translateY(-1px); box-shadow: 0 9px 22px rgba(25, 57, 43, .07); }
.result-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.result-title { min-width: 0; margin: 0; color: var(--ink); font-size: 16px; font-weight: 800; overflow-wrap: anywhere; }
.result-subtitle { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.favorite-button { display: inline-grid; place-items: center; flex: 0 0 auto; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 12px; color: #839188; background: var(--surface); cursor: pointer; transition: color .15s ease, background .15s ease, border-color .15s ease, transform .15s ease; }
.favorite-button:hover { transform: scale(1.04); }
.favorite-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.favorite-button.is-favorite { border-color: #f0c4c0; color: #bd4c43; background: #fff6f5; }
.favorite-button.is-favorite svg { fill: currentColor; }
.core-fields { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.data-pill { display: inline-flex; align-items: baseline; gap: 5px; min-height: 27px; padding: 4px 9px; border: 1px solid #e1eee5; border-radius: 9px; color: #52665b; background: #f7fbf8; font-size: 11px; }
.data-pill strong { color: var(--brand-deep); font-size: 10px; letter-spacing: .02em; }
.extra-details { margin-top: 10px; border-top: 1px solid #eff3f0; }
.extra-details summary { width: fit-content; padding-top: 9px; color: var(--brand-deep); cursor: pointer; font-size: 11px; font-weight: 800; }
.extra-details dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 14px; margin: 9px 0 0; }
.extra-details dl div { min-width: 0; }
.extra-details dt { color: var(--muted); font-size: 10px; }
.extra-details dd { margin: 1px 0 0; color: var(--ink); font-size: 12px; overflow-wrap: anywhere; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 160px; padding: 25px; border: 1px dashed #d5e3da; border-radius: 17px; color: var(--muted); background: rgba(255,255,255,.55); text-align: center; }
.empty-state strong { margin-bottom: 4px; color: var(--ink); font-size: 14px; }
.empty-state span { font-size: 12px; }
.suggestion-box { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.suggestion-box[hidden] { display: none; }
.suggestion-chip { padding: 6px 10px; border: 1px solid #cfe3d6; border-radius: 999px; color: var(--brand-deep); background: var(--brand-tint); cursor: pointer; font-size: 12px; }
.suggestion-chip:hover { border-color: var(--brand); background: var(--brand-soft); }
.favorite-search-wrap { max-width: 560px; margin: 0 0 14px; padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.settings-section { margin: 14px 0; }
.settings-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.settings-actions { display: flex; align-items: center; gap: 12px; }
.settings-list { display: flex; flex-direction: column; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 8px 2px; border-top: 1px solid #eef2ef; }
.settings-row:first-child { border-top: 0; }
.settings-row-copy { min-width: 0; }
.settings-row-copy strong { display: block; font-size: 13px; }
.settings-row-copy small { display: block; margin-top: 1px; color: var(--muted); font-size: 11px; }
.switch { position: relative; display: inline-flex; align-items: center; flex: 0 0 auto; width: 42px; height: 24px; padding: 2px; border: 0; border-radius: 999px; background: #d7e0da; cursor: pointer; transition: background .16s ease; }
.switch::after { width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.18); content: ""; transition: transform .16s ease; }
.switch[aria-checked="true"] { background: var(--brand); }
.switch[aria-checked="true"]::after { transform: translateX(-18px); }
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 25px; padding: 14px 3px; color: var(--muted); font-size: 11px; }
.site-footer span:first-child { color: var(--brand-deep); font-weight: 900; letter-spacing: .08em; }
.mobile-nav { display: none; }
body[data-theme="dark"] { color-scheme: dark; --ink: #e8f1eb; --muted: #aabbb1; --line: #30443a; --surface: #17231d; --canvas: #101914; --brand-soft: #1d3c2c; --brand-tint: #1a2d22; --shadow: 0 12px 32px rgba(0,0,0,.18); }
body[data-theme="dark"] .intro-row { border-color: #30483a; background: linear-gradient(115deg, #1a2c21 0%, #17231d 75%); }
body[data-theme="dark"] .intro-row::after { background: rgba(65, 160, 105, .09); }
body[data-theme="dark"] .intro-mark, body[data-theme="dark"] .read-only-badge { border-color: #304d3a; color: #a7d6b8; background: #1c3426; }
body[data-theme="dark"] .brand-copy strong, body[data-theme="dark"] .site-footer span:first-child { color: #80c99c; }
body[data-theme="dark"] .sheet-picker-card > label, body[data-theme="dark"] .search-field label { color: #b4c3ba; }
body[data-theme="dark"] .select-wrap select, body[data-theme="dark"] .search-field input { border-color: #35483d; color: var(--ink); background: #111b15; }
body[data-theme="dark"] .search-field input::placeholder { color: #75877c; }
body[data-theme="dark"] .load-progress { color: #a7d6b8; }
body[data-theme="dark"] .data-pill { border-color: #354b3d; color: #bed0c4; background: #1a2a20; }
body[data-theme="dark"] .data-pill strong { color: #92d5aa; }
body[data-theme="dark"] .extra-details { border-color: #304239; }
body[data-theme="dark"] .empty-state { border-color: #344b3d; background: rgba(23,35,29,.65); }
body[data-theme="dark"] .settings-row { border-color: #304239; }
body[data-theme="dark"] .favorite-button.is-favorite { border-color: #633a37; color: #f08e84; background: #33201e; }
@media (max-width: 700px) {
  .search-fields { grid-template-columns: minmax(0, 1fr); }
  .topbar { padding: 10px 16px; }
  .brand img { width: 56px; height: 56px; }
  .brand-copy strong { font-size: 15px; }
  .main-content { padding: 4px 14px 102px; }
  .intro-row { min-height: 124px; padding: 20px 18px; border-radius: 20px; }
  .intro-mark { width: 58px; height: 58px; margin-inline-start: 10px; border-radius: 19px; }
  .intro-mark svg { width: 34px; height: 34px; }
  .intro-copy { max-width: 300px; font-size: 12px; }
  .view-tabs { display: none; }
  .panel-heading { margin-top: 18px; }
  .sheet-picker-card, .search-panel { padding: 14px; border-radius: 16px; }
  .search-fields { gap: 10px; }
  .search-field input { min-height: 46px; padding-inline: 11px; font-size: 14px; }
  .mobile-nav { position: fixed; z-index: 20; right: 0; bottom: 0; left: 0; display: flex; justify-content: space-around; gap: 4px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(14px); }
  body[data-theme="dark"] .mobile-nav { background: rgba(23,35,29,.94); }
  .mobile-nav .view-tab { flex: 1; flex-direction: column; gap: 2px; min-height: 50px; padding: 4px 3px; font-size: 10px; }
  .mobile-nav .view-tab.is-active { box-shadow: none; }
  .site-footer { flex-direction: column; align-items: flex-start; gap: 2px; }
}
@media (max-width: 430px) {
  .brand-copy { display: none; }
  .read-only-badge { padding: 7px 10px; }
  .intro-row h1 { font-size: 22px; }
  .search-fields { grid-template-columns: 1fr; }
  .extra-details dl { grid-template-columns: 1fr; }
  .settings-section-heading { align-items: flex-start; flex-direction: column; }
  .settings-actions { align-self: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
/* Sheet directory and direct-search experience */
.home-heading { margin: 16px 0 22px; }
.home-heading h1 { margin: 0; font-size: clamp(24px, 4vw, 34px); }
.sheet-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.sheet-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; min-height: 172px; padding: 20px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--sheet-color) 25%, white); border-radius: 20px; color: var(--ink); background: linear-gradient(145deg, color-mix(in srgb, var(--sheet-color) 12%, white), var(--surface) 78%); box-shadow: var(--shadow); text-align: right; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease; }
.sheet-card:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(25,57,43,.12); }
.sheet-card::before { position: absolute; top: 0; right: 0; bottom: 0; width: 6px; content: ""; background: var(--sheet-color); }
.sheet-card-tab { padding: 4px 10px; border-radius: 999px; color: white; background: var(--sheet-color); font-size: 11px; font-weight: 800; }
.sheet-card-title { margin-top: 14px; color: var(--sheet-color); font-size: 19px; line-height: 1.35; }
.sheet-card-description { margin-top: 7px; color: var(--muted); font-size: 13px; }
.sheet-card-arrow { position: absolute; left: 17px; bottom: 14px; color: var(--sheet-color); font-size: 22px; }
.search-actions { display: flex; align-items: center; gap: 8px; }
.back-button { display: block; margin-bottom: 5px; }
.sheet-image-area { margin: 12px 0; }
.sheet-image-area[hidden] { display: none; }
.sheet-image-button { display: flex; align-items: center; gap: 10px; padding: 8px 13px 8px 16px; border: 1px solid var(--line); border-radius: 14px; color: var(--brand-deep); background: var(--surface); cursor: pointer; font-weight: 800; }
.sheet-image-button img { width: 48px; height: 42px; border-radius: 8px; object-fit: cover; }
.app-dialog { position: fixed; inset: 50% auto auto 50%; width: min(92vw, 390px); max-width: calc(100vw - 28px); padding: 28px 22px 22px; border: 1px solid var(--line); border-radius: 20px; color: var(--ink); background: var(--surface); box-shadow: 0 24px 80px rgba(0,0,0,.25); text-align: center; transform: translate(-50%, -50%); }
.app-dialog::backdrop { background: rgba(14, 27, 20, .58); backdrop-filter: blur(3px); }
.app-dialog h2 { margin: 0 0 10px; font-size: 19px; }
.dialog-close { position: absolute; top: 7px; left: 10px; width: 34px; height: 34px; border: 0; border-radius: 50%; color: var(--muted); background: transparent; font-size: 27px; line-height: 1; cursor: pointer; }
.dialog-close:hover { background: var(--brand-tint); }
.share-url { padding: 10px; overflow-wrap: anywhere; border-radius: 10px; background: var(--brand-tint); font-size: 12px; }
.qr-image { display: block; width: 220px; height: 220px; max-width: 80%; margin: 12px auto; object-fit: contain; }
.image-dialog { width: min(94vw, 680px); }
.image-dialog a { display: block; }
.image-dialog img { display: block; max-width: 100%; max-height: 68vh; margin: auto; border-radius: 12px; object-fit: contain; }
.image-dialog p { margin: 10px 0 0; color: var(--muted); font-size: 12px; }
@media (max-width: 600px) { .sheet-cards { grid-template-columns: 1fr; gap: 12px; } .sheet-card { min-height: 150px; } .search-actions .secondary-button { min-height: 36px; padding: 0 9px; font-size: 11px; } .panel-heading { align-items: center; } .panel-heading h2 { font-size: 18px; } }
/* English-only left-to-right presentation */
:root { font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif; }
html, body { direction: ltr; text-align: left; }
.sheet-card { text-align: left; }
.sheet-card::before { right: auto; left: 0; }
.sheet-card-arrow { left: auto; right: 17px; }
.dialog-close { left: auto; right: 10px; }
.sheet-label { direction: ltr; }
.search-field input { direction: ltr; text-align: left; }
@media (max-width: 700px) { .site-footer { align-items: flex-start; } }
/* Warehouse result card redesign */
.result-card { display: flex; flex-direction: column; gap: 14px; padding: 20px; border-radius: 22px; }
.result-identifiers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.result-identifier { display: flex; align-items: center; gap: 9px; min-width: 0; min-height: 58px; padding: 12px 16px; border: 1px solid #d8eadc; border-radius: 15px; color: var(--ink); background: #eff8f0; }
.result-identifier-sap { background: #e5f4e7; }
.result-identifier-bin { background: #eff8ef; }
.result-identifier-label { flex: 0 0 auto; font-size: 14px; font-weight: 800; }
.result-identifier strong { min-width: 0; overflow-wrap: anywhere; font-size: clamp(16px, 2.5vw, 22px); letter-spacing: .025em; }
.result-card .result-title { display: flex; align-items: center; justify-content: center; min-height: 108px; margin: 0; padding: 20px; border: 1px solid #bfe2c3; border-radius: 17px; color: #143b22; background: #cfead1; font-size: clamp(20px, 4.4vw, 32px); line-height: 1.35; text-align: center; }
.result-category { display: flex; align-items: center; gap: 8px; min-height: 60px; padding: 12px 16px; border-radius: 15px; color: #18322a; background: #eff8f0; font-size: clamp(16px, 2.8vw, 22px); }
.result-category span:first-child { font-weight: 700; }
.result-actions { display: flex; align-items: center; gap: 12px; padding: 1px 4px; }
.result-action { display: inline-grid; place-items: center; width: 52px; height: 52px; border: 1px solid transparent; border-radius: 16px; background: transparent; cursor: pointer; transition: transform .16s ease, background .16s ease, border-color .16s ease; }
.result-action:hover { transform: translateY(-2px); background: var(--brand-tint); border-color: var(--line); }
.result-action:active { transform: scale(.96); }
.result-action svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.result-action-share { color: #0c9880; }
.result-action-copy { color: #248ad1; }
.result-action-images { color: var(--brand); }
.result-action-status { min-height: 0; color: var(--muted); font-size: 11px; }
.result-action-status:empty { display: none; }
.result-card .extra-details { margin-top: 0; }
@media (max-width: 560px) {
  .result-card { gap: 11px; padding: 14px; border-radius: 18px; }
  .result-identifiers { gap: 8px; }
  .result-identifier { align-items: flex-start; flex-direction: column; justify-content: center; gap: 2px; min-height: 60px; padding: 9px 11px; }
  .result-identifier-label { font-size: 11px; }
  .result-identifier strong { font-size: 16px; }
  .result-card .result-title { min-height: 100px; padding: 16px 11px; }
  .result-category { min-height: 50px; padding: 10px 12px; }
  .result-actions { gap: 8px; }
  .result-action { width: 46px; height: 46px; }
}
/* Dark theme for redesigned warehouse result cards */
body[data-theme="dark"] .result-card {
  border-color: #2d4337;
  background: #17231d;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .22);
}
body[data-theme="dark"] .result-card:hover {
  border-color: #47785a;
  box-shadow: 0 14px 30px rgba(0, 0, 0, .3);
}
body[data-theme="dark"] .result-identifier {
  border-color: #314b3a;
  color: #e4eee7;
  background: #1b2b21;
}
body[data-theme="dark"] .result-identifier-sap {
  border-color: #3b6245;
  background: #20392a;
}
body[data-theme="dark"] .result-identifier-bin {
  border-color: #304a3b;
  background: #1d3025;
}
body[data-theme="dark"] .result-identifier-label { color: #a9c8b2; }
body[data-theme="dark"] .result-identifier strong { color: #f0f7f2; }
body[data-theme="dark"] .result-card .result-title {
  border-color: #3c6949;
  color: #edf8ef;
  background: #23442e;
}
body[data-theme="dark"] .result-category {
  border: 1px solid #2f4738;
  color: #d9e7dd;
  background: #1b2a21;
}
body[data-theme="dark"] .result-category span:first-child { color: #a9c8b2; }
body[data-theme="dark"] .result-action {
  border-color: #2d4337;
  background: #1c2a22;
}
body[data-theme="dark"] .result-action:hover {
  border-color: #47785a;
  background: #263b2d;
}
body[data-theme="dark"] .result-action-share { color: #55d7b7; }
body[data-theme="dark"] .result-action-copy { color: #75bdff; }
body[data-theme="dark"] .result-action-images { color: #8fd9a4; }
body[data-theme="dark"] .result-action-status { color: #aabbb1; }
/* Dark theme for warehouse directory cards */
body[data-theme="dark"] .sheet-card {
  border-color: color-mix(in srgb, var(--sheet-color) 38%, #304239);
  color: var(--ink);
  background: linear-gradient(145deg, color-mix(in srgb, var(--sheet-color) 24%, #17231d), #17231d 78%);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .2);
}
body[data-theme="dark"] .sheet-card:hover {
  border-color: color-mix(in srgb, var(--sheet-color) 58%, #536b5c);
  background: linear-gradient(145deg, color-mix(in srgb, var(--sheet-color) 31%, #1a2a20), #1a2a20 78%);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .3);
}
body[data-theme="dark"] .sheet-card:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--sheet-color) 70%, #b8e4c5);
  outline-offset: 3px;
}
body[data-theme="dark"] .sheet-card-tab {
  color: #f2fbf4;
  background: color-mix(in srgb, var(--sheet-color) 76%, #0b1710);
}
body[data-theme="dark"] .sheet-card-title {
  color: color-mix(in srgb, var(--sheet-color) 58%, #d6f0dc);
}
body[data-theme="dark"] .sheet-card-description { color: #b3c4b8; }
body[data-theme="dark"] .sheet-card-arrow {
  color: color-mix(in srgb, var(--sheet-color) 62%, #d4eed9);
}
/* Compact identifier typography: keep each label and value on one row */
.result-identifier {
  flex-direction: row;
  align-items: center;
  gap: 7px;
  min-height: 54px;
}
.result-identifier-label { font-size: 12px; }
.result-identifier strong {
  font-size: clamp(14px, 1.7vw, 18px);
  font-weight: 700;
  letter-spacing: .01em;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.result-card .result-title {
  min-height: 92px;
  font-size: clamp(18px, 3.5vw, 27px);
}
.result-category { min-height: 52px; font-size: clamp(14px, 2vw, 18px); }
@media (max-width: 560px) {
  .result-identifier {
    flex-direction: row;
    align-items: center;
    gap: 5px;
    min-height: 48px;
    padding: 8px 9px;
  }
  .result-identifier-label { flex: 0 0 auto; font-size: 10px; }
  .result-identifier strong { min-width: 0; font-size: 14px; }
  .result-card .result-title { min-height: 82px; font-size: clamp(17px, 5vw, 22px); }
  .result-category { min-height: 46px; font-size: 14px; }
}
/* Focus mode: keep the active query and results in view while typing */
body.search-focus-mode .topbar,
body.search-focus-mode .panel-heading,
body.search-focus-mode .search-panel-heading,
body.search-focus-mode .search-footer,
body.search-focus-mode .results-heading,
body.search-focus-mode #arabicSuggestions { display: none !important; }
body.search-focus-mode .main-content { padding-top: 0; }
body.search-focus-mode .search-panel {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0 0 12px;
  padding: 12px 16px;
  border-radius: 0 0 16px 16px;
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(18, 43, 29, .12);
}
body.search-focus-mode .search-fields { grid-template-columns: minmax(0, 1fr); gap: 0; }
body.search-focus-mode .search-field:not(.is-focused) { display: none; }
body.search-focus-mode .search-field.is-focused label { margin-bottom: 5px; font-size: 11px; }
body.search-focus-mode .search-field.is-focused input { min-height: 46px; }
body.search-focus-mode .results-list { gap: 12px; }
body[data-theme="dark"].search-focus-mode .search-panel {
  border-color: #30443a;
  background: #17231d;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
}
@media (max-width: 600px) {
  body.search-focus-mode .search-panel { padding: 9px 12px; }
  body.search-focus-mode .search-field.is-focused input { min-height: 44px; }
}
/* Explicit path from the one-field focus view to additional filters */
.focus-more-filters {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  margin-top: 9px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--brand-deep);
  background: var(--brand-tint);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}
.focus-more-filters:hover { border-color: #9dcab0; background: var(--brand-soft); }
.focus-more-filters[hidden] { display: none !important; }
.bin-search-toggle { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; min-height: 38px; margin: 0; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; color: var(--brand-deep); background: var(--brand-tint); cursor: pointer; font-size: 12px; font-weight: 750; }
.bin-search-toggle:hover { border-color: #9dcab0; background: var(--brand-soft); }
body.search-focus-mode .focus-more-filters { margin-top: 8px; }
body[data-theme="dark"] .focus-more-filters {
  border-color: #355142;
  color: #cde8d4;
  background: #1d3025;
}
body[data-theme="dark"] .focus-more-filters:hover {
  border-color: #4d795e;
  background: #263d2e;
}
body[data-theme="dark"] .bin-search-toggle { border-color: #355142; color: #cde8d4; background: #1d3025; }
body[data-theme="dark"] .bin-search-toggle:hover { border-color: #4d795e; background: #263d2e; }
/* Large, A4-like QR dialog */
.qr-dialog {
  box-sizing: border-box;
  width: min(94vw, 820px);
  max-width: calc(100vw - 20px);
  max-height: 94vh;
  max-height: 94dvh;
  overflow: auto;
  padding: 36px 30px 28px;
  border-radius: 24px;
}
.qr-dialog h2 { margin-bottom: 14px; font-size: clamp(21px, 3vw, 28px); }
.qr-dialog .share-url {
  max-width: 100%;
  margin: 0 auto 14px;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: 12px;
}
.qr-dialog .qr-image {
  width: min(80vw, 700px);
  height: min(80vw, 700px);
  max-width: 100%;
  margin: 16px auto 20px;
  border: 1px solid #e6ece8;
  border-radius: 8px;
  background: #fff;
  image-rendering: pixelated;
}
@media (max-width: 600px) {
  .qr-dialog { width: 96vw; max-width: calc(100vw - 12px); padding: 34px 12px 18px; }
  .qr-dialog .qr-image { width: min(84vw, 620px); height: min(84vw, 620px); margin: 12px auto 16px; }
}
.qr-download-status { display: block; min-height: 18px; margin-top: 8px; color: var(--muted); font-size: 12px; }
/* Floating return-to-top control */
.scroll-top {
  position: fixed;
  z-index: 30;
  right: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 54px;
  height: 54px;
  padding: 5px;
  border: 1px solid #55a878;
  border-radius: 50%;
  color: #fff;
  background: #168252;
  box-shadow: 0 6px 18px rgba(14, 74, 44, .28);
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
}
.scroll-top:hover { transform: translateY(-3px); background: #116c43; box-shadow: 0 9px 22px rgba(14, 74, 44, .34); }
.scroll-top:active { transform: scale(.95); }
.scroll-top svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.scroll-top span { font-size: 9px; font-weight: 900; letter-spacing: .08em; line-height: 1; }
.scroll-top[hidden] { display: none !important; }
body[data-theme="dark"] .scroll-top { border-color: #64bc84; color: #102016; background: #78d096; box-shadow: 0 7px 20px rgba(0, 0, 0, .38); }
body[data-theme="dark"] .scroll-top:hover { background: #94e0a9; }
@media (max-width: 600px) {
  .scroll-top { right: 14px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); width: 50px; height: 50px; }
}
/* Centered site frame to give the desktop layout a clear boundary */
body { background: #eef3ef; }
.app-frame {
  width: min(calc(100% - 36px), 1420px);
  min-height: calc(100vh - 36px);
  margin: 18px auto;
  border: 1px solid #d8e3dc;
  border-radius: 26px;
  background: var(--surface);
  box-shadow: 0 18px 64px rgba(24, 54, 38, .12);
}
.topbar { max-width: 1320px; }
.main-content { max-width: 1140px; }
body[data-theme="dark"] { background: #0b120e; }
body[data-theme="dark"] .app-frame {
  border-color: #2b4034;
  background: #131e18;
  box-shadow: 0 20px 68px rgba(0, 0, 0, .36);
}
@media (max-width: 700px) {
  .app-frame {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
}
/* Refined square frame aligned to the header contents */
.app-frame {
  width: min(calc(100% - 48px), 1320px);
  min-height: calc(100vh - 48px);
  margin: 24px auto;
  border-radius: 0;
}
.topbar {
  max-width: none;
  padding: 12px 10px;
  border-bottom: 1px solid #d8e8dd;
  background: #f1f8f3;
}
.home-heading-card {
  margin: 18px 0 16px;
  padding: 15px 20px;
  border: 1px solid #d6e9dc;
  border-left: 4px solid var(--brand);
  border-radius: 12px;
  background: var(--brand-tint);
  box-shadow: 0 4px 14px rgba(25, 57, 43, .045);
}
.home-heading-card h1 { margin: 0; font-size: clamp(19px, 2.3vw, 25px); }
.site-footer {
  display: flex;
  justify-content: center;
  width: min(calc(100% - 56px), 1140px);
  margin: 18px auto 22px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: var(--brand-tint);
  font-size: 12px;
  font-weight: 700;
}
body[data-theme="dark"] .topbar {
  border-bottom-color: #2d4436;
  background: #18271e;
}
body[data-theme="dark"] .home-heading-card {
  border-color: #304a39;
  border-left-color: #65b982;
  background: #1a2b20;
  box-shadow: 0 5px 16px rgba(0, 0, 0, .18);
}
body[data-theme="dark"] .site-footer {
  border-color: #30443a;
  color: #b2c4b8;
  background: #18271e;
}
@media (max-width: 700px) {
  .app-frame {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }
  .topbar { padding: 10px 14px; }
  .home-heading-card { margin-top: 12px; padding: 12px 14px; }
  .site-footer { width: calc(100% - 28px); margin: 12px auto 18px; }
}
/* Local favorites UI */
.favorites-nav-button { position: relative; }
.favorites-nav-button svg { width: 20px; height: 20px; fill: none; stroke: #a6535c; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.favorites-count-badge { position: absolute; top: -6px; right: -6px; display: grid; place-items: center; min-width: 19px; height: 19px; padding: 0 4px; border: 2px solid var(--surface); border-radius: 999px; color: #fff; background: #c84a58; font-size: 10px; font-weight: 800; line-height: 1; }
.favorites-count-badge[hidden] { display: none !important; }
.favorites-heading { align-items: center; }
.favorites-heading p { margin-top: 5px; color: var(--muted); font-size: 12px; }
.favorite-warehouse-tag { align-self: flex-start; width: fit-content; max-width: 100%; padding: 5px 10px; overflow-wrap: anywhere; border: 1px solid #d8e9dd; border-radius: 999px; color: var(--brand-deep); background: var(--brand-tint); font-size: 11px; font-weight: 800; }
.result-action-favorite { color: #9b6870; }
.result-action-favorite.is-favorite { color: #c84a58; background: #fff2f3; border-color: #f1cbd0; }
.result-action-favorite.is-favorite svg { fill: currentColor; }
body[data-theme="dark"] .favorites-nav-button svg { stroke: #f08a97; }
body[data-theme="dark"] .favorites-count-badge { border-color: #17231d; color: #fff; background: #c94d5e; }
body[data-theme="dark"] .favorite-warehouse-tag { border-color: #355142; color: #c9e6d0; background: #1b3023; }
body[data-theme="dark"] .result-action-favorite { color: #d08b93; }
body[data-theme="dark"] .result-action-favorite.is-favorite { border-color: #633a40; color: #ff9aa5; background: #332024; }
@media (max-width: 700px) {
  .favorites-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .favorites-heading > button { align-self: flex-start; }
}

/* Clear icons and status in saved item cards */
.favorites-share-status { margin: 4px 0 0 !important; color: var(--muted); font-size: 11px !important; font-weight: 600; }
.favorites-share-status:empty { display: none; }
.result-identifier-label { display: inline-flex; align-items: center; gap: 4px; }
.result-field-icon { display: inline-flex; flex: 0 0 15px; width: 15px; height: 15px; color: var(--brand); vertical-align: middle; }
.result-field-icon svg { display: block; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.result-category-label { display: inline-flex; align-items: center; gap: 5px; }
body[data-theme="dark"] .result-field-icon { color: #8fd5a0; }

/* The favorites page is a dedicated view: never show search content beneath it. */
.view-panel[hidden] { display: none !important; }
body.favorites-only-mode #homeView,
body.favorites-only-mode #searchView { display: none !important; }
body.favorites-only-mode #favoritesView { display: block !important; }
/* Local pin list and NEW BIN entry */
#pinsButton { position: relative; }
#pinsButton svg { width: 20px; height: 20px; fill: none; stroke: var(--brand-deep); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pin-list-actions { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; }
.pin-note { margin-top: 9px; padding: 8px 10px; border: 1px solid #cfe3d6; border-radius: 10px; color: var(--brand-deep); background: var(--brand-tint); font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
.result-action-pin { color: #718779; }
.result-action-pin svg, .result-action-remove-pin svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.result-action-pin.is-pinned { color: #168252; border-color: #abd2b8; background: #eff8f2; }
.pin-dialog { width: min(440px, calc(100% - 28px)); padding: 22px; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); background: var(--surface); box-shadow: 0 20px 70px rgba(0,0,0,.25); }
.pin-dialog::backdrop { background: rgba(12,25,18,.48); }
.pin-dialog h2 { margin: 0 0 12px; font-size: 18px; }
.pin-dialog label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 700; }
.pin-dialog input { width: 100%; min-height: 46px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: var(--canvas); }
.pin-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
@media (max-width:700px) { .pin-list-actions { justify-content: flex-start; } .pin-list-actions .secondary-button { min-height: 36px; padding: 0 9px; font-size: 11px; } }

/* Logout is only shown within inner pages; favorites/pins icons remain in their original top-bar position. */
body.home-active #logoutButton { display: none !important; }
