@font-face {
  font-family: "DrukCyr";
  src: url("https://static.tildacdn.com/tild6632-3433-4836-b265-386630656261/drukcyr-bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
}

:root {
  --bg: #f1f0f1;
  --panel: #faf5f3;
  --panel-strong: #ffffff;
  --ink: #070809;
  --muted: #5e6366;
  --accent: #ff8562;
  --accent-dark: #101113;
  --line: rgba(7, 8, 9, 0.11);
  --danger: #b13232;
  --danger-strong: #d1172d;
  --shadow: 0 10px 30px rgba(7, 8, 9, 0.05);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, #f1f0f1 0%, #f7f3f1 46%, #efeded 100%);
}

.app-shell {
  width: min(760px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 14px 0 28px;
}

.hero,
.status,
.card,
.editor-form {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 22px;
}

.hero {
  padding: 18px 20px 20px;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -48px -48px auto;
  width: 168px;
  height: 168px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 133, 98, 0.22) 0%, rgba(255, 133, 98, 0) 68%);
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(24px, 5.4vw, 38px);
  line-height: 1;
  font-family: "DrukCyr", "Manrope", sans-serif;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.subtitle {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.35;
  font-size: 14px;
}

.status {
  display: none;
  margin-top: 12px;
  padding: 12px 14px;
}

.status.visible {
  display: block;
}

.cards {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.card {
  padding: 12px;
  background: var(--panel-strong);
  border-color: rgba(7, 8, 9, 0.08);
}

.card-main {
  min-width: 0;
}

.card-top {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: start;
}

.product-name {
  font-size: 18px;
  line-height: 1.05;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-date {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.macros {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.macro {
  min-width: 0;
  padding: 7px 8px;
  border-radius: 12px;
  background: #f5efec;
  border: 1px solid rgba(7, 8, 9, 0.05);
}

.macro-label {
  display: block;
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.macro-value {
  display: block;
  margin-top: 2px;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-dark);
}

.actions {
  display: flex;
  gap: 8px;
}

button {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.primary-button,
.ghost-button {
  padding: 12px 16px;
  border-radius: 14px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.primary-button {
  color: #f1f0f1;
  background: var(--accent-dark);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.ghost-button {
  color: var(--ink);
  background: rgba(7, 8, 9, 0.05);
}

.actions-inline {
  margin-top: 10px;
}

.action-button {
  min-width: 0;
  flex: 1 1 0;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 12px;
  transition:
    transform 0.15s ease,
    opacity 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
  border: 1px solid rgba(7, 8, 9, 0.08);
  box-shadow: none;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.edit-button {
  background: #fff3ef;
  color: var(--accent);
}

.delete-button {
  background: #fff1f2;
  color: var(--danger-strong);
}

.action-button:hover,
.action-button:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.edit-button:focus-visible,
.edit-button:hover {
  background: #ffe8df;
  box-shadow: 0 8px 16px rgba(255, 133, 98, 0.16);
}

.delete-button:focus-visible,
.delete-button:hover {
  background: #ffe7eb;
  box-shadow: 0 8px 16px rgba(209, 23, 45, 0.14);
}

.action-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button:active {
  transform: translateY(1px);
}

.modal {
  width: min(420px, calc(100vw - 20px));
  border: 0;
  padding: 0;
  background: transparent;
}

.modal::backdrop {
  background: rgba(31, 28, 24, 0.34);
}

.editor-form {
  display: grid;
  gap: 14px;
  padding: 20px;
  background: var(--panel-strong);
}

.editor-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

label {
  display: grid;
  gap: 8px;
  font-size: 14px;
}

input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font: inherit;
  background: rgba(255, 255, 255, 0.92);
}

@media (max-width: 640px) {
  .app-shell {
    width: calc(100vw - 18px);
    padding-top: 10px;
  }

  .macros {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  .action-button {
    height: 42px;
    padding: 0 10px;
    font-size: 12px;
  }

  .macro {
    padding: 6px 6px;
  }

  .macro-label {
    font-size: 8px;
    letter-spacing: 0.04em;
  }

  .macro-value {
    font-size: 14px;
  }
}
