:root {
  --ink: #202124;
  --muted: #6b7280;
  --line: #dde3ea;
  --soft: #f4f7f9;
  --paper: #ffffff;
  --green: #0f8f6b;
  --green-soft: #dff6ed;
  --blue: #2764c7;
  --blue-soft: #e7f0ff;
  --red: #c93d3d;
  --red-soft: #ffe8e8;
  --amber: #b7740f;
  --amber-soft: #fff1cf;
  --teal: #0f766e;
  --shadow: 0 14px 35px rgba(32, 33, 36, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(15, 143, 107, .08), transparent 28%),
    linear-gradient(215deg, rgba(39, 100, 199, .08), transparent 30%),
    #f8fafb;
}

button, input, select, textarea { font: inherit; }
button {
  border: 0;
  border-radius: 7px;
  background: var(--ink);
  color: white;
  padding: 9px 12px;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  white-space: nowrap;
}
button:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(32, 33, 36, .14); }
button.ghost { background: var(--paper); color: var(--ink); border: 1px solid var(--line); }
button.soft { background: var(--green); color: #fff; }
button.good { background: var(--green); }
button.warn { background: var(--amber-soft); color: var(--amber); }
button.bad { background: var(--red-soft); color: var(--red); }
button.icon { width: 36px; height: 36px; padding: 0; display: inline-grid; place-items: center; }
button.active { background: var(--ink); color: white; }

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 11px;
  background: white;
  color: var(--ink);
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: #8bb7ff; box-shadow: 0 0 0 3px rgba(39, 100, 199, .12); }
label { color: var(--muted); font-size: 12px; font-weight: 700; display: grid; gap: 6px; }

.app { min-height: 100vh; display: grid; grid-template-columns: 248px 1fr; }
aside {
  padding: 22px 16px;
  border-right: 1px solid var(--line);
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
}
.brand-mark {
  width: 184px; height: 52px; border-radius: 0;
  display: grid; place-items: center;
  overflow: visible;
  background: transparent;
  border: 0;
}
.brand-mark img {
  width: 100%; height: 100%; object-fit: contain;
}
.brand h1 { font-size: 17px; margin: 0; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.nav { display: grid; gap: 7px; }
.nav button { text-align: left; background: transparent; color: var(--ink); box-shadow: none; display: flex; align-items: center; gap: 10px; }
.nav button:hover, .nav button.active { background: #eef3f6; transform: none; box-shadow: none; }
.nav .ico { width: 21px; color: var(--teal); font-weight: 900; }
.login-box {
  margin-top: 22px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  display: grid;
  gap: 9px;
}
.profile-session {
  display: grid;
  gap: 8px;
}
.profile-session > span {
  color: var(--muted);
  font-size: 12px;
}
.profile-session > b {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.28;
}
.profile-mini { display: grid; gap: 9px; }
.profile-mini.has-qr {
  grid-template-columns: minmax(0, 1fr) 82px;
  align-items: start;
}
.profile-mini strong { font-size: 15px; line-height: 1.3; }
.profile-mini span { color: var(--muted); font-size: 13px; line-height: 1.4; display: grid; gap: 3px; word-break: break-word; }
.profile-mini b { color: var(--ink); font-size: 11px; text-transform: uppercase; letter-spacing: .02em; }
.profile-mini.has-qr strong,
.profile-mini.has-qr span {
  grid-column: 1;
}
.profile-qr {
  grid-column: 2;
  grid-row: 1 / span 4;
  width: 82px;
  height: 82px;
  object-fit: contain;
  background: white;
  border: 3px solid #111;
  padding: 4px;
}
.profile-qr.mobile {
  grid-column: auto;
  grid-row: auto;
  width: 76px;
  height: 76px;
  float: right;
  justify-self: end;
}
.profile-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.profile-actions button {
  padding: 8px 10px;
  min-height: 36px;
}
.workshop-productivity {
  display: grid;
  gap: 9px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.workshop-productivity-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.workshop-productivity-head b {
  font-size: 13px;
}
.workshop-productivity-head span {
  color: var(--muted);
  font-size: 11px;
}
.workshop-productivity-list {
  display: grid;
  gap: 8px;
}
.workshop-productivity-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 5px 8px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.workshop-productivity-row.current {
  border-color: rgba(15,143,107,.32);
  background: #f2fbf7;
}
.workshop-productivity-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  grid-column: 1 / -1;
}
.workshop-productivity-info span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}
.workshop-productivity-info b {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
}
.workshop-productivity-bar {
  align-self: center;
  height: 8px;
  overflow: hidden;
  background: #e7edf2;
  border-radius: 999px;
}
.workshop-productivity-bar i {
  display: block;
  height: 100%;
  min-width: 3px;
  background: linear-gradient(90deg, var(--green), var(--blue));
  border-radius: inherit;
}
.workshop-productivity-row em {
  align-self: center;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  text-align: right;
  font-weight: 700;
}
.sidebar-copy {
  margin-top: auto;
  padding-top: 14px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

main { padding: 24px; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
body.sample-full-page main { padding: 0; }
body.sample-full-page .topbar { display: none; }
.title h2 { margin: 0; font-size: clamp(23px, 3vw, 34px); letter-spacing: 0; }
.title p { margin: 5px 0 0; color: var(--muted); }
.header-search-group {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  max-width: min(620px, 72vw);
}
.header-search {
  width: min(420px, 52vw);
  padding: 8px 10px;
  border-radius: 7px;
  background: white;
}
.header-search-group button {
  padding: 8px 11px;
}
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.notify-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.notify-button.has-unread {
  border-color: #f2b84b;
  background: #fff8e7;
  color: #8a5100;
}
.notify-button b {
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #e53935;
  color: #fff;
  font-size: 12px;
}
.notify-dot {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #f59e0b;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}
.notify-button.has-unread .notify-dot {
  animation: notifyPulse 1.1s ease-in-out infinite;
}
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.metric {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.metric span { color: var(--muted); font-size: 12px; font-weight: 700; }
.metric strong { display: block; font-size: 24px; margin-top: 8px; }
.month-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.month-summary strong {
  font-size: 15px;
}
.month-summary span {
  color: var(--muted);
}
.month-summary b {
  color: var(--ink);
}
.good-text { color: var(--green) !important; }
.bad-text { color: var(--red) !important; }

.toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) repeat(3, minmax(145px, 190px)) auto;
  gap: 9px;
  align-items: end;
  margin-bottom: 12px;
}
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.notify-panel {
  border-color: #f5c542;
  box-shadow: 0 10px 26px rgba(245, 158, 11, .16);
}
.notify-panel .section-head {
  background: #fff8e6;
}
.notify-panel h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #9a5b00;
}
.notify-badge {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #f59e0b;
  color: white;
  font-size: 14px;
  font-weight: 800;
  animation: notifyPulse 1.1s ease-in-out infinite;
}
@keyframes notifyPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, .42); }
  50% { transform: scale(1.08); box-shadow: 0 0 0 7px rgba(245, 158, 11, 0); }
}
.app-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 2000;
  max-width: min(360px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #111827;
  color: white;
  font-weight: 700;
  box-shadow: 0 16px 40px rgba(17,24,39,.24);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.app-toast.show {
  opacity: 1;
  transform: translateY(0);
}
.notification-dialog {
  width: 100%;
  max-width: 100%;
}
.notification-list {
  display: grid;
  gap: 8px;
}
.notification-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.notification-item strong {
  display: block;
  line-height: 1.35;
}
.notification-item p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.notify-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #fff3cf;
  color: #9a5b00;
  font-weight: 900;
}
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: 12px; color: var(--muted); background: #f7f9fb; }
tr:hover td { background: #fbfdfe; }
.order-row {
  box-shadow: inset 3px 0 0 transparent;
}
.order-row.status-new {
  box-shadow: inset 3px 0 0 var(--blue);
}
.order-row.status-transferring {
  box-shadow: inset 3px 0 0 #8b5cf6;
  background: #fbf8ff;
}
.order-row.status-completed {
  box-shadow: inset 3px 0 0 var(--green);
}
.order-row.status-cancelled {
  opacity: .72;
  box-shadow: inset 3px 0 0 var(--red);
}
.cell-strong { font-weight: 600; }
.staff-name-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.staff-avatar {
  position: relative;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 999px;
  background: rgba(15, 143, 107, 0.12);
  border: 1px solid rgba(15, 143, 107, 0.22);
}
.staff-avatar::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 5px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--green);
}
.staff-avatar::after {
  content: "";
  position: absolute;
  left: 6px;
  bottom: 5px;
  width: 12px;
  height: 8px;
  border-radius: 999px 999px 5px 5px;
  background: var(--green);
}
.text-link {
  display: inline;
  width: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 800;
  text-align: left;
  box-shadow: none;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: normal;
}
.text-link:hover {
  transform: none;
  box-shadow: none;
  color: #174ea6;
}
.order-code-link {
  font-variant-numeric: tabular-nums;
}
.money { font-variant-numeric: tabular-nums; font-weight: 600; }
.muted { color: var(--muted); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 5px 9px; font-size: 12px; font-weight: 600;
  background: var(--soft); color: var(--muted);
}
.pill.new { background: var(--blue-soft); color: var(--blue); }
.pill.processing { background: var(--amber-soft); color: var(--amber); }
.pill.completed { background: var(--green-soft); color: var(--green); }
.pill.cancelled { background: var(--red-soft); color: var(--red); }
.pill.transferring { background: #efe7ff; color: #6d28d9; }
.split { display: grid; grid-template-columns: 1.15fr .85fr; gap: 14px; align-items: start; }
.order-focus-list {
  display: grid;
  gap: 8px;
  padding: 10px;
}
.order-focus-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: start;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: #fff;
}
.order-focus-card.status-transferring {
  border-left-color: #8b5cf6;
  background: #fbf8ff;
}
.order-focus-card.status-completed {
  border-left-color: var(--green);
}
.order-focus-card.status-cancelled {
  border-left-color: var(--red);
  opacity: .72;
}
.order-focus-card > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.order-focus-card strong {
  font-size: 15px;
  overflow-wrap: anywhere;
}
.order-focus-card span {
  color: var(--muted);
  font-size: 13px;
}
.order-focus-card > div:nth-child(2) {
  display: grid;
  justify-items: end;
  gap: 7px;
}
.order-focus-card b {
  white-space: nowrap;
  font-size: 15px;
}
.order-focus-card p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 12px; }
.form-grid label { gap: 4px; }
.form-grid .full { grid-column: 1 / -1; }
.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}
.check-line input {
  width: 16px;
  height: 16px;
  padding: 0;
  flex: 0 0 auto;
}
.permission-box {
  display: grid;
  grid-template-columns: 1fr repeat(3, auto);
  gap: 8px 14px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}
