:root{
  --coffee-accent: #7dd3fc;
  --coffee-accent-2:#a78bfa;
  --coffee-warn:#fbbf24;
  --coffee-ok:#34d399;
  --coffee-bg: rgba(10, 12, 18, 0.75);
  --coffee-panel: rgba(17, 24, 39, 0.55);
  --coffee-border: rgba(255,255,255,0.08);
}

/* -----------------------------
   HARD OVERRIDES + BASE
------------------------------ */
html, body { height: 100%; }

body{
  margin: 0;
  color-scheme: dark;
  color: #e5e7eb !important;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;

  background-color: #0b1220 !important;
  background-image:
    radial-gradient(1200px 700px at 20% 10%, rgba(125,211,252,0.12), transparent 55%),
    radial-gradient(900px 600px at 75% 30%, rgba(167,139,250,0.12), transparent 50%),
    linear-gradient(180deg, rgba(0,0,0,0.10), rgba(0,0,0,0.55)) !important;
}

/* Let grid children shrink (prevents overlap) */
*{ box-sizing: border-box; }
.panel *{ min-width: 0; }

a{ color: var(--coffee-accent) !important; text-decoration: none; }
a:hover{ text-decoration: underline; }

/* -----------------------------
   LAYOUT
------------------------------ */
.coffee-wrap{
  max-width: 980px;
  margin: 26px auto;
  padding: 0 16px 40px;
}

.coffee-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 14px;

  padding: 18px 18px 16px;
  border-radius: 18px;
  background: var(--coffee-bg);
  border: 1px solid var(--coffee-border);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 60px rgba(0,0,0,0.35);
  color:#e5e7eb !important;
}

.coffee-title{
  margin:0;
  font-size: clamp(26px, 3.4vw, 40px);
  letter-spacing: 0.2px;
  line-height: 1.1;
}

.coffee-sub{
  margin: 8px 0 0;
  opacity: 0.85;
  max-width: 64ch;
  font-size: clamp(14px, 1.6vw, 18px);
}

.chip-row{
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.chip{
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--coffee-border);
  background: rgba(255,255,255,0.04);
  opacity: 0.92;
  user-select:none;
}
.chip strong{ color: var(--coffee-accent); font-weight: 700; }

.coffee-grid{
  margin-top: 14px;
  display:grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 14px;
}

/* -----------------------------
   PANELS + TYPO
------------------------------ */
.panel{
  padding: 16px;
  border-radius: 18px;
  background: var(--coffee-panel);
  border: 1px solid var(--coffee-border);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 60px rgba(0,0,0,0.25);
  color:#e5e7eb !important;
}

.panel h2{
  margin: 0 0 10px;
  font-size: clamp(18px, 2vw, 20px);
  letter-spacing: 0.2px;
}

.big{
  font-size: clamp(28px, 4.2vw, 40px);
  margin: 0;
  letter-spacing: 0.2px;
}

.muted{
  opacity: 0.85;
  font-size: 13px;
  margin: 6px 0 0;
}

.kbd{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  display:inline-block;
  opacity: 0.95;
}

/* -----------------------------
   FORM GRID (NO OVERLAP)
------------------------------ */
.row{
  display:grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  margin: 10px 0;
}

label{
  display:block;
  font-size: 12px;
  opacity: 0.9;
  margin-bottom: 6px;
}

input, select, button, option{
  color: #e5e7eb !important;
  max-width: 100%;
}

/* Keep long select values from blowing layout */
select{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

input[type="number"], select{
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12) !important;
  background: rgba(0,0,0,0.35) !important;
  outline: none;
}

input[type="range"]{
  width: 100%;
  max-width: 100%;
  accent-color: var(--coffee-accent);
}

/* -----------------------------
   BUTTONS
------------------------------ */
.btnrow{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.btn{
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  cursor: pointer;
  transition: transform .08s ease, background .12s ease;
  user-select:none;
}

.btn:hover{ background: rgba(255,255,255,0.10); }
.btn:active{ transform: translateY(1px); }

.btn-primary{
  border-color: rgba(125,211,252,0.35);
  background: linear-gradient(180deg, rgba(125,211,252,0.16), rgba(125,211,252,0.06));
}

/* -----------------------------
   RESULTS + STATUS PILLS
------------------------------ */
.results{
  margin-top: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.22);
  color:#e5e7eb !important;
}

.status{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 13px;
}

.pill{
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
}

.pill b{ color: var(--coffee-accent); }
.pill.good b{ color: var(--coffee-ok); }
.pill.warn b{ color: var(--coffee-warn); }

/* -----------------------------
   TABLE
------------------------------ */
.table{
  width:100%;
  border-collapse: collapse;
  margin-top: 10px;
  overflow:hidden;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
}

.table th, .table td{
  padding: 10px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 13px;
  text-align:left;
  background: rgba(0,0,0,0.12);
  color:#e5e7eb !important;
}

.table th{
  background: rgba(255,255,255,0.05);
  font-weight: 700;
}
.table tr:last-child td{ border-bottom:none; }

/* -----------------------------
   RESPONSIVE BREAKPOINTS
------------------------------ */

/* Tablets/smaller laptops: 1-column main layout sooner */
@media (max-width: 1024px){
  .coffee-grid{ grid-template-columns: 1fr; }
}

/* Phones: force all input rows to stack; avoid any squeezing */
@media (max-width: 700px){
  .row{ grid-template-columns: 1fr; }

  .btnrow{ gap: 8px; }
  .btn{ flex: 1 1 auto; }

  .status{ gap: 8px; }

  /* Table becomes horizontally scrollable instead of overlapping/squishing */
  .table{
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* Very small phones */
@media (max-width: 420px){
  .coffee-wrap{ padding: 0 10px 28px; }
  .panel{ padding: 14px; }
  .coffee-header{ padding: 14px; }
}
