/* 어레인지 학습 (#page-arrange-learn 안에서만 적용되는 .al-* 룰들).
   전역 reset/body 룰은 styles.css가 담당하므로 여기서는 제거. */

/* styles.css의 글로벌 `header { display: none !important }`를 덮어 SPA 안에서 보이게 */
#page-arrange-learn header.al-header {
  display: flex !important;
}

.al-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  background: #fff;
  border-bottom: 1px solid #e5e5e7;
  position: sticky; top: 0; z-index: 10;
}
.al-title { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.al-back {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent); text-decoration: none; font-size: 13px; font-weight: var(--fw-semibold);
}
.al-back:hover { text-decoration: underline; }
.al-user { font-size: 12px; color: #6e6e73; }

.al-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 20px 24px;
  max-width: 1400px;
  margin: 0 auto;
}
@media (max-width: 900px) {
  .al-main { grid-template-columns: 1fr; }
}

.al-panel {
  background: #fff;
  border: 1px solid #e5e5e7;
  border-radius: var(--r-lg);
  padding: 20px;
}
.al-panel-title {
  font-size: 13px; font-weight: 600;
  color: #6e6e73; text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 14px;
}

.al-textarea {
  width: 100%; min-height: 220px;
  padding: 14px;
  border: 1px solid #d2d2d7;
  border-radius: var(--r-md);
  font: inherit; resize: vertical;
  background: #fafafa;
}
.al-textarea:focus { outline: none; border-color: var(--accent); background: #fff; }

.al-hint {
  font-size: 12px; color: #86868b;
  margin: 10px 0 14px;
  line-height: 1.6;
}
.al-hint code {
  background: #f0f0f2; padding: 1px 5px; border-radius: var(--r-sm);
  font-size: 11.5px; color: #424245;
}

.al-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px;
  border: none; border-radius: var(--r-md);
  font: inherit; font-weight: var(--fw-semibold); font-size: 13px;
  cursor: pointer;
  transition: background .15s, transform .12s, opacity .15s;
}
.al-btn:active { transform: scale(0.97); }
.al-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.al-btn--primary { background: var(--accent); color: #fff; }
.al-btn--primary:hover:not(:disabled) { background: var(--accent-hover); }
.al-btn--ghost { background: #f5f5f7; color: #1d1d1f; border: 1px solid #d2d2d7; }
.al-btn--ghost:hover:not(:disabled) { background: #ececef; }
.al-btn--danger { background: #fff; color: var(--danger); border: 1px solid #f4c2c7; }
.al-btn--danger:hover:not(:disabled) { background: #fef2f2; }

.al-spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid #d2d2d7; border-top-color: var(--accent);
  border-radius: 50%; animation: al-spin 0.8s linear infinite;
  vertical-align: middle; margin-right: 8px;
}
@keyframes al-spin { to { transform: rotate(360deg); } }

.al-status {
  font-size: 12.5px; color: #6e6e73; margin-top: 10px;
  min-height: 18px;
}
.al-status.error { color: var(--danger); }
.al-status.success { color: #28a745; }

.al-changes-empty {
  color: #86868b; font-size: 13px; text-align: center;
  padding: 40px 0;
}

.al-card {
  border: 1px solid #e5e5e7;
  border-radius: var(--r-lg);
  padding: 16px;
  margin-bottom: 14px;
  background: #fff;
}
.al-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 12px;
}
.al-card-head-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.al-badge {
  display: inline-block; padding: 2px 8px;
  border-radius: var(--r-sm); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.03em;
}
.al-badge--create { background: #e8f5e9; color: #1b5e20; }
.al-badge--update { background: #e3f2fd; color: #0d47a1; }
.al-badge--table { background: #f0f0f2; color: #424245; font-weight: var(--fw-semibold); text-transform: none; letter-spacing: 0; }
.al-conf {
  font-size: 11.5px; color: #6e6e73; font-variant-numeric: tabular-nums;
}
.al-conf--warn { color: #ad6800; background: #fff8e1; padding: 2px 6px; border-radius: var(--r-sm); }

.al-field {
  display: grid; grid-template-columns: 140px 1fr;
  gap: 10px; align-items: center;
  margin-bottom: 8px;
}
.al-field-label {
  font-size: 12px; color: #6e6e73;
  font-variant-numeric: tabular-nums;
}
.al-input, .al-select {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid #d2d2d7; border-radius: var(--r-sm);
  font: inherit; font-size: 13px;
  background: #fff;
}
.al-input:focus, .al-select:focus { outline: none; border-color: var(--accent); }
.al-input--code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; }

.al-reasoning {
  font-size: 11.5px; color: #86868b;
  margin-top: 10px; padding-top: 10px;
  border-top: 1px dashed #e5e5e7;
  line-height: 1.5;
}

.al-section {
  margin: 12px 0;
  padding: 12px 14px;
  background: #fafafa;
  border-radius: var(--r-md);
  border: 1px solid #ececef;
}
.al-section-title {
  font-size: 11.5px;
  font-weight: 600;
  color: #6e6e73;
  letter-spacing: 0.02em;
  margin-bottom: 10px;
}
.al-group-title {
  font-size: 14px;
  font-weight: 600;
  color: #1d1d1f;
  letter-spacing: -0.01em;
}
.al-group-code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  color: #6e6e73;
  font-weight: 400;
}
.al-mismatch {
  font-size: 11.5px;
  color: #ad6800;
  background: #fff8e1;
  padding: 4px 8px;
  border-radius: var(--r-sm);
  margin: -2px 0 8px 150px;
}
.al-empty {
  font-size: 12px;
  color: #86868b;
  padding: 4px 0;
}

.al-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid #e5e5e7;
}

.al-checkbox-row { display: flex; align-items: center; gap: 6px; }
.al-checkbox-row input[type="checkbox"] { width: 16px; height: 16px; }
