*, *::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;
}

/* ---- Layout ---- */
.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 ---- */
.section-title {
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.8px; color: #444; margin-bottom: 8px;
}

/* ---- Source textarea ---- */
.source-textarea {
  width: 100%;
  background: #0c0f1e;
  border: 1px solid #1e2340;
  border-radius: 8px;
  color: #e0e0e0;
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
  font-size: 12px;
  padding: 10px 12px;
  resize: none;
  outline: none;
  line-height: 1.65;
  transition: border-color .15s;
  scrollbar-width: thin;
  scrollbar-color: #1e1e1e transparent;
}
.source-textarea:focus { border-color: rgba(95, 125, 255, 0.4); }
.source-textarea::placeholder { color: #2a2a3a; }
.source-textarea::-webkit-scrollbar { width: 4px; }
.source-textarea::-webkit-scrollbar-thumb { background: #1e1e1e; border-radius: 4px; }

/* ---- Input footer ---- */
.input-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}

.word-count {
  font-size: 10px;
  color: #333;
  font-family: monospace;
}

.btn-clear {
  background: none;
  border: none;
  color: #333;
  font-size: 11px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color .15s;
}
.btn-clear:hover { color: #8ea0ff; }

/* ---- Sample buttons ---- */
.samples {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sample-btn {
  background: rgba(95, 125, 255, 0.07);
  border: 1px solid rgba(95, 125, 255, 0.14);
  border-radius: 6px;
  color: #666;
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
  font-size: 10px;
  padding: 4px 8px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.sample-btn:hover {
  background: rgba(95, 125, 255, 0.16);
  border-color: rgba(95, 125, 255, 0.3);
  color: #8ea0ff;
}

/* ---- About note ---- */
.about-note { font-size: 11px; color: #2a2a3a; line-height: 1.6; }

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

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

/* ---- Topbar ---- */
.output-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px 9px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(70, 80, 150, 0.12);
  background: rgba(10, 13, 28, 0.6);
  gap: 12px;
}

.topbar-left { display: flex; align-items: center; gap: 10px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

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

.detected-badge {
  font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 20px;
  background: rgba(95, 125, 255, 0.12);
  color: #8ea0ff;
  border: 1px solid rgba(95, 125, 255, 0.25);
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
}
.detected-badge:empty { display: none; }

.output-meta { font-size: 11px; color: #444; font-family: monospace; }

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

/* ---- Conversion list ---- */
.conv-list {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #1e1e1e transparent;
}
.conv-list::-webkit-scrollbar { width: 6px; }
.conv-list::-webkit-scrollbar-track { background: transparent; }
.conv-list::-webkit-scrollbar-thumb { background: #1e1e1e; border-radius: 4px; }

/* ---- Conversion row ---- */
.conv-row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 11px 24px;
  border-bottom: 1px solid rgba(70, 80, 150, 0.06);
  transition: background .12s;
  min-height: 54px;
}
.conv-row:last-child { border-bottom: none; }
.conv-row:hover { background: rgba(95, 125, 255, 0.025); }

.conv-meta {
  min-width: 148px;
  flex-shrink: 0;
}

.conv-name {
  display: block;
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
  font-size: 12px;
  font-weight: 600;
  color: #5f7dff;
  letter-spacing: 0.2px;
}

.conv-desc {
  display: block;
  font-size: 10px;
  color: #2e3050;
  margin-top: 3px;
  line-height: 1.4;
}

.conv-value {
  flex: 1;
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
  font-size: 14px;
  color: #c8d8ff;
  letter-spacing: 0.3px;
  word-break: break-all;
  line-height: 1.6;
}
.conv-value.empty { color: #1e2030; font-size: 13px; }

.conv-copy {
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: #1e2030;
  cursor: pointer;
  padding: 6px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  transition: color .15s, background .15s;
}
.conv-copy:hover { color: #8ea0ff; background: rgba(95, 125, 255, 0.08); }
.conv-copy.copied { color: #00c878; }

/* ---- 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; overflow: visible; }
  .conv-list { overflow: visible; }
}
