:root {
  --bg: #0f172a;
  --card: #111827;
  --card-2: #1f2937;
  --text: #f8fafc;
  --muted: #94a3b8;
  --border: #334155;
  --primary: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #38bdf8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Tahoma, Arial, sans-serif;
  direction: rtl;
  background: radial-gradient(circle at top, #1e293b, var(--bg));
  color: var(--text);
}

.container {
  width: min(1220px, calc(100% - 32px));
  margin: 32px auto;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.brand h1 { margin: 0 0 6px; font-size: 28px; }
.brand p { margin: 0; color: var(--muted); line-height: 1.8; }

.card {
  background: rgba(17, 24, 39, 0.9);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 20px;
  box-shadow: 0 20px 80px rgba(0,0,0,.25);
  margin-bottom: 18px;
}

.card h2 { margin-top: 0; }
h3 { margin: 22px 0 12px; color: #dbeafe; }

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

.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.full { grid-column: 1 / -1; }

label {
  display: block;
  color: #cbd5e1;
  margin-bottom: 6px;
  font-size: 14px;
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--border);
  background: #020617;
  color: var(--text);
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, .12);
}

textarea {
  min-height: 110px;
  direction: ltr;
  text-align: left;
  font-family: Consolas, Monaco, monospace;
  line-height: 1.6;
}

button {
  border: none;
  border-radius: 14px;
  padding: 12px 16px;
  cursor: pointer;
  background: var(--primary);
  color: #03110a;
  font-weight: bold;
}

button:hover { filter: brightness(1.05); }
button.secondary { background: var(--card-2); color: var(--text); border: 1px solid var(--border); }
button.danger { background: var(--danger); color: white; }

.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.tab { display: none; }
.tab.active { display: block; }

.result {
  direction: ltr;
  text-align: left;
  white-space: pre-wrap;
  background: #020617;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  min-height: 130px;
  max-height: 520px;
  overflow: auto;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
  line-height: 1.7;
}

.notice {
  border: 1px solid rgba(56, 189, 248, .35);
  background: rgba(14, 165, 233, .08);
  color: #dbeafe;
  padding: 12px 14px;
  border-radius: 16px;
  margin-bottom: 16px;
  line-height: 1.8;
}

.notice code {
  direction: ltr;
  display: inline-block;
  background: rgba(2, 6, 23, .75);
  padding: 1px 6px;
  border-radius: 7px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--card-2);
  padding: 8px 10px;
  border-radius: 999px;
  color: #cbd5e1;
  white-space: nowrap;
}

.footer {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  margin-top: 24px;
}

a { color: #86efac; text-decoration: none; }
.hidden { display: none !important; }
.header-box { margin-top: 14px; }

@media (max-width: 900px) {
  .grid, .grid.three { grid-template-columns: 1fr; }
  .header { flex-direction: column; align-items: flex-start; }
}
