/* Branch cards share one calm surface; status remains in labels and issue text. */
.stores-workspace {
  --stores-border: #dce5e8;
  --stores-muted: #596d76;
  --stores-soft: #f5f8f9;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.stores-workspace .page-header { padding-bottom: 4px; }
.stores-workspace .toolbar { margin: 0; border: 1px solid var(--stores-border); }
.stores-workspace .stores__summary { margin: 0; color: var(--stores-muted); }
.stores-workspace__grid {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  align-items: stretch;
  gap: 16px;
}

.stores-workspace .store-card {
  min-width: 0;
  min-height: 0;
  padding: 16px;
  gap: 12px;
  border: 1px solid var(--stores-border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 3px 14px rgb(29 56 66 / 4%);
}
.stores-workspace .store-card::before { display: none; }
.stores-workspace .store-card:hover {
  transform: none;
  border-color: #b8cbd2;
  box-shadow: 0 6px 22px rgb(29 56 66 / 7%);
}
.stores-workspace .store-card__head { gap: 12px; }
.stores-workspace .store-card__identity { flex: 1; }
.stores-workspace .store-card__name {
  margin: 0 0 10px;
  font-size: 16px;
  line-height: 22px;
  font-weight: 650;
  letter-spacing: -.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.store-card__status-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 26px; }
.store-card__status-row .store-card__meta { flex: 1; }
.store-card__preview-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 20px; }
.stores-workspace .store-card__meta { gap: 8px; font-size: 12px; color: var(--stores-muted); }
.stores-workspace .store-card__code { padding: 2px 6px; border-radius: 5px; background: #f0f5f7; font-size: 11px; }
.store-card__topology { display: flex; align-items: center; gap: 7px; color: var(--stores-muted); }
.store-card__topology[hidden] { display: none; }
.store-card__topology .icon { flex: none; color: #758b94; }
.store-card__preview-hint { margin: 0; flex: none; font-size: 10px; line-height: 16px; color: #74858c; }
.store-card__preview-hint[hidden] { display: none; }
.store-diagnosis { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.stores-workspace .store-card__status-row > .status-badge { max-width: 64%; height: 26px; line-height: 16px; white-space: nowrap; min-width: 0; }
.stores-workspace .store-card__status-row > .status-badge span { overflow: hidden; text-overflow: ellipsis; }
.stores-workspace .store-card__status-row > .status-badge .icon { flex: none; }

.stores-workspace .status-badge {
  flex: none;
  height: 26px;
  padding: 0 8px;
  gap: 5px;
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 600;
}
.stores-workspace .status-badge .icon { width: 13px; height: 13px; }
.stores-workspace .status-badge--online { color: #246848; background: #f0f8f3; border-color: #d5e9dd; }
.stores-workspace .status-badge--offline { color: #a13d39; background: #fff5f4; border-color: #f1d9d6; }
.stores-workspace .status-badge--partial { color: #876321; background: #fff9ed; border-color: #eadfc4; }
.stores-workspace .status-badge--unpaired,
.stores-workspace .status-badge--neutral { color: #60727a; background: #f4f7f8; border-color: #dce5e8; }

.stores-workspace .store-card__zones { flex: 1; gap: 10px; }
.stores-workspace .store-card[data-zones]:not([data-zones="0"]):not([data-zones="1"]) { grid-column: 1 / -1; }
.stores-workspace .store-card__zones[data-mode="zones"] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 16px; }
.stores-workspace .store-card__zones[data-mode="single-zone"] > .zone-block__body { order: -1; }
.stores-workspace .zone-block { padding: 12px; gap: 10px; border: 1px solid var(--stores-border); border-radius: 12px; }
.stores-workspace .zone-block > .zone-block__body { order: 1; }
.stores-workspace .zone-block > :is(.zone-block__note, .zone-block__blocked, .zone-block__showroom, .zone-block__command) { order: 2; }
.stores-workspace .zone-block__icon { background: #eef4f6; color: #537782; border-radius: 8px; }
.stores-workspace .zone-block__head { gap: 8px; flex-wrap: wrap; }
.stores-workspace .zone-block__name { flex-basis: 80px; }
.stores-workspace .zone-block__note,
.stores-workspace .zone-block__blocked {
  padding: 9px 10px;
  border: 1px solid #efdedb;
  border-radius: 10px;
  background: #fff8f6;
  color: #934640;
  font-size: 12px;
  line-height: 18px;
}
.stores-workspace .zone-block__blocked { border-color: #ecdfc8; background: #fffbf2; color: #846027; }
.stores-workspace .zone-block__note[data-tone="connected"] { background: #f7faf8; border-color: #e0ece4; color: #4e715c; }
.stores-workspace .zone-block__showroom { color: var(--stores-muted); }
.stores-workspace .zone-block__command,
.stores-workspace .store-card__command { margin-top: auto; font-size: 11px; line-height: 18px; padding: 6px 8px; border: 1px solid var(--stores-border); border-radius: 7px; background: #f6f8f9; }
.stores-workspace :is(.zone-block__command, .store-card__command)[data-tone="problem"] { color: #96544b; border-color: #efdedb; background: #fff9f7; }
.stores-workspace :is(.zone-block__command, .store-card__command)[data-tone="done"] { color: #4e715c; border-color: #e0ece4; background: #f7faf8; }

.stores-workspace .zone-single {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--stores-border);
  border-radius: 10px;
  background: #fff;
  color: var(--md-sys-color-on-surface);
  box-shadow: none;
}
.stores-workspace .zone-single:hover { border-color: #a9c4cd; }
.stores-workspace .zone-single[data-fault="playback"] { border-color: #e7c2bd; box-shadow: none; }
.stores-workspace .store-card__preview {
  width: 100%;
  height: 108px;
  min-height: 108px;
  max-height: none;
  aspect-ratio: auto;
  border-radius: 0;
}
.stores-workspace .store-card__preview--empty { flex-direction: column; gap: 10px; background: #f0f4f6; color: #71858e; }
.stores-workspace .store-card__preview--empty > .icon { width: 30px; height: 30px; stroke-width: 1.4; }
.stores-workspace .store-card__preview-badge { right: 12px; bottom: 12px; width: 30px; height: 30px; background: rgb(20 43 52 / 75%); }
.stores-workspace .store-card__preview .screen-poster { width: 192px; max-width: 100%; left: 50%; transform: translateX(-50%); }
.stores-workspace .zone-single__text { min-height: 42px; justify-content: center; padding: 9px 10px; gap: 4px; border-top: 1px solid var(--stores-border); }
.stores-workspace .zone-single__text:empty { display: none; }
.stores-workspace .zone-single__eyebrow { display: none; }
.stores-workspace .zone-single__name { font-size: 11px; font-weight: 400; color: var(--stores-muted); }
.stores-workspace .zone-single__sub { font-size: 12px; line-height: 18px; }
.stores-workspace .zone-single[data-state="offline"] .zone-single__sub { color: var(--stores-muted); }
.stores-workspace .zone-single__name--fault,
.stores-workspace .zone-single__sub.is-alert { color: #a13d39; }

.stores-workspace .wall-group { gap: 10px; }
.stores-workspace .wall-strip {
  align-items: center;
  justify-content: center;
  min-height: 108px;
  padding: 10px;
  gap: 4px;
  border: 1px solid #d9e4e7;
  border-radius: 10px;
  background: #f6f8f9;
}
.stores-workspace .wall-screen {
  min-height: 48px;
  padding: 6px;
  aspect-ratio: 16 / 9;
  border: 1px solid #cfdbdf;
  border-radius: 5px;
  background: #fff;
  color: #556b75;
  box-shadow: none;
}
.stores-workspace .wall-screen[data-state="offline"] { background: #f7f4f4; border-color: #e5cdca; color: #914b45; }
.stores-workspace .wall-screen[data-state="empty"] { border-style: dashed; background: transparent; }
.stores-workspace .wall-screen[data-fault="playback"] { background: #fff7f5; border-color: #dbaaa3; color: #a13d39; }
.stores-workspace .wall-screen[data-poster="on"] { box-shadow: none; }
.stores-workspace .wall-group__now { font-size: 12px; line-height: 18px; }

.stores-workspace .hw-wall { padding: 0; gap: 8px; background: transparent; }
.stores-workspace .hw-wall > .zone-block__alert { display: none; }
.stores-workspace .hw-wall__flow { display: flex; flex-direction: column; align-items: stretch; gap: 0; border: 1px solid var(--stores-border); border-radius: 10px; overflow: hidden; }
.stores-workspace .hw-wall__screens {
  order: -1;
  align-items: center;
  justify-content: center;
  flex: none;
  height: 108px;
  min-height: 0;
  padding: 10px;
  border: 0;
  border-radius: 0;
  background: #f6f8f9;
}
.stores-workspace .hw-wall__pane { position: relative; overflow: hidden; aspect-ratio: 16 / 9; max-width: 153px; background: #e8edef; border: 2px solid #34464f; border-radius: 4px; }
.hw-wall__pane-number { position: absolute; right: 3px; bottom: 3px; min-width: 15px; padding: 0 3px; border-radius: 3px; font: 10px/15px system-ui, sans-serif; text-align: center; color: #fff; background: #34464fcc; }
.stores-workspace .hw-wall__pane[data-state="offline"],
.stores-workspace .hw-wall__pane[data-fault="playback"] { background: #e8edef; border-color: #87959c; }
.stores-workspace .hw-wall__link { display: none; }
.stores-workspace .hw-wall__box {
  flex: auto;
  min-height: 42px;
  padding: 9px 10px;
  gap: 10px;
  flex-direction: row;
  align-items: center;
  border: 0;
  border-top: 1px solid var(--stores-border);
  border-radius: 0;
  background: #fff;
  color: #556b75;
  box-shadow: none;
}
.stores-workspace .hw-wall__box[data-state="offline"],
.stores-workspace .hw-wall__box[data-fault="playback"] { border-color: var(--stores-border); color: #687c85; }
.stores-workspace .hw-wall__box-head { flex: none; gap: 5px; }
.stores-workspace .hw-wall__box-head .wall-screen__dot { display: none; }
.stores-workspace .hw-wall__box-now { min-width: 0; font-family: inherit; font-size: 11px; color: var(--stores-muted); }

.stores-workspace .mirror-zone { flex-direction: column; padding: 0; gap: 12px; background: transparent; }
.stores-workspace .mirror-zone__figure {
  align-items: flex-start;
  justify-content: flex-end;
  height: 108px;
  min-height: 108px;
  max-height: none;
  aspect-ratio: auto;
  padding: 14px;
  border: 1px solid var(--stores-border);
  border-radius: 14px;
  background: #f0f4f6;
}
.stores-workspace .mirror-zone__count { font-size: 28px; }
.stores-workspace .mirror-zone__unit { font-size: 11px; }
.stores-workspace .mirror-zone__bar { height: 4px; }
.stores-workspace .mirror-zone__chip { height: 28px; border-color: #d5e0e4; background: #f8fafb; }
.stores-workspace .mirror-zone__chip[data-state="offline"],
.stores-workspace .mirror-zone__chip[data-fault="playback"] { border-color: #e5cdca; color: #a13d39; box-shadow: none; }

.store-card__setup {
  display: flex;
  flex: 1;
  min-height: 150px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px 14px;
  border: 1px dashed #cad9df;
  border-radius: 14px;
  background: #f8fafb;
  color: var(--stores-muted);
}
.store-card__setup-icon { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid #dce7eb; border-radius: 13px; background: #fff; color: #78919c; }
.stores-workspace .store-card__actions { margin-top: auto; padding-top: 12px; gap: 10px; border-top: 1px solid #e7edef; }
.stores-workspace .store-card__actions .md-button { min-height: 40px; padding-inline: 15px; border-radius: 10px; box-shadow: none; }
.stores-workspace .store-card__actions .md-icon-button { width: 40px; height: 40px; border: 1px solid #e0e8eb; border-radius: 10px; background: #f8fafb; }

@media (max-width: 720px) {
  .stores-workspace { gap: 14px; }
  .stores-workspace__grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .stores-workspace .store-card { padding: 14px; min-height: 0; gap: 12px; }
  .stores-workspace .store-card__actions .spacer { display: block; }
  .stores-workspace .store-card__actions .md-button { flex: 0 1 auto; }
  .stores-workspace .store-card__name { font-size: 16px; }
  .stores-workspace .store-card__zones[data-mode="zones"] { grid-template-columns: minmax(0, 1fr); }
}

@media (pointer: coarse) {
  .stores-workspace .store-card__actions .md-button,
  .stores-workspace .store-card__actions .md-icon-button { min-height: 48px; height: 48px; }
  .stores-workspace .store-card__actions .md-icon-button { width: 48px; }
}
