:root {
  --app-accent: #886c4f;
  --app-accent-dark: #7a5f42;
  --app-surface: #fffaf4;
  --app-surface-strong: #ffffff;
  --app-text: #2f241d;
  --app-muted: #6f5c4d;
  --app-success: #2e7a57;
  --app-danger: #b84f42;
  --app-warning: #b87827;
}

.app-toast-stack {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 100000;
  display: grid;
  gap: 10px;
  width: min(380px, calc(100vw - 28px));
  pointer-events: none;
}

.app-toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: 6px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 14px 14px 14px 0;
  border: 1px solid rgba(91, 70, 54, 0.14);
  border-radius: 12px;
  background: var(--app-surface-strong);
  color: var(--app-text);
  box-shadow: 0 18px 36px rgba(45, 28, 17, 0.16);
  overflow: hidden;
  transform: translateX(18px);
  opacity: 0;
  animation: appToastIn 0.22s ease forwards;
}

.app-toast::before {
  content: "";
  width: 6px;
  height: 100%;
  min-height: 44px;
  background: var(--app-accent);
}

.app-toast.is-success::before { background: var(--app-success); }
.app-toast.is-error::before { background: var(--app-danger); }
.app-toast.is-warning::before { background: var(--app-warning); }

.app-toast-title {
  margin: 0 0 3px;
  font-size: 14px;
  font-weight: 800;
}

.app-toast-message {
  margin: 0;
  color: var(--app-muted);
  font-size: 14px;
  line-height: 1.35;
}

.app-toast-close {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: #f6ede3;
  color: var(--app-text);
  cursor: pointer;
  font-weight: 800;
}

.app-install-banner {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 99999;
  width: min(520px, calc(100vw - 28px));
  padding: 16px;
  display: none;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  border: 1px solid rgba(123, 82, 55, 0.16);
  border-radius: 16px;
  background: rgba(255, 250, 244, 0.96);
  color: var(--app-text);
  box-shadow: 0 22px 48px rgba(45, 28, 17, 0.18);
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
}

.app-install-banner.is-visible {
  display: grid;
  animation: appInstallIn 0.28s ease;
}

.app-install-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 800;
}

.app-install-text {
  margin: 0;
  color: var(--app-muted);
  font-size: 13px;
  line-height: 1.35;
}

.app-install-actions {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.app-install-button,
.app-install-dismiss {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 9px 12px;
  cursor: pointer;
  font-weight: 800;
}

.app-install-button {
  background: linear-gradient(135deg, var(--app-accent-dark), var(--app-accent));
  color: #fff;
}

.app-install-dismiss {
  background: #f6ede3;
  color: var(--app-text);
}

.app-confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100001;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(47, 36, 29, 0.38);
  backdrop-filter: blur(4px);
}

.app-confirm-dialog {
  width: min(420px, 100%);
  padding: 20px;
  border-radius: 16px;
  border: 1px solid rgba(123, 82, 55, 0.18);
  background: var(--app-surface);
  color: var(--app-text);
  box-shadow: 0 24px 58px rgba(27, 17, 11, 0.24);
}

.app-confirm-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 900;
}

.app-confirm-message {
  margin: 0;
  color: var(--app-muted);
  line-height: 1.45;
}

.app-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.app-confirm-cancel,
.app-confirm-ok {
  min-height: 42px;
  padding: 9px 14px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.app-confirm-cancel {
  background: #f6ede3;
  color: var(--app-text);
}

.app-confirm-ok {
  background: var(--app-danger);
  color: #fff;
}

@keyframes appToastIn {
  to { transform: translateX(0); opacity: 1; }
}

@keyframes appInstallIn {
  from { transform: translate(-50%, 18px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

@media (max-width: 560px) {
  .app-toast-stack {
    top: 12px;
    right: 12px;
    width: calc(100vw - 24px);
  }

  .app-install-banner {
    grid-template-columns: 1fr;
  }

  .app-install-actions {
    width: 100%;
  }

  .app-install-button,
  .app-install-dismiss {
    flex: 1;
  }

  .app-confirm-actions {
    flex-direction: column-reverse;
  }

  .app-confirm-cancel,
  .app-confirm-ok {
    width: 100%;
  }
}