.permission-box strong { font-size: 13px; }
.qr-preview img,
.bank-qr-preview img {
  width: 112px;
  height: 112px;
  object-fit: contain;
  border: 3px solid #111;
  padding: 5px;
  background: #fff;
}
.commission-payee-list {
  display: grid;
  gap: 10px;
}
.commission-payee {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.commission-payee-qr {
  width: 104px;
  height: 104px;
  object-fit: contain;
  border: 2px solid #111;
  padding: 4px;
  background: #fff;
}
.commission-payee-qr.empty {
  display: grid;
  place-items: center;
  border-color: var(--line);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.commission-payee-info {
  display: grid;
  gap: 7px;
  min-width: 0;
}
.commission-payee-info strong {
  font-size: 16px;
}
.commission-payee-info span {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: baseline;
}
.commission-payee-info b {
  min-width: 72px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}
.section-head { padding: 12px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.section-head h3 { margin: 0; font-size: 15px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.product {
  background: white; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; box-shadow: var(--shadow);
}
.product img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; background: #e9eef2; }
.product .body { padding: 12px; display: grid; gap: 7px; }
.product h3 { margin: 0; font-size: 15px; }
.product p { margin: 0; color: var(--muted); font-size: 13px; }
.product-meta { margin-bottom: 4px; }
.product .actions {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: nowrap;
}
.product .actions button {
  min-width: 0;
  padding: 8px 11px;
  font-size: 13px;
}
.product .actions .soft { flex: 1; }
.canvas { display: grid; gap: 14px; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.embedded-site {
  height: calc(100dvh - 128px);
  min-height: 560px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: white;
  box-shadow: var(--shadow);
}
body.sample-full-page .embedded-site {
  height: 100dvh;
  min-height: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.embedded-site iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: white;
}
.sample-cover-preview,
.sample-cover-empty {
  width: 72px;
  height: 52px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #f5f7fa;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
}
.link-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 700;
  box-shadow: none;
}
.sample-admin-table input[type="file"] {
  max-width: 220px;
}
.sample-sort-input {
  width: 86px;
}

.gallery-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 4;
  margin: -2px 0 12px;
  padding: 10px;
  background: rgba(246, 248, 250, .9);
  border: 1px solid rgba(211, 219, 225, .82);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .08);
  backdrop-filter: blur(10px);
}
.gallery-path,
.gallery-search,
.gallery-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.gallery-search {
  flex: 1 1 320px;
  justify-content: center;
}
.gallery-search input {
  flex: 1 1 240px;
  max-width: 420px;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff;
}
.gallery-search button {
  min-height: 36px;
  padding: 8px 13px;
}
.gallery-path strong {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
}
.gallery-nav-button {
  width: 36px;
  height: 36px;
  min-width: 36px;
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
  box-shadow: none;
}
.gallery-actions span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  background: #101827;
  color: #fff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}
.gallery-actions button {
  min-height: 36px;
  padding: 8px 13px;
}
.gallery-actions .gallery-share-primary {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
  font-weight: 800;
}
.gallery-actions .gallery-share-primary:not(:disabled):hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}
.gallery-actions button:disabled {
  opacity: .46;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.gallery-selection-dock,
.gallery-dock-spacer {
  display: none;
}
.gallery-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.gallery-summary span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 5px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
}
.gallery-summary b {
  color: var(--ink);
}
.gallery-watermark-note {
  background: #f0fdf6 !important;
  border-color: #bfe9d6 !important;
  color: #087443 !important;
}
.gallery-folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.gallery-folder {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 10px;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 5px 14px rgba(15,23,42,.05);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.gallery-folder-icon {
  position: relative;
  display: inline-grid;
  width: 24px;
  height: 18px;
  border-radius: 4px;
  background: #f4c766;
  box-shadow: inset 0 -8px 0 rgba(169, 106, 25, .14);
}
.gallery-folder-icon::before {
  content: "";
  position: absolute;
  left: 2px;
  top: -5px;
  width: 11px;
  height: 7px;
  border-radius: 4px 4px 0 0;
  background: #e3ad43;
}
.gallery-folder b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  text-align: left;
}
.gallery-folder em {
  padding: 3px 7px;
  border-radius: 999px;
  background: #eef6ff;
  color: var(--blue);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}
.gallery-folder:hover {
  border-color: rgba(15,143,107,.32);
  background: #f7fbfa;
  box-shadow: 0 9px 22px rgba(15,23,42,.09);
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}
.gallery-card {
  position: relative;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .07);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.gallery-card.selected {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(15, 143, 107, .2), 0 14px 34px rgba(15, 23, 42, .13);
}
.gallery-card:hover {
  transform: translateY(-2px);
  border-color: rgba(15, 143, 107, .28);
  box-shadow: 0 16px 34px rgba(15, 23, 42, .12);
}
.gallery-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #e9eef2;
  transition: transform .28s ease, filter .28s ease;
}
.gallery-card:hover img {
  transform: scale(1.035);
  filter: saturate(1.04) contrast(1.02);
}
.gallery-check {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.8);
  background: rgba(255,255,255,.92);
  color: var(--green);
  box-shadow: 0 8px 20px rgba(15, 23, 42, .2);
  font-weight: 900;
  transform: none;
}
.gallery-card.selected .gallery-check {
  background: var(--green);
  color: #fff;
}
.gallery-card-foot {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  padding: 11px 12px;
  background: #fff;
}
.gallery-card-foot b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.gallery-preview-dialog {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  background: #070b13;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(0,0,0,.46);
}
dialog.gallery-lightbox {
  width: min(1120px, calc(100vw - 18px));
  height: min(900px, calc(100dvh - 18px));
  max-width: none;
  max-height: none;
  padding: 0;
  overflow: hidden;
  background: transparent;
  border: 0;
  border-radius: 8px;
  box-shadow: none;
}
dialog.gallery-lightbox::backdrop {
  background: rgba(2, 6, 12, .78);
  backdrop-filter: blur(8px);
}
.gallery-preview-dialog img {
  display: block;
  width: 100%;
  height: calc(100% - 54px);
  max-height: none;
  object-fit: contain;
  background:
    radial-gradient(circle at center, rgba(255,255,255,.08), transparent 56%),
    #070b13;
}
.gallery-preview-title {
  min-height: 54px;
  padding: 12px 54px 12px 16px;
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: rgba(7, 11, 19, .92);
  border-top: 1px solid rgba(255,255,255,.1);
}
.gallery-preview-dialog .guest-product-close {
  top: auto;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  min-height: 34px;
  padding: 7px 11px;
  background: rgba(255,255,255,.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,.24);
  backdrop-filter: blur(8px);
}
.gallery-preview-dialog .guest-product-close:hover {
  background: rgba(255,255,255,.2);
}

