/* Personal account pages (apps/cabinet). Logical properties only: the site also runs RTL (ar). */

.cabinet {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.page-shell .cabinet-title {
  margin: 0;
  font-size: clamp(var(--fs-2xl), 3.4vw, var(--fs-3xl));
  overflow-wrap: anywhere;
}

.cabinet-inline-form {
  display: inline-flex;
  margin: 0;
}

.cabinet-btn-small {
  padding: 6px 12px;
  font-size: var(--fs-sm);
}

/* Lists: own recipes and purchases. */
.cabinet-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.cabinet-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.cabinet-row__main {
  display: grid;
  gap: 2px;
  flex: 1 1 220px;
  min-width: 0;
}

.cabinet-row__title {
  font-weight: var(--fw-bold);
  overflow-wrap: anywhere;
}

.cabinet-row__title a {
  color: inherit;
}

.cabinet-row__meta,
.cabinet-row__note {
  font-size: var(--fs-sm);
}

.cabinet-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  background: var(--surface-2);
  color: var(--muted);
  white-space: nowrap;
}

.cabinet-status--published,
.cabinet-status--paid {
  background: var(--ok-soft);
  color: var(--ok);
}

.cabinet-status--submitted,
.cabinet-status--partially_refunded {
  background: var(--wait-soft);
  color: var(--wait);
}

.cabinet-status--rejected,
.cabinet-status--refunded {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.cabinet-row__reason {
  flex: 1 1 100%;
  margin: 0;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: var(--fs-sm);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.page-shell .cabinet-note {
  font-size: var(--fs-sm);
}

/* Data page and account deletion. */
.cabinet-block {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
}

.page-shell .cabinet-block h2 {
  margin: 0;
  font-size: var(--fs-lg);
}

.cabinet-block--danger {
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}

.cabinet-bullets {
  margin: 0;
  padding-inline-start: 20px;
  display: grid;
  gap: 4px;
  color: var(--muted);
  line-height: 1.5;
}

.cabinet-form {
  display: grid;
  gap: 10px;
  max-width: 34rem;
}

.cabinet-field {
  display: grid;
  gap: 6px;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--ink);
  overflow-wrap: anywhere;
}

.cabinet-email {
  justify-self: start;
  font-weight: var(--fw-semibold);
  color: var(--muted);
  overflow-wrap: anywhere;
}

.cabinet-field input {
  width: 100%;
  min-height: var(--target);
  border: 1.5px solid var(--field);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  padding: 10px 12px;
}

/* Checkbox row: the label is the 48 px target, the box is 24 px. */
.cabinet-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  min-height: var(--target);
  padding-block: 12px;
  font-size: var(--fs-sm);
  line-height: 1.45;
  cursor: pointer;
}

.cabinet-check input {
  width: 24px;
  height: 24px;
  margin: -2px 0 0;
  flex: 0 0 auto;
  accent-color: var(--accent);
}

.cabinet-btn-danger {
  color: var(--accent-ink);
  border-color: var(--accent-deep);
  background: var(--accent-deep);
}

@media (hover: hover) {
  .cabinet-btn-danger:hover {
    border-color: var(--accent);
    background: var(--accent);
  }
}

/* ---------- Profile (/account/): replaces the old cabinet home and the «Ещё» menu ---------- */
.profile-me {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.profile-me__avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
}

.page-shell .profile-me__text {
  display: grid;
  gap: 2px;
  min-width: 0;
  margin: 0;
}

.profile-me__name {
  color: var(--ink);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  overflow-wrap: anywhere;
}

.profile-me__email {
  justify-self: start;
  color: var(--muted);
  font-size: var(--fs-sm);
  overflow-wrap: anywhere;
}

.profile-signin {
  display: grid;
  gap: var(--space-3);
  justify-items: start;
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--accent-soft);
}

.page-shell .profile-signin__text {
  margin: 0;
  color: var(--ink);
  line-height: 1.5;
}

.profile-section {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
}

.page-shell .profile-section__title {
  margin: var(--space-2) 0 0;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Rows (mockup .group / .g-row): one card, rows split by lines, each row a 52 px target. */
.profile-group,
.profile-card {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}

.profile-group > li + li,
.profile-card > * + * {
  border-block-start: 1px solid var(--line);
}

.profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  min-height: 52px;
  padding: var(--space-2) var(--space-4);
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: var(--fs-md);
  text-align: start;
  cursor: pointer;
}

.profile-row:focus-visible {
  outline-offset: -3px;
}

.profile-row__label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.profile-row__value {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex: none;
  color: var(--muted);
  font-size: var(--fs-sm);
}

.profile-row .icon {
  width: 20px;
  height: 20px;
  color: var(--muted);
}

.profile-row--danger {
  color: var(--accent-deep);
  font-weight: var(--fw-semibold);
}

.profile-row-form {
  margin: 0;
}

@media (hover: hover) {
  .profile-row:hover {
    background: var(--surface-2);
  }
}

.profile-setting {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: var(--space-3) var(--space-4) var(--space-4);
}

.profile-setting__label {
  font-weight: var(--fw-semibold);
}

.profile-setting .seg {
  display: flex;
}

/* Six languages: two columns on phones, three from 480 px, every name on one line. */
.profile-setting .seg--langs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.seg--langs button {
  white-space: nowrap;
}

@media (min-width: 480px) {
  .profile-setting .seg--langs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
