/* studio */

.studio {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 350px;
  gap: 14px;
  align-items: start;
}
.studio-col { min-width: 0; }
.studio-sticky { position: sticky; top: 16px; }

.studio-sec { padding: 16px 17px; }
.studio-sec + .studio-sec { margin-top: 12px; }
.studio-sec-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--title-font);
  font-size: 15px;
  letter-spacing: .03em;
  margin-bottom: 10px;
}
.studio-sec-title .small { font-family: var(--body-font); color: var(--muted); font-size: 10px; letter-spacing: .04em; }

.material-list { display: flex; flex-direction: column; gap: 9px; }
.material-item { display: flex; flex-direction: column; gap: 3px; }
.material-item .label { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 10px; }
.material-item .input, .material-item .textarea { font-size: 12px; padding: 6px 8px; }
.material-item .textarea { min-height: 52px; }

.studio-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper-2);
  margin-bottom: 10px;
}
.studio-toolbar .row { flex-wrap: wrap; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 12px; overflow-x: auto; }
.tab {
  border: 0;
  background: transparent;
  padding: 8px 11px;
  color: var(--muted);
  font-size: 12px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--red); }

.editor-card { border: 1px solid var(--line); border-radius: 9px; background: var(--paper-2); overflow: hidden; }
.editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(239, 231, 216, .45);
  font-size: 11px;
  color: var(--muted);
}
.editor-body { padding: 16px; }
.editor-body .textarea { min-height: 460px; background: #fffdf8; font-size: 13px; line-height: 1.95; }
.editor-body .textarea.tall { min-height: 560px; }

.title-input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  font-family: var(--title-font);
  font-size: 21px;
  line-height: 1.5;
  padding: 4px 0 9px;
  outline: none;
  letter-spacing: .02em;
}
.title-input:focus { border-bottom-color: var(--red); }

.card-editor-list { display: flex; flex-direction: column; gap: 9px; }
.card-editor {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fffdf8;
}
.card-editor .card-no {
  display: grid;
  place-items: center;
  background: var(--paper-3);
  border-radius: 5px;
  font-family: var(--title-font);
  font-size: 15px;
  color: var(--red);
  min-height: 60px;
}
.card-editor .card-fields { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.card-editor .card-fields input,
.card-editor .card-fields textarea {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  padding: 4px 5px;
  border-radius: 4px;
  outline: none;
  font-size: 12px;
}
.card-editor .card-fields input { font-weight: 600; border-bottom-color: var(--line); }
.card-editor .card-fields textarea { min-height: 54px; resize: vertical; color: var(--ink-2); line-height: 1.65; }
.card-editor .card-fields input:focus,
.card-editor .card-fields textarea:focus { background: var(--paper-3); border-color: var(--line); }

.copy-area {
  font-size: 12px;
  line-height: 1.8;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 12px;
  max-height: 260px;
  overflow-y: auto;
  white-space: pre-wrap;
}
.copy-area.mono { font-family: ui-monospace, Consolas, monospace; font-size: 11px; }

.kv-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 11px; }
.kv-line:last-child { border-bottom: 0; }
.kv-line .k { color: var(--muted); }
.kv-line .v { color: var(--ink-2); text-align: right; }

.compliance-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.4);
}
.compliance-badge .score { font-family: var(--title-font); font-size: 21px; margin-left: auto; }
.compliance-badge.red { border-color: #e7c4ba; background: var(--red-soft); color: var(--danger); }
.compliance-badge.high { border-color: #e4d2b3; background: var(--amber-soft); color: var(--amber); }
.compliance-badge.warn { border-color: #c9dbe4; background: var(--blue-soft); color: var(--blue); }
.compliance-badge.safe { border-color: #c8dbce; background: var(--green-soft); color: var(--green); }

.mini-findings { display: flex; flex-direction: column; gap: 5px; max-height: 210px; overflow-y: auto; }
.mini-finding { display: flex; align-items: flex-start; gap: 6px; font-size: 11px; color: var(--ink-2); line-height: 1.6; }
.mini-finding .fdot { width: 5px; height: 5px; border-radius: 50%; margin-top: 6px; flex: 0 0 5px; background: var(--muted); }
.mini-finding.red .fdot { background: var(--danger); }
.mini-finding.high .fdot { background: var(--amber); }
.mini-finding.warn .fdot { background: var(--blue); }
.mini-finding.info .fdot { background: var(--green); }

.title-list { display: flex; flex-direction: column; gap: 4px; }
.title-option {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 6px 7px;
  background: transparent;
  font-size: 12px;
  line-height: 1.6;
}
.title-option:hover { background: rgba(255,255,255,.5); border-color: var(--line); }
.title-option.active { background: var(--paper-3); border-color: var(--line-strong); }
.title-option .ttype { flex: 0 0 auto; font-size: 9px; color: var(--muted); border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; margin-top: 2px; }
.title-option .ttext { min-width: 0; }

.tag-list { display: flex; flex-wrap: wrap; gap: 5px; }
.tag-item {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 11px;
  color: var(--muted);
  background: rgba(255,255,255,.35);
}

.cover-mini {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--paper-3);
  display: flex;
  justify-content: center;
}
.cover-mini canvas { width: 100%; max-width: 260px; height: auto; border-radius: 3px; box-shadow: 0 8px 22px rgba(24,22,19,.14); }

.cover-fields { display: flex; flex-direction: column; gap: 7px; }

.ai-status { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.ai-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted-2); }
.ai-dot.on { background: var(--green); box-shadow: 0 0 0 3px rgba(63,107,82,.14); }

.toast-inline { font-size: 11px; color: var(--green); }

@media (max-width: 1280px) {
  .studio { grid-template-columns: 270px minmax(0, 1fr) 310px; }
}
@media (max-width: 1080px) {
  .studio { grid-template-columns: 1fr; }
  .studio-sticky { position: static; }
  .editor-body .textarea { min-height: 360px; }
}