@media (max-width: 720px) {
  .gallery-toolbar {
    align-items: stretch;
    flex-direction: column;
    position: static;
    margin: 0 0 10px;
    padding: 8px;
    gap: 8px;
  }
  .gallery-actions,
  .gallery-search,
  .gallery-path {
    width: 100%;
    flex: 0 0 auto;
  }
  .gallery-path {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    gap: 6px;
  }
  .gallery-path:has(.gallery-up-button) .gallery-up-button {
    grid-column: 1;
    grid-row: 1;
  }
  .gallery-path:has(.gallery-up-button) .gallery-home-button {
    grid-column: 3;
    grid-row: 1;
  }
  .gallery-path strong {
    grid-column: 2;
    grid-row: 1;
    min-height: 34px;
    min-width: 0;
    justify-content: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 10px;
  }
  .gallery-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 6px;
    justify-content: stretch;
  }
  .gallery-search input {
    grid-column: 1;
    max-width: none;
    min-height: 38px;
    padding: 7px 12px;
  }
  .gallery-search button {
    min-height: 38px;
    padding: 7px 11px;
  }
  .gallery-actions {
    display: none;
  }
  .gallery-dock-spacer {
    display: block;
    height: 82px;
  }
  .gallery-selection-dock {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 70;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 7px;
    padding: 9px;
    border: 1px solid rgba(15, 23, 42, .14);
    border-radius: 16px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 18px 46px rgba(15, 23, 42, .22);
    backdrop-filter: blur(14px);
  }
  .gallery-selection-dock strong {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    border-radius: 999px;
    background: #101827;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
  }
  .gallery-selection-dock button {
    min-width: 0;
    min-height: 40px;
    padding: 8px 6px;
    font-size: 13px;
  }
  .gallery-selection-dock .gallery-share-primary {
    background: var(--green);
    color: #fff;
    border-color: var(--green);
    font-weight: 800;
  }
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  .gallery-folder-grid {
    grid-template-columns: repeat(auto-fit, minmax(156px, 1fr));
    gap: 7px;
  }
  .gallery-folder {
    min-height: 42px;
    padding: 7px 8px;
    grid-template-columns: 24px minmax(0, 1fr) auto;
  }
  .gallery-folder b {
    font-size: 12px;
  }
  .gallery-folder em {
    padding: 2px 6px;
    font-size: 10px;
  }
  .gallery-card-foot {
    padding: 9px;
  }
  .gallery-card-foot b {
    font-size: 12px;
  }
  .gallery-check {
    top: 7px;
    left: 7px;
    width: 30px;
    height: 30px;
    min-width: 30px;
  }
  .gallery-summary {
    gap: 6px;
    margin-bottom: 10px;
  }
  .gallery-summary span {
    flex: 1 1 auto;
    justify-content: center;
    min-height: 28px;
    padding: 4px 8px;
  }
  .gallery-summary .gallery-watermark-note {
    flex: 1 1 100%;
  }
}
.check-line.compact {
  margin: 0;
  min-height: 38px;
  align-items: center;
}
.invoice-image-dialog .modal-body {
  background: #eef3f6;
}
.invoice-image-preview {
  display: grid;
  justify-items: center;
}
.invoice-image-preview img {
  width: min(100%, 760px);
  height: auto;
  display: block;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

dialog {
  border: 0;
  border-radius: 8px;
  box-shadow: 0 28px 70px rgba(32,33,36,.22);
  width: min(880px, calc(100vw - 28px));
  padding: 0;
}
dialog::backdrop { background: rgba(24, 30, 36, .38); backdrop-filter: blur(4px); }
.modal-body { padding: 12px; max-height: min(72vh, 760px); overflow: auto; }
.order-items { display: grid; gap: 6px; }
.item-row { display: grid; grid-template-columns: 1fr 90px 150px 38px; gap: 6px; align-items: end; }
.order-detail-dialog {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
.order-detail-dialog .modal-body {
  overflow-x: hidden;
}
.order-detail-top h3 {
  margin-bottom: 3px;
}
.order-detail-code {
  color: var(--blue);
  font-weight: 800;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.order-detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .95fr) minmax(0, .95fr);
  gap: 8px;
  margin-bottom: 10px;
}
.order-detail-card,
.order-detail-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 11px 12px;
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
}
.order-detail-card.primary {
  background: linear-gradient(135deg, #f7fbff, #ffffff);
  border-color: #cfe0ff;
}
.order-detail-card > span,
.order-detail-note span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.order-detail-card > strong {
  font-size: 17px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.order-detail-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.detail-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  min-height: 24px;
  border-top: 1px solid #edf1f5;
  padding-top: 6px;
}
.detail-line:first-of-type {
  border-top: 0;
  padding-top: 0;
}
.detail-line b {
  color: var(--muted);
  font-size: 12px;
}
.detail-line strong {
  text-align: right;
  font-size: 14px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.money-card .due {
  color: var(--blue);
}
.money-card .due strong {
  font-size: 16px;
}
.order-detail-products {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: clip;
  max-width: 100%;
  min-width: 0;
  margin-bottom: 10px;
  background: white;
}
.order-detail-products .section-head {
  background: #f7f9fb;
  padding: 10px 12px;
}
.order-detail-products table {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.order-detail-products thead,
.order-detail-products tbody {
  display: block;
  width: 100%;
  min-width: 0;
}
.order-detail-products tr {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 46px 42px 90px 100px;
  width: 100%;
  min-width: 0;
  border-bottom: 1px solid var(--line);
}
.order-detail-products tr:last-child {
  border-bottom: 0;
}
.order-detail-products th,
.order-detail-products td {
  display: block;
  min-width: 0;
  padding: 8px 8px;
  vertical-align: middle;
  border-bottom: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}
.order-detail-products .money {
  white-space: nowrap;
  overflow-wrap: normal;
  text-align: right;
  font-size: 12px;
}
.order-detail-products tbody tr:hover td {
  background: #fcfdff;
}
.order-detail-note {
  background: #fffaf0;
  border-color: #f5d48a;
  padding: 10px 12px;
}
.order-detail-note strong {
  line-height: 1.45;
}
.money-stepper {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 5px;
  align-items: stretch;
}
.money-stepper input {
  min-width: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.money-step-buttons {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 4px;
}
.money-step-buttons button {
  width: 36px;
  min-height: 22px;
  padding: 0;
  border-radius: 6px;
  background: var(--soft);
  color: var(--ink);
  border: 1px solid var(--line);
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
  box-shadow: none;
}
.money-step-buttons .money-plus {
  background: #e7f6ee;
  color: #087443;
  border-color: #bfe8d0;
}
.money-step-buttons .money-minus {
  background: #fff1f1;
  color: #b42318;
  border-color: #ffd0d0;
}
.money-step-buttons button:hover {
  transform: none;
  background: var(--green-soft);
  color: var(--green);
  box-shadow: none;
}
.catalog-add {
  margin-bottom: 10px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  align-items: start;
}
.catalog-add button { width: auto; height: auto; padding: 0; font-size: 22px; line-height: 1; }
.catalog-add .money-step-buttons button {
  width: 36px;
  min-height: 22px;
  padding: 0;
  font-size: 17px;
}

.catalog-results {
  border: 1px solid var(--line);
  background: white;
  border-radius: 8px;
  padding: 8px;
  max-height: 220px;
  overflow: auto;
}
.catalog-results { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; grid-column: 1 / 3; }
.catalog-suggestion { display: block; padding: 6px 8px; color: var(--ink); text-decoration: none; border-radius: 6px; }
.catalog-suggestion:hover { background: #f3f7fb; color: var(--blue); text-decoration: underline; }
.catalog-suggestion::before { font-weight: 800; margin-right: 6px; }
.catalog-suggestion-inner { display: flex; align-items: center; gap: 10px; }
.catalog-thumb { width: 32px; height: 32px; object-fit: cover; border-radius: 8px; background: #f4f7f9; flex-shrink: 0; }
.catalog-thumb.large { width: 42px; height: 42px; }
.catalog-text { line-height: 1.3; }
.catalog-row.open {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(280px, 360px) auto;
  align-items: end;
  gap: 12px;
  padding: 10px;
  border: 1px solid #cfe0ff;
  border-radius: 8px;
  background: #f8fbff;
}
.catalog-meta { display: flex; align-items: center; gap: 10px; min-width: 0; }
.catalog-prompt { display: grid; grid-template-columns: minmax(84px, 110px) minmax(150px, 1fr); align-items: end; gap: 8px; }
.catalog-field { margin: 0; }
.catalog-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.catalog-actions button { font-size: 13px; padding: 9px 13px; min-width: 94px; white-space: nowrap; }
.catalog-prompt input { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; }
.custom-spec {
  margin: 0 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  padding: 12px;
  display: grid;
  gap: 10px;
}
.custom-spec h4 { margin: 0; font-size: 14px; }
.spec-line { display: grid; grid-template-columns: 1fr 96px 96px 140px 38px; gap: 8px; align-items: center; }
.spec-line.two { display: grid; grid-template-columns: 1fr 100px 140px 140px 104px; gap: 8px; align-items: center; }
.spec-result { font-weight: 800; white-space: nowrap; align-self: stretch; display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.spec-result input { color: var(--red); font-weight: 800; text-align: right; height: 100%; }
.spec-result .money-stepper { height: 100%; }
.spec-add { align-self: end; justify-self: stretch; display: inline-flex; align-items: center; justify-content: center; min-width: 92px; min-height: 36px; padding: 0 12px; border-radius: 7px; background: var(--green); color: white; box-shadow: none; white-space: nowrap; font-size: 13px; }
.spec-add.icon { width: 38px; height: auto; }
.totals { display: grid; gap: 6px; justify-items: end; padding-top: 8px; }
.totals strong { font-size: 20px; }

@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  body:not(.mobile-login-mode):not(.logged-out) .app aside { display: none !important; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; }
  main {
    padding: clamp(12px, 3vw, 20px);
    padding-top: 0;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }
  .topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    margin: 0 calc(-1 * clamp(12px, 3vw, 20px)) 16px;
    padding: 10px clamp(12px, 3vw, 20px);
    padding-top: max(10px, env(safe-area-inset-top));
    background: rgba(248, 250, 251, .92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
  }
  .title { flex: 1; min-width: 0; }
  .title h2 { font-size: clamp(17px, 4vw, 22px); }
  .title p { display: none; }
  .title p.has-header-search { display: block; }
  .header-search-group {
    width: calc(100vw - 88px);
    max-width: none;
  }
  .header-search { flex: 1; width: auto; min-width: 0; }
  .header-search-group button { padding: 8px 10px; }
  .actions {
    flex-shrink: 0;
    flex-wrap: nowrap;
    max-width: 48%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .actions::-webkit-scrollbar { display: none; }
}
@media (max-width: 640px) {
  button, .menu-toggle, .menu-close, .mobile-close {
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
  }
  input, select, textarea { font-size: 16px; }

  .topbar { flex-wrap: wrap; row-gap: 8px; }
  .title { flex: 1 1 calc(100% - 52px); }
  .actions {
    order: 4;
    flex: 1 1 100%;
    max-width: none;
    overflow-x: visible;
    flex-wrap: wrap;
    gap: 8px;
  }
  .actions > button {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    justify-content: center;
  }
  .notify-button {
    flex: 1 1 100%;
  }
  .month-summary {
    gap: 8px 12px;
    align-items: flex-start;
  }
  .month-summary strong {
    flex: 1 1 100%;
  }
  .order-focus-list {
    padding: 8px;
  }
  .order-focus-card {
    grid-template-columns: minmax(0, 1fr);
  }
  .order-focus-card > div:nth-child(2) {
    grid-template-columns: auto 1fr;
    justify-items: start;
    align-items: center;
  }
  .notification-item {
    grid-template-columns: 30px minmax(0, 1fr);
  }
  .notification-item .row-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  }

  .metric-grid, .toolbar, .form-grid { grid-template-columns: 1fr; }
  .permission-box { grid-template-columns: 1fr; }
  .metric { padding: 12px; }
  .metric strong {
    font-size: clamp(18px, 5.5vw, 22px);
    line-height: 1.2;
    word-break: break-word;
  }
  .cards { grid-template-columns: 1fr; }
  .product .actions { gap: 7px; }
  .product .actions button { width: auto; }
  .product .actions .ghost { flex: 0 0 auto; }

  .section-head {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
  }
  .section-head h3 { flex: 1 1 100%; }
  .section-head button { flex: 1 1 auto; }

  .toolbar button { width: 100%; }

  /* Card layout for tables — no horizontal scroll on phone */
  .panel:has(table) {
    overflow: visible;
    background: transparent;
    border: 0;
    box-shadow: none;
  }
  .panel:has(table) > .section-head {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 10px;
    box-shadow: var(--shadow);
  }
  .panel > table,
  .panel table {
    min-width: 0;
    width: 100%;
  }
  .panel > table thead,
  .panel table thead { display: none; }
  .panel > table tbody,
  .panel table tbody {
    display: grid;
    gap: 10px;
  }
  .panel > table tr,
  .panel table tr {
    display: grid;
    gap: 8px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px;
    box-shadow: var(--shadow);
  }
  .panel > table tr:hover td { background: transparent; }
  .panel > table td,
  .panel table td {
    display: grid;
    grid-template-columns: minmax(84px, 36%) 1fr;
    gap: 8px;
    align-items: start;
    padding: 0;
    border: 0;
    white-space: normal;
    font-size: 14px;
  }
  .panel > table td::before,
  .panel table td::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .02em;
    line-height: 1.35;
  }
  .panel > table td .muted,
  .panel table td .muted {
    grid-column: 2;
  }
  .panel > table td:not([data-label])::before,
  .panel table td:not([data-label])::before,
  .panel > table td[data-label=""]::before,
  .panel table td[data-label=""]::before { display: none; }
  .panel > table td.cell-actions,
  .panel table td.cell-actions {
    grid-template-columns: 1fr;
    padding-top: 8px;
    margin-top: 4px;
    border-top: 1px solid var(--line);
  }
  .row-actions {
    justify-content: stretch;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
    gap: 6px;
  }
  .row-actions button { width: 100%; }

  dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }
  dialog form {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    max-height: 100dvh;
  }
  .modal-body {
    flex: 1;
    max-height: none;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  dialog form > .section-head:first-child {
    flex: 0 0 auto;
    position: sticky;
    top: 0;
    z-index: 6;
    align-items: center;
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(12px);
  }
  dialog form > .section-head:first-child h3 {
    flex: 1 1 auto;
  }
  dialog form > .section-head:first-child button {
    flex: 0 0 auto;
    width: auto;
    min-height: 38px;
  }
  dialog form > .section-head:not(:first-child):last-child {
    flex: 0 0 auto;
    position: sticky;
    bottom: 0;
    z-index: 7;
    gap: 8px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    border-bottom: 0;
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(12px);
    box-shadow: 0 -10px 28px rgba(15, 23, 42, .08);
  }
  dialog form > .section-head:not(:first-child):last-child > span:empty {
    display: none;
  }
  dialog form > .section-head:not(:first-child):last-child .actions,
  dialog form > .section-head:not(:first-child):last-child .row-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
  }
  dialog form > .section-head:not(:first-child):last-child button {
    min-height: 44px;
    width: 100%;
  }

  .catalog-results { grid-template-columns: 1fr; }
  .catalog-row.open {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 10px;
  }
  .catalog-prompt {
    grid-template-columns: 96px 1fr;
  }
  .catalog-actions {
    display: grid;
    grid-template-columns: 1fr 92px;
  }
  .item-row { grid-template-columns: 1fr 68px 132px 36px; }
  .order-detail-hero { grid-template-columns: 1fr; }
  .detail-line { align-items: flex-start; }
  .order-detail-products {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    overflow: hidden;
  }
  .order-detail-products .section-head {
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    margin-bottom: 0;
    background: #f7f9fb;
  }
  .order-detail-products table,
  .order-detail-products tbody {
    display: block;
    width: 100%;
  }
  .order-detail-products thead {
    display: none;
  }
  .order-detail-products tr {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 4px 9px;
    padding: 9px 10px;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: white;
    box-shadow: none;
  }
  .order-detail-products tr:last-child {
    border-bottom: 0;
  }
  .order-detail-products td {
    display: block;
    padding: 0;
    border: 0;
    width: auto !important;
    min-width: 0;
    font-size: 13px;
    line-height: 1.35;
  }
  .order-detail-products td::before {
    display: none;
  }
  .order-detail-products td:nth-child(1) {
    grid-column: 1;
    grid-row: 1 / span 3;
    color: var(--muted);
    font-weight: 800;
    padding-top: 2px;
  }
  .order-detail-products td:nth-child(2) {
    grid-column: 2 / 4;
    grid-row: 1;
    gap: 2px;
    font-size: 15px;
    font-weight: 800;
    overflow-wrap: anywhere;
  }
  .order-detail-products td:nth-child(2) .muted {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
  }
  .order-detail-products td:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
    color: var(--muted);
  }
  .order-detail-products td:nth-child(3)::before {
    display: inline;
    content: "ĐVT: ";
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
  }
  .order-detail-products td:nth-child(4) {
    grid-column: 2;
    grid-row: 3;
    color: var(--muted);
  }
  .order-detail-products td:nth-child(4)::before {
    display: inline;
    content: "SL: ";
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
  }
  .order-detail-products td:nth-child(5) {
    grid-column: 3;
    grid-row: 2;
    text-align: right;
    color: var(--muted);
    font-size: 12px;
  }
  .order-detail-products td:nth-child(6) {
    grid-column: 3;
    grid-row: 3;
    text-align: right;
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
  }
  .spec-line, .spec-line.two { grid-template-columns: 1fr; }
  .spec-result, .spec-add { grid-column: 1 / -1; }
  .spec-add { width: 100%; min-height: 40px; }

  body.logged-out .auth-banner-full img {
    object-fit: contain;
    object-position: center top;
    background: #f7fafc;
  }
  body.mobile-login-mode .app aside .login-box {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 16px;
  }
  .mobile-nav button { min-height: 48px; }
  .embedded-site {
    height: calc(100dvh - 148px);
    min-height: 420px;
    border-radius: 0;
    margin: 0 -12px -12px;
  }
}

@media print {
  body { background: white; }
  .no-print { display: none !important; }
}

/* --- Banner + logged-out behavior --- */
.auth-banner-full {
  display: none;
  place-items: center;
  position: relative;
  width: 100%;
  height: calc(100vh - 48px);
  border-radius: 8px;
  overflow: hidden;
  background: #111827;
  margin-bottom: 12px;
}
.auth-banner-full img { width: 100%; height: 100%; object-fit: cover; display: block; }
.auth-banner-full::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 18% 20%, rgba(255,255,255,.14), transparent 30%),
    linear-gradient(90deg, rgba(0,0,0,.52), rgba(0,0,0,.14) 50%, rgba(0,0,0,.24)),
    linear-gradient(180deg, rgba(0,0,0,.02), rgba(0,0,0,.24));
  pointer-events: none;
}
.cnc-motion {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}
.cnc-spindle {
  position: absolute;
  left: 75.2%;
  top: 42.8%;
  width: clamp(22px, 2.7vw, 46px);
  height: clamp(22px, 2.7vw, 46px);
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.42);
  border-top-color: rgba(246, 199, 120, .95);
  border-right-color: rgba(246, 199, 120, .18);
  box-shadow:
    0 0 18px rgba(246, 199, 120, .34),
    inset 0 0 12px rgba(255,255,255,.20);
  filter: blur(.2px);
  transform: translate(-50%, -50%);
  animation: cncSpin .32s linear infinite, spindlePulse 1.15s ease-in-out infinite;
}
.cnc-spindle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3px;
  height: clamp(38px, 4vw, 72px);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.56), rgba(246, 199, 120, .14), transparent);
  transform: translate(-50%, -5%);
  filter: blur(1.4px);
  opacity: .78;
}
.cnc-cut-glow {
  position: absolute;
  left: 75.1%;
  top: 50.2%;
  width: clamp(70px, 8vw, 150px);
  height: clamp(28px, 3vw, 54px);
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(255, 224, 153, .58), rgba(196, 112, 43, .20) 38%, transparent 72%);
  filter: blur(8px);
  transform: translate(-50%, -50%) rotate(-8deg);
  opacity: .62;
  animation: cutGlow 1.05s ease-in-out infinite;
}
.dust {
  position: absolute;
  left: 75.1%;
  top: 50%;
  width: var(--s, 5px);
  height: var(--s, 5px);
  border-radius: 50%;
  background: rgba(232, 171, 91, .82);
  box-shadow:
    0 0 12px rgba(245, 190, 112, .42),
    0 0 22px rgba(160, 96, 34, .18);
  opacity: 0;
  transform: translate(-50%, -50%);
  animation: dustFly var(--dur, 2.4s) linear infinite;
  animation-delay: var(--delay, 0s);
}
.dust.d1 { --x: -140px; --y: -54px; --s: 7px; --dur: 2.2s; --delay: -.1s; }
.dust.d2 { --x: -92px; --y: 58px; --s: 10px; --dur: 2.8s; --delay: -.8s; }
.dust.d3 { --x: 72px; --y: -48px; --s: 6px; --dur: 2.1s; --delay: -1.1s; }
.dust.d4 { --x: 142px; --y: 42px; --s: 8px; --dur: 2.6s; --delay: -.4s; }
.dust.d5 { --x: -184px; --y: 22px; --s: 6px; --dur: 3s; --delay: -1.7s; }
.dust.d6 { --x: 174px; --y: -78px; --s: 7px; --dur: 2.5s; --delay: -1.4s; }
.dust.d7 { --x: -64px; --y: -104px; --s: 7px; --dur: 2.35s; --delay: -.6s; }
.dust.d8 { --x: 48px; --y: 92px; --s: 10px; --dur: 2.9s; --delay: -2s; }
.dust.d9 { --x: -152px; --y: 94px; --s: 8px; --dur: 2.7s; --delay: -1.25s; }
.dust.d10 { --x: 214px; --y: 70px; --s: 6px; --dur: 3.1s; --delay: -.2s; }
.dust.d11 { --x: -24px; --y: -72px; --s: 6px; --dur: 1.9s; --delay: -1.5s; }
.dust.d12 { --x: 108px; --y: 118px; --s: 7px; --dur: 2.45s; --delay: -.95s; }
@keyframes cncSpin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}
@keyframes spindlePulse {
  0%, 100% { opacity: .62; }
  50% { opacity: .95; }
}
@keyframes cutGlow {
  0%, 100% { opacity: .36; transform: translate(-50%, -50%) rotate(-8deg) scale(.92); }
  50% { opacity: .78; transform: translate(-50%, -50%) rotate(-8deg) scale(1.08); }
}
@keyframes dustFly {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.45); }
  12% { opacity: .92; }
  70% { opacity: .46; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1.75); }
}
@media (prefers-reduced-motion: reduce) {
  .cnc-spindle,
  .cnc-cut-glow,
  .dust {
    animation: none;
  }
  .dust { display: none; }
}
.meet-hero-copy {
  position: absolute;
  left: clamp(22px, 7vw, 92px);
  top: clamp(42px, 12vh, 140px);
  z-index: 3;
  width: min(560px, calc(100vw - 44px));
  color: white;
  display: grid;
  gap: 14px;
  isolation: isolate;
  text-shadow: 0 2px 18px rgba(0,0,0,.42);
}
.meet-hero-copy::before {
  content: "";
  position: absolute;
  inset: -22px -28px -20px -28px;
  z-index: -1;
  border-radius: 28px;
  background:
    radial-gradient(circle at 18% 18%, rgba(255,255,255,.16), transparent 34%),
    linear-gradient(135deg, rgba(0,0,0,.42), rgba(0,0,0,.12) 68%, transparent);
  filter: blur(10px);
  opacity: .82;
  pointer-events: none;
}
.meet-hero-copy span {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .16em;
}
.meet-hero-copy h1 {
  margin: 0;
  font-size: clamp(34px, 6.5vw, 68px);
  line-height: 1.02;
  letter-spacing: 0;
  color: transparent;
  background:
    linear-gradient(180deg, rgba(255,255,255,.42), rgba(255,255,255,.02) 46%, rgba(255,255,255,.30)),
    linear-gradient(90deg, rgba(255,255,255,.18), rgba(255,255,255,.04));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 2px rgba(255,255,255,.92);
  filter:
    drop-shadow(0 0 10px rgba(255,255,255,.28))
    drop-shadow(0 14px 34px rgba(0,0,0,.58));
}
.meet-hero-copy p {
  margin: 0;
  width: min(460px, 100%);
  font-size: clamp(16px, 2vw, 22px);
  line-height: 1.45;
  color: rgba(255,255,255,.88);
}
.meet-hero-copy .meet-copyright {
  font-size: 13px;
  font-style: italic;
  color: rgba(255,255,255,.72);
}
.meet-hero-meta {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  align-items: center;
}
.meet-hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,.05)),
    rgba(255,255,255,.035);
  color: rgba(255,255,255,.92);
  backdrop-filter: blur(12px) saturate(1.14);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.20),
    0 12px 26px rgba(0,0,0,.16);
  font-size: 14px;
  font-weight: 800;
  text-shadow: 0 1px 12px rgba(0,0,0,.38);
}
.meet-hero-meta svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
  filter: drop-shadow(0 0 8px rgba(255,255,255,.22));
}
.meet-contact {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.meet-contact a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.34), rgba(255,255,255,.13)),
    rgba(255,255,255,.08);
  color: white;
  border: 1px solid rgba(255,255,255,.44);
  text-decoration: none;
  font-weight: 800;
  backdrop-filter: blur(12px) saturate(1.18);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.34),
    0 14px 30px rgba(0,0,0,.20);
  text-shadow: 0 1px 12px rgba(0,0,0,.42);
  max-width: 112px;
  overflow: hidden;
  white-space: nowrap;
  transition: max-width .28s ease, padding .28s ease, gap .28s ease, transform .18s ease, box-shadow .18s ease;
}
.meet-contact a::after {
  content: " " attr(data-extra);
  display: inline-block;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateX(-6px);
  transition: max-width .28s ease, opacity .18s ease, transform .28s ease;
}
.meet-contact a:hover,
.meet-contact a:focus-visible {
  max-width: 240px;
  gap: 5px;
  padding-inline: 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.42), rgba(255,255,255,.18)),
    rgba(255,255,255,.12);
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.44),
    0 18px 38px rgba(0,0,0,.26);
}
.meet-contact a:hover::after,
.meet-contact a:focus-visible::after {
  max-width: 140px;
  opacity: 1;
  transform: translateX(0);
}
.meet-contact a:first-child {
  background:
    linear-gradient(180deg, rgba(29, 185, 132, .44), rgba(15, 143, 107, .20)),
    rgba(15, 143, 107, .12);
  color: white;
  border-color: rgba(122, 255, 210, .46);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.30),
    0 16px 34px rgba(15, 143, 107, .30);
}
.meet-contact a:first-child:hover,
.meet-contact a:first-child:focus-visible {
  background:
    linear-gradient(180deg, rgba(35, 205, 148, .54), rgba(15, 143, 107, .27)),
    rgba(15, 143, 107, .17);
}
.meet-zalo-link {
  position: relative;
}
.meet-zalo-link.has-qr {
  overflow: visible;
}
.meet-zalo-link.has-qr::after {
  content: none;
}
.meet-zalo-qr {
  position: absolute;
  left: 50%;
  top: calc(100% + 12px);
  width: 118px;
  height: 118px;
  padding: 8px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.30), rgba(255,255,255,.10)),
    rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.36);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.32),
    0 22px 46px rgba(0,0,0,.34);
  backdrop-filter: blur(16px) saturate(1.2);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -8px) scale(.92);
  transition: opacity .2s ease, transform .24s ease;
}
.meet-zalo-qr img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(255,255,255,.86);
  padding: 4px;
}
.meet-zalo-link.has-qr:hover,
.meet-zalo-link.has-qr:focus-visible {
  max-width: 112px;
}
.meet-zalo-link.has-qr:hover .meet-zalo-qr,
.meet-zalo-link.has-qr:focus-visible .meet-zalo-qr {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}
.auth-actions {
  position: absolute;
  left: 50%;
  bottom: clamp(28px, 7vh, 72px);
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  width: min(720px, calc(100vw - 32px));
}
.auth-login-button,
.auth-guest-button {
  min-width: min(320px, calc(100vw - 48px));
  min-height: 52px;
  padding: 14px 26px;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 800;
  border: 1px solid rgba(255,255,255,.42);
  color: white;
  backdrop-filter: blur(14px) saturate(1.18);
  text-shadow: 0 1px 14px rgba(0,0,0,.42);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.32),
    0 18px 42px rgba(0,0,0,.24);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease, letter-spacing .18s ease;
}
.auth-login-button {
  background:
    linear-gradient(180deg, rgba(29, 185, 132, .44), rgba(15, 143, 107, .20)),
    rgba(15, 143, 107, .12);
  border-color: rgba(122, 255, 210, .46);
}
.auth-guest-button {
  background:
    linear-gradient(180deg, rgba(255,255,255,.34), rgba(255,255,255,.13)),
    rgba(255,255,255,.08);
}
.auth-login-button:hover,
.auth-guest-button:hover {
  transform: translateY(-3px) scale(1.025);
  letter-spacing: .01em;
  border-color: rgba(255,255,255,.68);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.44),
    0 24px 54px rgba(0,0,0,.32);
}
.auth-login-button:hover {
  background:
    linear-gradient(180deg, rgba(35, 205, 148, .54), rgba(15, 143, 107, .27)),
    rgba(15, 143, 107, .17);
}
.auth-guest-button:hover {
  background:
    linear-gradient(180deg, rgba(255,255,255,.42), rgba(255,255,255,.18)),
    rgba(255,255,255,.12);
}

