* {
      box-sizing: border-box;
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, sans-serif;
    }

    header {
      justify-items: center;
      text-align: center;
    }

    body {
      margin: 0;
      padding: 0;
      background: radial-gradient(circle at top, #fce9d2, #c58c5b);
      min-height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .app {
      background: #fdfaf6;
      border-radius: 24px;
      box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
      padding: 24px;
      max-width: 1100px;
      width: 95%;
      display: grid;
      grid-template-columns: 2fr 1.3fr;
      gap: 24px;
    }

    @media (max-width: 900px) {
      .app {
        grid-template-columns: 1fr;
      }
    }

    h1 {
      margin: 0 0 4px;
      font-size: 1.9rem;
      letter-spacing: 0.04em;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
    }

    h1 span {
      font-size: 1.5rem;
    }

    .subtitle {
      margin: 0 0 16px;
      color: #6b4b33;
      font-size: 0.95rem;
    }

    .badge-row {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-bottom: 18px;
      justify-content: center;
    }

    .badge {
      font-size: 0.75rem;
      padding: 4px 10px;
      border-radius: 999px;
      background: #f1e1d3;
      color: #5c3d2c;
    }

    .content-left {
      display: flex;
      flex-direction: column;
      gap: 16px;
    }

    .card {
      background: #ffffff;
      border-radius: 18px;
      padding: 16px 18px;
      border: 1px solid #f0e2d8;
    }

    .card-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 10px;
    }

    .card-title {
      font-weight: 600;
      font-size: 1rem;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .card-title span {
      font-size: 1.2rem;
    }

    .coffee-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 12px;
    }

    @media (max-width: 600px) {
      .coffee-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
    }

    .coffee-card {
      border-radius: 14px;
      padding: 10px;
      background: #fdf5ee;
      border: 1px solid #f2ddca;
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .coffee-name {
      font-weight: 600;
      font-size: 0.95rem;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .coffee-price {
      font-size: 0.85rem;
      color: #8d5b3a;
    }

    .coffee-ingredients {
      font-size: 0.75rem;
      color: #7a5a43;
    }

    button {
      border: none;
      border-radius: 999px;
      padding: 7px 12px;
      font-size: 0.8rem;
      cursor: pointer;
      transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.18s;
    }

    button:active {
      transform: translateY(1px) scale(0.99);
      box-shadow: none;
    }

    .btn-primary {
      background: #c6733c;
      color: #fff;
      box-shadow: 0 3px 0 #8f4f28;
    }

    .btn-primary:hover {
      background: #d27d42;
    }

    .btn-secondary {
      background: #f0e2d8;
      color: #5c3d2c;
    }

    .btn-secondary:hover {
      background: #e7d5c6;
    }

    .actions-row {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      align-items: center;
    }

    .status {
      margin-top: 8px;
      font-size: 0.85rem;
      min-height: 1.4em;
    }

    .status.ok { color: #1b7b4c; }
    .status.error { color: #b02020; }
    .status.info { color: #6b4b33; }

    .report-list {
      list-style: none;
      margin: 0;
      padding: 0;
      font-size: 0.85rem;
    }

    .report-list li {
      display: flex;
      justify-content: space-between;
      padding: 4px 0;
      border-bottom: 1px dashed #f0e2d8;
    }

    .report-list li:last-child {
      border-bottom: none;
    }

    .content-right {
      display: flex;
      flex-direction: column;
      gap: 14px;
    }

    .payment-form {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px 12px;
      margin: 8px 0 6px;
      font-size: 0.8rem;
    }

    .payment-form label {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .payment-form input {
      border-radius: 999px;
      border: 1px solid #d8c2b2;
      padding: 5px 8px;
      font-size: 0.8rem;
      width: 100%;
    }

    .current-order {
      font-size: 0.85rem;
      color: #5c3d2c;
      margin-bottom: 4px;
    }

    .machine-off-banner {
      font-size: 0.8rem;
      color: #b02020;
      background: #ffe3e3;
      border-radius: 999px;
      padding: 4px 10px;
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }

    /* --- Lottie layout --- */
    .lottie-row {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 16px;
      margin: 8px 0 12px;
    }

    #brew-animation-slot {
      width: 120px;
      height: 120px;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    /* --- OFF state: disable everything inside .app... --- */
    .muted {
      opacity: 0.35;
      pointer-events: none;
      filter: grayscale(0.4);
    }

    /* --- ...but allow the TURN ON button to still work --- */
    .muted #btn-on {
      pointer-events: auto;
      opacity: 1;
      filter: none;
      /* Extra safe: ensure black even if another class lingers */
      background-color: #000000 !important;
      color: #ffffff !important;
    }

    /* 🖤 TURN ON button attention state (BLACK) */
    .power-on-highlight {
      background-color: #000000 !important;
      color: #ffffff !important;
      border: 2px solid #ffffff !important;
      box-shadow:
        0 0 0 3px rgba(0, 0, 0, 0.35),
        0 0 18px rgba(0, 0, 0, 0.9) !important;
      animation: pulseGlowBlack 1.4s infinite;
    }

    @keyframes pulseGlowBlack {
      0% {
        box-shadow:
          0 0 0 3px rgba(0, 0, 0, 0.35),
          0 0 10px rgba(0, 0, 0, 0.7);
      }
      50% {
        box-shadow:
          0 0 0 6px rgba(0, 0, 0, 0.55),
          0 0 22px rgba(0, 0, 0, 1);
      }
      100% {
        box-shadow:
          0 0 0 3px rgba(0, 0, 0, 0.35),
          0 0 10px rgba(0, 0, 0, 0.7);
      }
    }