/* ===== Page ===== */
.page {
  flex: 1;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ===== 2-col layout ===== */
.tool-layout {
  display: grid;
  grid-template-columns: 1fr 272px;
  gap: 12px;
  align-items: start;
}

/* ===== Left: textarea card ===== */
.input-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.input-head {
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.input-head-title { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.input-meta { font-size: 12px; color: var(--muted); }

.input-body { padding: 14px 18px; }

textarea {
  width: 100%; min-height: 340px;
  padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 6px;
  font: inherit; font-size: 14px; line-height: 1.75;
  color: var(--ink); background: var(--bg);
  resize: vertical; transition: border-color 140ms;
}
textarea::placeholder { color: #d1d5db; }
textarea:focus { outline: none; border-color: #6b7280; background: var(--surface); }

.input-foot {
  padding: 10px 18px 14px;
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--border);
}

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); font: inherit; font-size: 13px; font-weight: 500;
  color: var(--sub); cursor: pointer; transition: all 100ms;
}
.btn:hover { background: var(--hover); border-color: #9ca3af; color: var(--ink); }
.btn.danger:hover { background: #fef2f2; border-color: #fca5a5; color: #dc2626; }
.btn.copied { background: #f0fdf4; border-color: #86efac; color: #16a34a; }

/* ===== Right: stats panel ===== */
.stats-panel {
  display: flex; flex-direction: column; gap: 12px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.stat-card-head {
  padding: 10px 16px 8px;
  border-bottom: 1px solid var(--border);
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  color: var(--muted); text-transform: uppercase;
}

.stat-primary {
  background: var(--ink);
  border-color: var(--ink);
  padding: 18px 18px 16px;
  border-radius: 8px;
  display: flex; flex-direction: column; gap: 2px;
}
.stat-primary-label { font-size: 11px; color: rgba(255,255,255,0.45); letter-spacing: 0.06em; text-transform: uppercase; }
.stat-primary-value {
  font-size: 42px; font-weight: 600; color: white;
  letter-spacing: -0.03em; line-height: 1;
}
.stat-primary-unit { font-size: 16px; font-weight: 400; color: rgba(255,255,255,0.5); margin-left: 3px; }
.stat-primary-sub { font-size: 12px; color: rgba(255,255,255,0.35); margin-top: 4px; }

.stat-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}
.stat-row:last-child { border-bottom: none; }
.stat-row-label { font-size: 13px; color: var(--sub); }
.stat-row-value {
  font-size: 16px; font-weight: 600; color: var(--ink);
  white-space: nowrap;
}
.stat-row-unit { font-size: 11px; font-weight: 400; color: var(--muted); margin-left: 2px; }


.about-text { font-size: 13.5px; color: var(--sub); line-height: 1.75; }
.about-text p { margin-bottom: 12px; }
.about-text p:last-child { margin: 0; }
.about-text b { color: var(--ink); }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .tool-layout { grid-template-columns: 1fr; }
  .stats-panel { flex-direction: row; flex-wrap: wrap; }
  .stat-primary { flex: 1; min-width: 140px; }
  .stat-card { flex: 1; min-width: 140px; }
}