body.logged-out .auth-banner-full { display: grid; }
body.logged-out .app aside { display: none !important; }
body.logged-out .topbar, body.logged-out #content, body.logged-out .panel { display: none !important; }
/* Ensure the grid collapses to a single column when logged-out so banner fills width */
body.logged-out .app { grid-template-columns: 1fr !important; }
body.logged-out main {
  padding: 0 !important;
  min-height: 100dvh;
  display: block;
}
body.logged-out .auth-banner-full {
  width: 100%;
  height: 100dvh;
  border-radius: 0;
  margin: 0;
  display: grid;
}
body.logged-out .auth-banner-full img { width: 100%; height: 100%; object-fit: cover; }

.guest-products { display: none; }
body.logged-out .guest-products {
  display: block;
  min-height: 100dvh;
  padding: clamp(22px, 4vw, 56px);
  background:
    linear-gradient(180deg, #f7fafc, #edf3f6),
    #f5f8fa;
}
.guest-products-inner {
  width: min(1320px, 100%);
  margin: 0 auto;
}
.guest-products-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.guest-products-head span {
  display: block;
  color: var(--green);
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: 12px;
  margin-bottom: 6px;
}
.guest-products-head h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 54px);
  letter-spacing: 0;
}
.guest-filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.guest-filter-row button {
  min-height: 38px;
  padding: 8px 13px;
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}
.guest-filter-row button.active {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}
.guest-product-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: clamp(128px, 13vw, 184px);
  grid-auto-flow: dense;
  gap: clamp(7px, 1vw, 12px);
}
.guest-product-card {
  position: relative;
  grid-column: span 3;
  min-height: 0;
  height: 100%;
  border-radius: 4px;
  overflow: hidden;
  background: #dfe7ec;
  box-shadow: 0 18px 44px rgba(32, 33, 36, .12);
  cursor: pointer;
}
.guest-product-card.wide {
  grid-column: span 6;
  grid-row: span 2;
  min-height: 0;
}
.guest-product-card:nth-child(7n + 3) { grid-row: span 2; }
.guest-product-card:nth-child(7n + 5) { grid-column: span 4; }
.guest-product-card:nth-child(7n + 6) { grid-column: span 2; }
.guest-product-card img {
  width: 100%;
  height: 100%;
  min-height: inherit;
  display: block;
  object-fit: cover;
  transition: transform .28s ease;
  -webkit-user-drag: none;
  user-select: none;
}
.guest-product-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, .62));
  pointer-events: none;
}
.guest-product-card h3 {
  display: none;
}
.guest-product-card:hover img { transform: scale(1.04); }
.guest-product-dialog {
  position: relative;
  width: min(980px, calc(100vw - 28px));
  max-width: 100%;
  background: #0f172a;
}
.guest-product-dialog img {
  width: 100%;
  max-height: min(76vh, 760px);
  object-fit: contain;
  display: block;
  background: #0f172a;
}
.guest-product-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  background: rgba(255,255,255,.94);
  color: var(--ink);
}
.guest-product-title {
  padding: 16px 18px 18px;
  color: white;
}
.guest-product-title span {
  color: rgba(255,255,255,.62);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.guest-product-title h3 {
  margin: 4px 0 0;
  font-size: clamp(22px, 3vw, 36px);
}
dialog.guest-lightbox {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}
dialog.guest-lightbox::backdrop {
  background: rgba(0, 0, 0, .82);
  backdrop-filter: blur(8px);
}
dialog.guest-lightbox .guest-product-dialog {
  width: 100vw;
  height: 100dvh;
  padding: clamp(14px, 2.4vw, 28px);
  display: grid;
  place-items: center;
  background: transparent;
}
dialog.guest-lightbox .guest-product-dialog img {
  width: auto;
  max-width: min(96vw, 1440px);
  height: auto;
  max-height: 92dvh;
  object-fit: contain;
  background: transparent;
  box-shadow: 0 22px 80px rgba(0,0,0,.42);
}
dialog.guest-lightbox .guest-product-close {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  width: 42px;
  height: 42px;
  min-width: 42px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.26);
  background: rgba(0,0,0,.36);
  color: white;
  font-size: 30px;
  line-height: 1;
  display: grid;
  place-items: center;
  box-shadow: none;
  backdrop-filter: blur(10px);
}
dialog.guest-lightbox .guest-product-title {
  display: none;
}

