*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; overflow: hidden; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, rgba(96,120,255,0.12), transparent 28%),
    radial-gradient(circle at bottom right, rgba(95,125,255,0.08), transparent 28%),
    #080a13;
  color: #e0e0e0;
  display: flex;
  align-items: stretch;
}

.container {
  display: grid;
  grid-template-columns: 300px 1fr;
  width: 100%;
  height: 100vh;
}

/* ---- Sidebar ---- */
.panel {
  background: rgba(12,16,34,0.98);
  border-right: 1px solid rgba(70,80,150,0.18);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.panel-header {
  padding: 24px 20px 18px;
  border-bottom: 1px solid rgba(71,88,197,0.2);
  background: linear-gradient(180deg, rgba(30,37,74,0.98), rgba(11,14,30,0.98));
  flex-shrink: 0;
}

.brand-title { display: flex; align-items: center; gap: 18px; }

.brand-logo {
  width: 96px; height: auto; min-width: 96px;
  border-radius: 18px; padding: 8px;
  filter: drop-shadow(0 0 18px rgba(95,125,255,0.35));
}

.brand-label {
  font-size: 10px; letter-spacing: 0.16em;
  text-transform: uppercase; color: #8ea0ff; margin-bottom: 4px;
}

.panel-header h1 {
  font-size: 22px; font-weight: 700; color: #fff; letter-spacing: -0.3px; margin: 0;
}

.tool-tagline { margin: 6px 0 0; font-size: 12px; color: #b5bfff; }

.panel-body {
  flex: 1; overflow-y: auto; padding: 16px 20px;
  display: flex; flex-direction: column; gap: 16px;
  scrollbar-width: thin; scrollbar-color: #2a2a2a transparent;
}
.panel-body::-webkit-scrollbar { width: 4px; }
.panel-body::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 4px; }

.section-title {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.8px; color: #444; margin-bottom: 8px;
}

hr { border: none; border-top: 1px solid #1c1c1c; }

/* ---- Presets ---- */
.preset-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.preset-btn {
  background: #0e1020;
  border: 1px solid #1e2340;
  border-radius: 7px;
  color: #666;
  font-size: 11px;
  padding: 6px 8px;
  cursor: pointer;
  transition: all .15s;
  text-align: left;
}
.preset-btn:hover { border-color: #5f7dff; color: #8ea0ff; background: rgba(95,125,255,0.07); }

/* ---- Fields ---- */
.fields-list { display: flex; flex-direction: column; gap: 8px; }

.field-row {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  align-items: center;
  gap: 8px;
}

.field-label { font-size: 12px; color: #888; }

.field-input {
  background: #111420;
  border: 1px solid #1e2340;
  border-radius: 7px;
  color: #e0e0e0;
  font-size: 13px;
  font-family: 'Menlo','Monaco','Courier New',monospace;
  padding: 6px 8px;
  outline: none;
  transition: border-color .15s;
  width: 100%;
}
.field-input:focus { border-color: #5f7dff; }
.field-input.error { border-color: #ff6060; color: #ff6060; }

.field-hint { font-size: 10px; color: #333; white-space: nowrap; font-family: monospace; }

/* ---- Output side ---- */
.output-side { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

.output-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(70,80,150,0.18);
  background: rgba(10,13,28,0.8);
  flex-shrink: 0; gap: 10px;
}

.status-badge {
  font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 20px;
}
.status-badge.valid   { background: rgba(0,200,120,0.12); color: #00c878; border: 1px solid rgba(0,200,120,0.25); }
.status-badge.invalid { background: rgba(255,80,80,0.12); color: #ff6060; border: 1px solid rgba(255,80,80,0.25); }

.copy-btn {
  display: flex; align-items: center; gap: 6px;
  background: rgba(95,125,255,0.1); color: #8ea0ff;
  border: 1px solid rgba(95,125,255,0.2); border-radius: 7px;
  padding: 5px 12px; font-size: 12px; cursor: pointer;
  transition: background .15s, color .15s;
}
.copy-btn:hover { background: rgba(95,125,255,0.2); color: #fff; }
.copy-btn.copied { color: #00c878; border-color: rgba(0,200,120,0.3); background: rgba(0,200,120,0.08); }

/* ---- Output body ---- */
.output-body {
  flex: 1; overflow-y: auto; padding: 20px;
  display: flex; flex-direction: column; gap: 16px;
  scrollbar-width: thin; scrollbar-color: #1e1e1e transparent;
}
.output-body::-webkit-scrollbar { width: 6px; }
.output-body::-webkit-scrollbar-thumb { background: #1e1e1e; border-radius: 4px; }

/* ---- Expression card ---- */
.expression-card {
  background: rgba(15,20,25,0.6);
  border: 1.5px solid #1a1f30;
  border-radius: 10px;
  padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
}

.expression-parts {
  display: flex; gap: 6px; flex-wrap: wrap;
}

.expr-part {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}

.expr-value {
  font-family: 'Menlo','Monaco','Courier New',monospace;
  font-size: 20px; font-weight: 700;
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(95,125,255,0.1);
  border: 1px solid rgba(95,125,255,0.2);
  color: #8ea0ff;
  min-width: 48px; text-align: center;
}
.expr-value.wildcard { color: #555; border-color: #1a1f30; background: rgba(255,255,255,0.02); }

.expr-field-name {
  font-size: 9px; text-transform: uppercase;
  letter-spacing: 0.6px; color: #333;
}

.expr-sep {
  font-size: 24px; color: #222; align-self: center;
  padding-bottom: 16px; font-weight: 300;
}

.expression-raw {
  font-family: 'Menlo','Monaco','Courier New',monospace;
  font-size: 14px; color: #556;
  letter-spacing: 0.05em;
}

/* ---- Description card ---- */
.description-card {
  background: rgba(15,20,25,0.6);
  border: 1.5px solid #1a1f30;
  border-radius: 10px;
  padding: 16px 20px;
}

.description-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.8px; color: #444; margin-bottom: 10px;
}

.description-text {
  font-size: 15px; color: #c0cce0; line-height: 1.6; font-weight: 500;
}

/* ---- Next runs card ---- */
.next-card {
  background: rgba(15,20,25,0.6);
  border: 1.5px solid #1a1f30;
  border-radius: 10px;
  padding: 16px 20px;
}

.next-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.8px; color: #444; margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}

.next-tz { font-size: 9px; color: #2a2a3a; text-transform: none; letter-spacing: 0; }

.next-list { display: flex; flex-direction: column; gap: 5px; }

.next-item {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px;
}
.next-num {
  font-size: 10px; color: #333; width: 16px;
  font-family: monospace; flex-shrink: 0;
}
.next-date { color: #8ea0ff; font-family: monospace; }
.next-rel  { color: #333; font-size: 11px; }

/* ---- Reference card ---- */
.ref-card {
  background: rgba(15,20,25,0.4);
  border: 1px solid #12151f;
  border-radius: 10px;
  padding: 14px 20px;
}

.ref-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.8px; color: #333; margin-bottom: 10px;
}

.ref-grid { display: flex; flex-direction: column; gap: 5px; }

.ref-row { display: flex; align-items: baseline; gap: 10px; }
.ref-row code {
  font-family: monospace; font-size: 12px;
  color: #8ea0ff; background: rgba(95,125,255,0.08);
  padding: 1px 6px; border-radius: 4px;
  min-width: 60px; display: inline-block;
}
.ref-row span { font-size: 11px; color: #444; }

/* ---- Mobile ---- */
@media (max-width: 700px) {
  html, body { overflow: auto; height: auto; }
  .container { grid-template-columns: 1fr; height: auto; min-height: 100vh; }
  .panel { height: auto; overflow: visible; border-right: none; border-bottom: 1px solid rgba(70,80,150,0.18); }
  .panel-body { overflow: visible; }
  .output-side { height: auto; }
}
