/* 04 card list forms */
/* Cards list */
#cardsView {
  flex-direction: column;
  overflow: hidden;
}
#cardsHeader {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
#cardsHeader span {
  font-size: 12px;
  color: var(--muted);
  margin-right: auto;
}
#cardsList {
  flex: 1;
  overflow-y: auto;
}
.ci {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
  cursor: grab;
  position: relative;
  background: transparent;
  font-family: Arial, sans-serif;
  font-size: 15px;
}
.ci:active {
  cursor: grabbing;
}
.ci.dragging {
  opacity: .4;
  background: var(--acc-petal);
}
.ci.drag-over {
  border-top: 2px solid var(--acc1-d);
  background: color-mix(in srgb, var(--acc-petal) 60%, transparent);
}
.ci:hover {
  background: var(--acc-petal);
}
.ci-handle {
  color: var(--acc-border);
  font-size: 14px;
  cursor: grab;
  flex-shrink: 0;
  padding: 2px 4px;
  border-radius: 0;
  transition: color .15s;
  user-select: none;
}
.ci:hover .ci-handle {
  color: var(--muted);
}
.ci-num {
  font-size: 11px;
  color: var(--muted);
  width: 20px;
  text-align: right;
  flex-shrink: 0;
  font-family: Arial, sans-serif;
}
.ci-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ci-tag {
  font-size: 11px;
  color: var(--acc2-d);
  flex-shrink: 0;
  font-family: Arial, sans-serif;
}
.ci-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.ci-actions button {
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 0;
}
/* Forms, edit, import, export, modal */
#editView,
#deckEditView,
#importView {
  flex-direction: column;
  overflow: hidden;
}
#editHeader,
#deckEditHeader,
#importHeader {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
#editHeader h2,
#deckEditHeader h2,
#importHeader h2 {
  font-family: Arial, sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--plum);
  margin-right: auto;
}
#importHeader h2 {
  font-size: 18px;
}
#editBody,
#importBody {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 700px;
  width: 100%;
  margin: 0 auto;
}
#importBody {
  gap: 12px;
  max-width: 820px;
}
#deckEditBody {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
}
.field label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 5px;
  font-weight: 500;
}
.field textarea,
.field input[type=text],
#latexInput,
#exportTextarea,
select,
#scheduleView input[type=date],
#scheduleView input[type=time],
#scheduleView input[type=text],
#scheduleView select {
  font-family: Arial, sans-serif;
  font-size: 13px;
  width: 100%;
  border: 1.5px solid var(--acc-border);
  border-radius: 0;
  padding: 9px 12px;
  resize: vertical;
  line-height: 1.7;
  color: var(--text);
  background: var(--white);
  transition: border-color .2s, background .2s;
}
.field textarea:focus,
.field input:focus,
#latexInput:focus,
#exportTextarea:focus,
select:focus,
#scheduleView input:focus,
#scheduleView select:focus {
  outline: none;
  border-color: var(--acc1);
}
.field textarea {
  min-height: 75px;
}
.preview-box {
  border: 1.5px dashed var(--acc-border);
  border-radius: 0;
  padding: 10px 14px;
  min-height: 32px;
  font-size: 14px;
  line-height: 1.9;
  background: var(--acc-petal);
  overflow-x: auto;
  white-space: pre-wrap;
  text-align: left;
}
.hint-row,
#importBody p,
#exportBox .exp-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
}
.hint-row code,
#importBody code,
#exportBox .exp-desc code,
code {
  background: var(--acc-petal);
  padding: 1px 5px;
  border-radius: 0;
  color: var(--acc1-d);
}
.edit-footer,
#deckEditFooter {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.rich-wrap {
  border: 1.5px solid var(--acc-border);
  border-radius: 0;
  overflow: hidden;
  background: var(--white);
  transition: border-color .2s;
}
.rich-wrap:focus-within {
  border-color: var(--acc1);
}
.rich-toolbar {
  display: flex;
  gap: 4px;
  padding: 5px 8px;
  border-bottom: 1px solid var(--border);
  background: var(--cream);
  flex-wrap: wrap;
}
.fmt-btn {
  font-family: Arial, sans-serif;
  font-size: 11px;
  padding: 3px 9px;
  line-height: 1.5;
}
.fmt-btn.fmt-bold {
  font-weight: 700;
}
.fmt-btn.fmt-hl {
  background: #fff3b0 !important;
  border-color: #e6c800 !important;
  color: #7a6500 !important;
}
.fmt-btn.fmt-hl:hover {
  background: #ffe066 !important;
  border-color: #c8aa00 !important;
}
.fmt-btn.fmt-rose {
  background: var(--acc-petal) !important;
  border-color: var(--acc1) !important;
  color: var(--acc1-d) !important;
}
.fmt-btn.fmt-underline {
  text-decoration: underline;
  color: var(--acc1-d) !important;
  border-color: var(--acc1) !important;
}
.fmt-btn.fmt-clear {
  color: var(--muted);
}
.rich-editor {
  font-family: Arial, sans-serif;
  font-size: 13px;
  padding: 9px 12px;
  min-height: 75px;
  line-height: 1.7;
  color: var(--text);
  outline: none;
  word-break: break-word;
  white-space: pre-wrap;
  text-align: left;
}
.rich-editor.tall {
  min-height: 95px;
}
.rich-editor strong,
.rich-editor b,
.face-body strong,
.face-body b {
  font-weight: 700;
  color: var(--plum);
}
.rich-editor:empty:before {
  content: attr(data-placeholder);
  color: var(--muted);
  pointer-events: none;
}
#parsePreview {
  border: 1.5px solid var(--acc-border);
  border-radius: 0;
  max-height: 240px;
  overflow-y: auto;
  display: none;
  background: var(--white);
}
.parse-item {
  padding: 7px 12px;
  border-bottom: 1px solid var(--acc-border);
  font-size: 12px;
}
.parse-item:last-child {
  border-bottom: none;
}
.parse-item .pf {
  font-weight: 600;
  color: var(--plum);
}
.parse-item .pb {
  color: var(--muted);
  margin-top: 2px;
}
#importActions {
  display: none;
  gap: 8px;
  flex-wrap: wrap;
}
#exportModal,
#modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.25);
  backdrop-filter: blur(4px);
  z-index: 999;
  align-items: center;
  justify-content: center;
}
#exportModal.show,
#modal.show {
  display: flex;
}
#exportBox,
#modalBox {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 0;
  padding: 22px;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
}
#exportBox {
  max-width: 660px;
  width: 95%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}
#modalBox {
  max-width: 340px;
  width: 90%;
  padding: 24px;
}
#exportBox h3,
#modalBox h3 {
  font-family: Arial, sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--plum);
  margin-bottom: 6px;
}
#modalBox p {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
  line-height: 1.6;
}
#modalBox .mbtns,
#exportBox .exp-footer {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