@media (max-width: 900px) {
  .auth-actions {
    bottom: max(22px, env(safe-area-inset-bottom));
  }
  .auth-login-button,
  .auth-guest-button {
    min-width: min(240px, calc(50vw - 22px));
    padding-inline: 18px;
  }
  .guest-product-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .guest-product-card { grid-column: span 3; }
  .guest-product-card.wide { grid-column: span 6; }
}

@media (max-width: 560px) {
  .auth-banner-full::after {
    background:
      radial-gradient(circle at 28% 12%, rgba(255,255,255,.16), transparent 30%),
      linear-gradient(180deg, rgba(0,0,0,.34), rgba(0,0,0,.10) 42%, rgba(0,0,0,.42)),
      linear-gradient(90deg, rgba(0,0,0,.26), rgba(0,0,0,.06));
  }
  .cnc-spindle {
    left: 59%;
    top: 26.5%;
  }
  .cnc-cut-glow,
  .dust {
    left: 59%;
    top: 32%;
  }
  .meet-hero-copy {
    top: max(28px, env(safe-area-inset-top));
    left: 16px;
    right: 16px;
    width: auto;
    gap: 10px;
  }
  .meet-hero-copy::before {
    inset: -16px -14px -14px -14px;
    border-radius: 22px;
    filter: blur(8px);
  }
  .meet-hero-copy h1 {
    font-size: clamp(32px, 9.2vw, 46px);
  }
  .meet-hero-copy p {
    font-size: 15px;
    max-width: 320px;
  }
  .meet-contact a {
    min-height: 38px;
    padding: 0 14px;
    font-size: 13px;
  }
  .auth-actions {
    width: calc(100vw - 28px);
    gap: 8px;
    bottom: max(18px, env(safe-area-inset-bottom));
  }
  .auth-login-button,
  .auth-guest-button {
    flex: 1 1 0;
    min-width: 0;
    font-size: 14px;
    min-height: 48px;
    padding: 12px 10px;
  }
  .guest-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 42vw;
    grid-auto-flow: dense;
    gap: 8px;
  }
  .guest-product-card,
  .guest-product-card.wide {
    grid-column: span 1;
    grid-row: span 1;
    min-height: 0;
    height: 100%;
    border-radius: 0;
    box-shadow: none;
  }
  .guest-product-card:nth-child(5n + 1),
  .guest-product-card:nth-child(5n + 1).wide {
    grid-column: span 2;
    grid-row: span 2;
  }
  .guest-product-card:nth-child(5n + 3) {
    grid-row: span 2;
  }
  .guest-product-card:nth-child(5n + 4) {
    background: #0f766e;
  }
  .guest-product-card::after {
    background:
      linear-gradient(180deg, rgba(0,0,0,.04) 28%, rgba(0,0,0,.72)),
      linear-gradient(90deg, rgba(15,23,42,.36), transparent 62%);
  }
  .guest-product-card h3 {
    left: 10px;
    right: 10px;
    bottom: 10px;
    font-size: clamp(15px, 4.8vw, 22px);
    line-height: 1.05;
    text-shadow: 0 3px 14px rgba(0,0,0,.62);
  }
  .guest-product-card:nth-child(5n + 1) h3 {
    left: 14px;
    right: 14px;
    bottom: 14px;
    font-size: clamp(24px, 8vw, 34px);
  }
  .guest-filter-row {
    justify-content: flex-start;
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding: 2px 0 8px;
    margin: 0 -22px;
    padding-left: 22px;
    padding-right: 22px;
    scrollbar-width: none;
  }
  .guest-filter-row::-webkit-scrollbar {
    display: none;
  }
  .guest-filter-row button {
    flex: 0 0 auto;
    min-height: 40px;
    border-radius: 999px;
    background: rgba(255,255,255,.86);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
  }
  .guest-products-head {
    margin-bottom: 14px;
  }
  body.logged-out .guest-products {
    padding: 28px 8px 36px;
    background:
      linear-gradient(180deg, #f9fbfc 0%, #e9f0f3 100%);
  }
  .guest-products-head h2 {
    font-size: clamp(32px, 10vw, 44px);
  }
  .guest-products-head > div:first-child {
    padding: 0 8px;
  }
}

