/* styles.css (white modern) */
:root{
  --bg0: #f6f7fb;
  --bg1: #eef1f7;

  --card: rgba(255,255,255,0.92);
  --card2: rgba(255,255,255,0.78);

  --panel: rgba(255,255,255,0.92);
  --panel2: rgba(250,250,252,0.92);

  --stroke: rgba(20, 24, 35, 0.10);
  --stroke2: rgba(20, 24, 35, 0.08);
  --stroke3: rgba(20, 24, 35, 0.06);

  --text: #111827;
  --muted: rgba(17, 24, 39, 0.62);

  --ok: #16a34a;
  --danger: #dc2626;

  --shadow: 0 22px 55px rgba(16, 24, 40, 0.12);

  /* Squared corners */
  --r: 10px;
  --r2: 8px;

  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

*{ box-sizing:border-box; }
html,body{ height:100%; margin:0; font-family:var(--sans); color:var(--text); background:var(--bg0); }

.bg{
  position:fixed; inset:0;
  background:
    radial-gradient(1100px 700px at 20% 10%, rgba(255, 153, 102, 0.12), transparent 55%),
    radial-gradient(900px 650px at 80% 20%, rgba(99, 102, 241, 0.10), transparent 58%),
    radial-gradient(900px 650px at 40% 90%, rgba(34, 197, 94, 0.10), transparent 60%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  pointer-events:none;
}

.wrap{
  min-height:100%;
  display:grid;
  place-items:center;
  padding: 24px 14px;
}

/* main frame */
.card{
  width:min(980px, 100%);
  border-radius: var(--r);
  background: linear-gradient(180deg, var(--card), var(--card2));
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  overflow:hidden;
  position: relative;
}

/* subtle inner border */
.card::before{
  content:"";
  position:absolute;
  inset: 10px;
  border-radius: calc(var(--r) - 2px);
  border: 1px solid var(--stroke3);
  pointer-events:none;
}

/* header */
.header{
  padding: 14px 14px;
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:space-between;
  border-bottom: 1px solid var(--stroke2);
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.75));
  position: relative;
  z-index: 1;
}

.brand{ display:flex; align-items:center; gap:12px; }

.brand-icon{
  width: 34px;
  height: 34px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--stroke2);
  background: rgba(0,0,0,0.02);
  box-shadow: 0 10px 18px rgba(16, 24, 40, 0.10);
}

.title{
  margin:0;
  font-size:16px;
  letter-spacing:0.2px;
  font-weight: 900;
}
.subtitle{
  margin:2px 0 0;
  color: var(--muted);
  font-size:12.5px;
}

/* status pill */
.pill{
  display:flex; align-items:center; gap:10px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--stroke);
  background: rgba(17,24,39,0.02);
  font-size: 13px;
  white-space: nowrap;
}
.dot{
  width:8px; height:8px;
  border-radius: 3px;
  background: rgba(17,24,39,0.20);
  box-shadow: 0 0 0 3px rgba(17,24,39,0.06);
}
.pill[data-state="ok"] .dot{
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(22,163,74,0.14);
}
.pill[data-state="bad"] .dot{
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(220,38,38,0.14);
}

.content{ padding: 14px; position: relative; z-index: 1; }

.grid{
  display:grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 12px;
}
@media (max-width: 860px){
  .grid{ grid-template-columns: 1fr; }
}

/* panels */
.panel{
  border: 1px solid var(--stroke2);
  border-radius: var(--r);
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  overflow:hidden;
}

.panel-head{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--stroke3);
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(250,250,252,0.80));
}
.panel-title{
  font-size: 12px;
  letter-spacing: 0.25px;
  font-weight: 900;
  text-transform: uppercase;
  color: rgba(17,24,39,0.88);
}
.panel-meta{
  font-size: 12px;
  color: rgba(17,24,39,0.50);
}

.panel-body{ padding: 12px; }

.row{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.row-end{ justify-content:flex-end; }

.divider{ height:1px; background: rgba(17,24,39,0.08); margin: 12px 0; }

.field{
  margin-top: 12px;
  padding: 10px 10px;
  border-radius: var(--r2);
  border: 1px solid rgba(17,24,39,0.10);
  background: rgba(17,24,39,0.02);
}
.field-label{
  font-size:12px;
  color: rgba(17,24,39,0.56);
  margin-bottom:6px;
  font-weight: 700;
}
.field-value{
  font-size: 14px;
  line-height: 1.3;
  word-break: break-word;
}

/* Buttons (modern gradient) */
.btn{
  appearance:none;
  border: 1px solid rgba(17,24,39,0.12);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 900;
  cursor:pointer;
  user-select:none;
  background: rgba(255,255,255,0.75);
  color: var(--text);
  transition: transform .06s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease, filter .15s ease;
}
.btn:active{ transform: translateY(1px); }
.btn:disabled{ opacity:0.55; cursor:not-allowed; }

.btn-primary{
  border-color: rgba(17,24,39,0.14);
  background: linear-gradient(135deg, #ffffff 0%, #f3f4f6 35%, #ffffff 100%);
  box-shadow: 0 10px 18px rgba(16,24,40,0.10);
}
.btn-primary:hover{ filter: brightness(1.02); box-shadow: 0 14px 26px rgba(16,24,40,0.14); }

.btn-ghost{
  background: rgba(17,24,39,0.03);
  border-color: rgba(17,24,39,0.10);
}
.btn-ghost:hover{ background: rgba(17,24,39,0.05); }

.btn-danger{
  margin-top: 10px
  color: #7f1d1d;
  border-color: rgba(220,38,38,0.20);
  background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 45%, #fff1f2 100%);
}
.btn-danger:hover{ filter: brightness(1.02); }

.btn-small{
  padding: 8px 10px;
  font-size: 12px;
  border-radius: 10px;
}

/* Language select */
.select{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding: 10px 10px;
  border-radius: var(--r2);
  border: 1px solid rgba(17,24,39,0.10);
  background: rgba(17,24,39,0.02);
  margin-bottom: 10px;
}
.select-label{
  font-size: 12.5px;
  color: rgba(17,24,39,0.62);
  font-weight: 800;
}
.select select{
  background: #ffffff;
  color: var(--text);
  border: 1px solid rgba(17,24,39,0.14);
  border-radius: 10px;
  padding: 8px 10px;
  outline: none;
}
.select select:focus{
  border-color: rgba(17,24,39,0.22);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

.hint{
  margin-top: 12px;
  font-size: 12px;
  color: rgba(17,24,39,0.52);
}

/* Debug toggle */
.check{
  display:flex;
  align-items:center;
  gap:10px;
  font-size: 13px;
  color: rgba(17,24,39,0.70);
  user-select:none;
  font-weight: 700;
}
.check input{
  width:16px; height:16px;
  accent-color: #111827;
}

.debug{
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(17,24,39,0.08);
}

.log{
  margin-top: 10px;
  padding: 10px;
  border-radius: var(--r2);
  border: 1px solid rgba(17,24,39,0.10);
  background: rgba(17,24,39,0.02);
  min-height: 160px;
  max-height: 280px;
  overflow:auto;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  color: rgba(17,24,39,0.86);
}

.footer{
  padding: 12px 14px;
  border-top: 1px solid rgba(17,24,39,0.08);
  background: rgba(255,255,255,0.60);
  position: relative;
  z-index: 1;
}

.footer-note{
  color: rgba(17,24,39,0.50);
  font-size: 12px;
}

.footer-meta{
  color: rgba(17,24,39,0.56);
  font-size: 12px;
}