#mail-section .ks-editor {
  margin: 4px 0; padding: 0; min-width: 0; color: var(--text);
  container-type: inline-size;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  white-space: normal; font-size: 14px; line-height: 1.5;
}
.ks-editor [hidden] { display: none !important; }
.ks-footer, .ks-group, .ks-bottom, .ks-secondary { display: flex; align-items: center; gap: 8px; }
.ks-editor button { font: inherit; color: inherit; cursor: pointer; }
.ks-editor :is(button,select,summary,.ks-line):focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
#mail-section .ks-heading {
  display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 10px;
  width: 100%; min-height: 62px; padding: 10px 12px; border: 0;
  background: var(--surface); color: var(--text); text-align: left; border-radius: inherit;
}
.ks-heading:focus-visible { outline-offset: -3px; }
@media (hover: hover) { #mail-section .ks-heading:hover { background: var(--gray-100); } }
.ks-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--light-blue); color: var(--primary); }
.ks-mark svg { display: block; width: 19px; height: 19px; }
.ks-name { display: grid; min-width: 0; gap: 2px; }
.ks-name strong { font-size: 14px; font-weight: 700; }
#mail-section .ks-description { font-size: 12px; font-weight: 450; line-height: 1.4; color: var(--muted); overflow-wrap: anywhere; }
.ks-heading-action { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; color: var(--primary); white-space: nowrap; }
.ks-heading-action::after {
  content: ''; width: 5px; height: 5px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}
.ks-heading[aria-expanded=true] .ks-heading-action::after { transform: translateY(2px) rotate(225deg); }
.ks-panel { padding: 0 12px; }
.ks-editor :is(.ks-link,.ks-more,.ks-remove) { border: 0; background: transparent; padding: 4px 5px; color: var(--muted); min-height: 36px; }
.ks-panel .ks-help { flex-basis: 100%; margin: 0 0 8px; padding: 9px 11px; border-radius: 6px; background: var(--gray-100); color: var(--text); font-size: 13px; line-height: 1.55; }
.ks-editor .ks-section { margin: 0; border: 0; border-top: 1px solid var(--border); padding: 0; border-radius: 0; }
.ks-summary { display: grid; grid-template-columns: auto minmax(0,1fr) auto; padding: 8px 2px; min-height: 42px; box-sizing: border-box; cursor: pointer; list-style: none; }
.ks-summary::-webkit-details-marker { display: none; }
.ks-summary::after { content: ''; display: block; width: 6px; height: 6px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: translateY(-2px) rotate(45deg); }
.ks-section[open]>.ks-summary::after { transform: translateY(2px) rotate(225deg); }
.ks-summary strong { font-size: 13px; font-weight: 630; }
.ks-excerpt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; }
.ks-section[open]>.ks-summary .ks-excerpt { visibility: hidden; }
.ks-detail { padding: 0 0 10px; }
#mail-section .ks-editor .ks-group { display: flex; align-items: center; width: fit-content; color: var(--muted); margin-bottom: 7px; font-size: 12px; }
#mail-section .ks-editor .ks-group select { width: auto; min-width: 94px; max-width: 100%; height: auto; min-height: 32px; padding: 3px 6px; font: inherit; color: var(--text); background-color: var(--surface); border: 1px solid var(--border); border-radius: 5px; }
.ks-line { display: block; min-height: 40px; padding: 6px 8px; color: var(--text); background: var(--gray-100); border: 1px solid var(--border); border-radius: 6px; font-size: 14px; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; cursor: text; }
.ks-line:empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }
#mail-section .ks-editor .ks-chip { display: inline-block; vertical-align: baseline; max-width: 100%; min-height: 24px; padding: 1px 5px; margin: 1px 0; border: 1px solid transparent; border-radius: 4px; color: var(--primary); background: var(--light-blue); font-size: 12px; font-weight: 610; line-height: 1.4; }
.ks-editor .ks-chip:is(:hover,[aria-pressed=true]) { border-color: currentColor; }
.ks-footer { justify-content: space-between; margin-top: 5px; }
.ks-editor .ks-action, .ks-editor .ks-field-choice { padding: 4px 9px; min-height: 32px; border: 1px solid var(--border); border-radius: 6px; color: var(--text); background: var(--surface); font-size: 13px; }
.ks-editor button:disabled { opacity: .45; cursor: default; }
.ks-palette,.ks-insert-options { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; padding: 8px 0 0; }
.ks-editor .ks-field-choice { display: grid; text-align: left; }
.ks-field-choice small,.ks-sample { color: var(--muted); font-size: 12px; }
.ks-sample { flex-basis: 100%; }
.ks-bottom { flex-wrap: wrap; gap: 0 6px; justify-content: space-between; border-top: 1px solid var(--border); padding: 3px 0; }
.ks-secondary { gap: 2px; flex-wrap: wrap; }
.ks-secondary :is(.ks-link,.ks-remove) { font-size: 12px; color: var(--muted); }
.ks-bottom > .ks-link { color: var(--primary); font-size: 13px; }
.ks-insert-options { flex-basis: 100%; padding: 4px 0; }
@container (max-width: 275px) {
  #mail-section .ks-heading { grid-template-columns: minmax(0,1fr) auto; gap: 6px; }
  .ks-mark { display: none; }
}
@media(max-width:600px) {
  .ks-line { font-size: 16px; }
  .ks-summary { min-height: 44px; }
  #mail-section .ks-editor .ks-chip { min-height: 29px; }
  .ks-editor :is(.ks-more,.ks-link,.ks-action,.ks-field-choice) { min-height: 36px; }
}
