:root {
  color-scheme: only light;
  --ink: #10241f;
  --muted: #5e584f;
  --line: #e4ddd2;
  --paper: #f5f3ef;
  --card: #fffcf8;
  --green: #0f6e56;
  --danger: #8d2f2f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 0% -10%, rgba(15, 110, 86, 0.12), transparent 60%),
    var(--paper);
  color: var(--ink);
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
}

button, input { font: inherit; }

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.top, .summary, .toolbar, .actions, .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.mark {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1, h2 { margin: 0; letter-spacing: -0.03em; }
h1 { font-size: 34px; }
h2 { font-size: 22px; }

.lang { display: flex; gap: 6px; }
.lang button, .ghost, .primary, .icon {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.lang button { width: 44px; }
.lang button[aria-pressed="true"] { background: var(--ink); color: #fff; }

.card, .item {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  box-shadow: 0 16px 40px rgba(16, 36, 31, 0.05);
}

.muted { color: var(--muted); }
.error { min-height: 1.2em; color: var(--danger); }
.status { min-height: 1.2em; color: var(--green); }

form { display: grid; gap: 10px; }
label { font-size: 14px; font-weight: 650; }
input[type="email"], input[type="password"], input[type="text"], input:not([type]), textarea {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid #d9d1c6;
  border-radius: 14px;
  background: #fff;
}
textarea {
  min-height: 84px;
  padding: 12px 14px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 14px;
  resize: vertical;
}
input:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}
select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
}
.primary {
  border: 0;
  background: var(--green);
  color: #fff;
  padding: 0 18px;
  font-weight: 700;
}
button:disabled { opacity: 0.4; cursor: default; }
.ghost, .icon { padding: 0 14px; text-decoration: none; }
.icon { min-width: 40px; padding: 0; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.toolbar { margin-top: 28px; }
.list { display: grid; gap: 10px; }
.item { margin-top: 0; align-items: center; }
.item h3 { margin: 0 0 4px; font-size: 18px; }
.name-link {
  margin: 0 0 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--green);
  font-size: 18px;
  font-weight: 750;
  text-align: left;
  cursor: pointer;
}
.badge {
  display: inline-flex;
  margin-right: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e7f3ee;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}
.badge.off { background: #eeeae4; color: var(--muted); }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.danger { color: var(--danger); }

.store-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.store-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 252, 248, 0.96)),
    var(--card);
  box-shadow: 0 14px 32px rgba(16, 36, 31, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  touch-action: none;
  cursor: grab;
  user-select: none;
}

body.is-store-dragging { touch-action: none; }

.store-card.is-dragging {
  position: fixed;
  z-index: 50;
  margin: 0;
  opacity: 0.96;
  cursor: grabbing;
  pointer-events: none;
  box-shadow: 0 24px 54px rgba(16, 36, 31, 0.24);
}

.store-card__placeholder {
  border: 1.5px dashed rgba(15, 110, 86, 0.45);
  border-radius: 22px;
  background: rgba(15, 110, 86, 0.07);
}

.store-card__head {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 36px;
  gap: 10px;
  align-items: center;
}

.store-mark {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 15px;
  color: #fff;
  font-size: 20px;
  font-weight: 720;
  letter-spacing: -0.04em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 8px 16px rgba(16, 36, 31, 0.12);
}

.store-mark.has-logo { background: #fff; }

.store-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.store-card .name-link {
  margin: 0;
  font-size: 16px;
  line-height: 1.15;
}

.store-card .row-actions,
.store-card .name-link { touch-action: manipulation; cursor: pointer; }

.store-card__handle {
  width: 36px;
  height: 36px;
  display: grid;
  grid-template-columns: repeat(2, 4px);
  gap: 3px;
  place-content: center;
  border-radius: 12px;
}

.store-card__handle span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #8a8378;
}

.store-card__handle:active { cursor: grabbing; }

.store-card .muted { margin: 0; font-size: 13px; line-height: 1.35; }
.store-card .row-actions { gap: 6px; }
.store-card .row-actions button,
.store-card .row-actions select {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

@media (max-width: 1080px) {
  .store-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  h1 { font-size: 28px; }
  .top, .summary, .toolbar, .item { align-items: flex-start; flex-direction: column; }
  .grid { grid-template-columns: 1fr; }
}

[hidden] { display: none !important; }