/* Mobile menu drawer */
.menu-toggle, .menu-close { display: none; }
.mobile-menu-drawer { display: none; }
.mobile-nav { display: none; }
.mobile-profile { display: none; }
.mobile-close { display: none; }

@media (max-width: 980px) {
  .menu-toggle {
    display: grid;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 0;
    font-size: 24px;
    cursor: pointer;
    place-items: center;
    color: var(--ink);
    padding: 0;
  }
  .menu-toggle:hover { background: rgba(32,33,36,.08); border-radius: 8px; }

  body.sample-full-page .topbar {
    display: flex;
    position: fixed;
    top: max(8px, env(safe-area-inset-top));
    left: 8px;
    z-index: 38;
    margin: 0;
    padding: 0;
    background: transparent;
  }
  body.sample-full-page .topbar .title,
  body.sample-full-page .topbar .actions { display: none; }
  body.sample-full-page .menu-toggle {
    background: rgba(255,255,255,.94);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 8px 22px rgba(32,33,36,.18);
  }

  body.mobile-menu-open { overflow: hidden; }
  body.mobile-menu-open::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 39;
  }

  .mobile-menu-drawer {
    display: flex !important;
    position: fixed;
    left: 0;
    top: 0;
    width: min(82vw, 292px);
    height: 100%;
    height: 100dvh;
    background: white;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform .3s ease;
    z-index: 40;
    padding-bottom: env(safe-area-inset-bottom);
  }
  body.mobile-menu-open .mobile-menu-drawer { transform: translateX(0); }

  .menu-header {
    padding: 12px;
    padding-top: max(12px, env(safe-area-inset-top));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
  }
  .menu-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
  }
  .menu-brand .brand-mark {
    flex: 0 0 138px;
    width: 138px;
    height: 52px;
    margin: 0;
    border-radius: 7px;
    box-shadow: none;
  }
  .menu-brand .brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
  .menu-brand strong {
    display: block;
    font-size: 14px;
    line-height: 1.2;
  }
  .menu-brand span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.3;
  }

  .menu-close {
    display: grid;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 0;
    font-size: 20px;
    cursor: pointer;
    place-items: center;
    color: var(--ink);
    padding: 0;
  }
  .menu-close:hover { background: rgba(32,33,36,.08); border-radius: 6px; }

  .mobile-nav {
    display: grid !important;
    gap: 3px;
    overflow-y: auto;
    flex: 0 0 auto;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    padding: 8px;
    border-bottom: 1px solid var(--line);
  }
  .mobile-nav button {
    text-align: left;
    background: transparent;
    color: var(--ink);
    box-shadow: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border: 0;
    cursor: pointer;
    font-size: 14px;
    border-radius: 7px;
    font-weight: 500;
    min-height: 40px;
  }
  .mobile-nav button:hover { background: rgba(0,0,0,.04); }
  .mobile-nav button.active { background: rgba(15,143,107,.1); color: var(--teal); font-weight: 600; }
  .mobile-nav .ico { width: 20px; font-weight: 900; }

  .mobile-profile {
    display: grid !important;
    padding: 10px 12px 12px;
    border-top: 0;
    background: white;
    gap: 8px;
    flex: 1 1 auto;
    align-content: start;
    overflow-y: auto;
  }
  .mobile-profile-name {
    font-weight: 600;
    font-size: 13px;
    padding: 2px 0 0;
    line-height: 1.3;
  }
  .mobile-profile-name b {
    display: block;
    color: var(--ink);
    font-size: 14px;
    margin-top: 2px;
  }
  .mobile-profile-info {
    display: grid;
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--soft);
  }
  .mobile-profile-info span {
    display: grid;
    gap: 2px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.35;
    word-break: break-word;
  }
  .mobile-profile-info b {
    color: var(--ink);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .03em;
  }
  .mobile-profile-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .mobile-profile-actions button {
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 6px;
  }
  .workshop-productivity.mobile {
    padding-top: 8px;
    gap: 7px;
  }
  .workshop-productivity.mobile .workshop-productivity-list {
    max-height: 210px;
    overflow: auto;
    padding-right: 2px;
  }
  .workshop-productivity.mobile .workshop-productivity-row {
    padding: 6px;
  }
  .mobile-copy {
    margin-top: auto;
    padding-top: 12px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
  }

  body.mobile-login-mode { overflow: hidden; }
  body.mobile-login-mode .app aside {
    display: grid !important;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    padding: 18px;
    padding-top: max(18px, env(safe-area-inset-top));
    background: white;
    z-index: 50;
    overflow-y: auto;
    border-radius: 0;
  }
  body.mobile-login-mode .app aside .brand,
  body.mobile-login-mode .app aside .nav { display: none; }
  body.mobile-login-mode .app aside .login-box {
    margin-top: 0;
    border-radius: 0;
    box-shadow: none;
    align-self: center;
    width: min(420px, 100%);
  }
  body.mobile-login-mode .app aside .sidebar-copy { margin-top: 16px; }
  body.mobile-login-mode .mobile-close {
    display: grid;
    position: fixed;
    top: max(14px, env(safe-area-inset-top));
    right: 14px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(32,33,36,.08);
    align-items: center;
    justify-content: center;
    font-size: 24px;
    border: 0;
    cursor: pointer;
    z-index: 60;
  }
  body.mobile-login-mode .mobile-close:hover { background: rgba(32,33,36,.14); }
  body.mobile-login-mode main { display: none !important; }
}
