:root {
  --ima-soft: #eef5f1;
  --ima-line: #d5e4dc;
  --ima-strong: #245b45;
}

.v215-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  margin-bottom: 16px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(135deg, #f7faf8 0%, #edf4f0 100%);
}
.v215-kicker { color: var(--ima-strong); font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.v215-hero h3 { margin: 8px 0 6px; font-size: clamp(22px, 2.8vw, 32px); line-height: 1.2; }
.v215-hero p { margin: 0; color: var(--muted); line-height: 1.65; }

.v215-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.v215-stats > div { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.v215-stats span { display: block; color: var(--muted); font-size: 12px; }
.v215-stats b { display: block; margin-top: 8px; font-size: 20px; color: var(--text); }

.v215-settings, .v215-queue-panel, .v215-search { margin-bottom: 16px; }
.v215-message { margin: 12px 0 16px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: #f8faf9; color: var(--muted); line-height: 1.5; }
.v215-message.success { border-color: var(--ima-line); background: var(--ima-soft); color: var(--ima-strong); }
.v215-message.error { border-color: #edd6d5; background: #fcf4f3; color: #8c3834; }
.v215-message.loading { color: var(--text); }
.v215-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: end; }
.v215-folder-field { grid-column: 1 / -1; }
.v215-folder-button { width: 100%; min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); text-align: left; cursor: pointer; }
.v215-folder-button:hover { border-color: #9eb9ab; background: #fafcfb; }
.v215-folder-button span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v215-folder-button small { flex: 0 0 auto; color: var(--ima-strong); font-weight: 650; }
.v215-check { display: flex; gap: 9px; align-items: flex-start; min-height: 42px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fafcfb; color: var(--text); line-height: 1.45; cursor: pointer; }
.v215-check input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--ima-strong); }

.v215-queue-list { display: grid; gap: 10px; margin-top: 14px; }
.v215-queue-filter { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: #f4f6f5; }
.v215-queue-filter button { min-height: 32px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-weight: 650; cursor: pointer; white-space: nowrap; }
.v215-queue-filter button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(28, 57, 44, .08); }
.v215-queue-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.v215-queue-item.failed { border-color: #edd6d5; }
.v215-queue-item.synced { background: #fafcfb; }
.v215-queue-check input { width: 17px; height: 17px; accent-color: var(--ima-strong); }
.v215-queue-title { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.v215-queue-title b { min-width: min(360px, 100%); overflow-wrap: anywhere; }
.v215-queue-title > span:not(.v215-status) { color: var(--muted); font-size: 12px; }
.v215-status, .v215-source-sync { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 8px; background: #f1f3f2; color: var(--muted); font-size: 11px; font-weight: 650; }
.v215-status.synced, .v215-source-sync.synced { background: var(--ima-soft); color: var(--ima-strong); }
.v215-status.failed, .v215-source-sync.failed { background: #fcf0ef; color: #8c3834; }
.v215-status.syncing, .v215-source-sync.syncing { background: #f4f1e8; color: #715b20; }
.v215-queue-main p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.v215-queue-actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.v215-empty { display: grid; gap: 6px; padding: 28px 18px; border: 1px dashed var(--line); border-radius: 12px; text-align: center; color: var(--muted); }
.v215-empty b { color: var(--text); }
.v215-empty.error b { color: #8c3834; }

.v215-search > summary { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; cursor: pointer; list-style: none; }
.v215-search > summary::-webkit-details-marker { display: none; }
.v215-search > summary span:first-child { display: grid; gap: 4px; }
.v215-search > summary small { color: var(--muted); font-weight: 400; }
.v215-search-body { padding: 0 20px 20px; border-top: 1px solid var(--line); }
.v215-search-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.v215-search-results { display: grid; gap: 10px; margin-top: 14px; }
.v215-search-results article { padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fafcfb; }
.v215-search-results article p { margin: 6px 0; color: var(--muted); line-height: 1.55; }
.v215-search-results article span { color: var(--muted); font-size: 12px; }

.v215-sync-modal { width: min(860px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); overflow: auto; }
.v215-target-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.v215-helper { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
#imaSyncContent { min-height: 280px; white-space: pre-wrap; }

.v215-preview-tabs { display: flex; gap: 4px; margin: 16px 0 10px; padding: 4px; width: fit-content; border: 1px solid var(--line); border-radius: 10px; background: #f4f6f5; }
.v215-preview-tabs button { min-height: 34px; padding: 0 13px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-weight: 650; cursor: pointer; }
.v215-preview-tabs button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(28, 57, 44, .08); }
.v215-readable-preview { min-height: 250px; max-height: 44vh; overflow: auto; padding: 20px 22px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfb; color: var(--text); line-height: 1.75; }
.v215-readable-preview h2 { margin: 0 0 14px; font-size: 22px; line-height: 1.35; }
.v215-readable-preview h3 { margin: 22px 0 8px; font-size: 15px; }
.v215-readable-preview p { margin: 0 0 10px; overflow-wrap: anywhere; }
.v215-readable-preview blockquote { margin: 0 0 18px; padding: 11px 14px; border-left: 3px solid var(--ima-strong); background: var(--ima-soft); color: #294b3d; }
.v215-readable-preview ul { margin: 6px 0 14px; padding-left: 20px; }
.v215-readable-preview hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }

.v215-folder-modal { width: min(680px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); overflow: auto; }
.v215-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; min-height: 42px; margin: 8px 0 10px; padding: 9px 11px; border-radius: 9px; background: #f4f6f5; }
.v215-breadcrumb button { border: 0; background: transparent; color: var(--ima-strong); font-weight: 650; cursor: pointer; }
.v215-breadcrumb span { color: var(--muted); }
.v215-folder-toolbar { display: flex; gap: 8px; margin-bottom: 8px; }
.v215-folder-search { display: flex; gap: 6px; min-width: 260px; margin-left: auto; }
.v215-folder-search input { min-width: 0; height: 38px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--text); }
.v215-folder-status { margin: 0 0 10px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.v215-folder-list { display: grid; gap: 8px; min-height: 180px; max-height: 42vh; overflow: auto; }
.v215-folder-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; width: 100%; padding: 12px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); text-align: left; cursor: pointer; }
.v215-folder-row:hover { border-color: #9eb9ab; background: #fafcfb; }
.v215-folder-row span:first-child { display: grid; gap: 4px; }
.v215-folder-row small, .v215-folder-row > span:last-child { color: var(--muted); }
.v215-folder-current { display: grid; gap: 4px; margin: 14px 0; padding: 11px 13px; border: 1px solid var(--ima-line); border-radius: 10px; background: var(--ima-soft); }
.v215-folder-current span { color: var(--muted); font-size: 12px; }

.v215-compact-home > .hero { min-height: 0; padding: 18px 22px; margin-bottom: 12px; }
.v215-compact-home > .hero h2 { max-width: none; margin: 5px 0; font-size: clamp(20px, 2.4vw, 28px); }
.v215-compact-home > .hero p, .v215-compact-home > .hero .tag { display: none; }
.v215-compact-home > .v212-cycle { margin-top: 0; }
.v215-compact-home > .assistant-home, .v215-compact-home > #v212Quick { margin-top: 12px; }
.v215-home-more { margin-top: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.v215-home-more > summary { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; list-style: none; cursor: pointer; }
.v215-home-more > summary::-webkit-details-marker { display: none; }
.v215-home-more > summary span:first-child { display: grid; gap: 3px; }
.v215-home-more > summary small { color: var(--muted); font-weight: 400; }
.v215-summary-action { color: var(--ima-strong); font-size: 13px; font-weight: 650; }
.v215-home-more-body { padding: 0 14px 14px; border-top: 1px solid var(--line); }
.v215-home-more-body > .dashboard, .v215-home-more-body > .grid { margin-top: 14px; }

@media (max-width: 900px) {
  .v215-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v215-queue-item { grid-template-columns: auto minmax(0, 1fr); }
  .v215-queue-actions { grid-column: 2; justify-content: flex-start; }
}
@media (max-width: 720px) {
  .v215-hero, .v215-settings-grid, .v215-target-grid { grid-template-columns: 1fr; }
  .v215-hero { align-items: start; padding: 20px; }
  .v215-hero .btn { width: 100%; }
  .v215-stats { grid-template-columns: 1fr 1fr; }
  .v215-queue-item { grid-template-columns: auto minmax(0, 1fr); align-items: start; }
  .v215-queue-actions { grid-column: 1 / -1; }
  .v215-queue-actions .btn { flex: 1 1 calc(50% - 6px); }
  .v215-search-line { grid-template-columns: 1fr; }
  .v215-readable-preview { max-height: 38vh; padding: 16px; }
  .v215-folder-toolbar { flex-wrap: wrap; }
  .v215-folder-search { flex: 1 0 100%; min-width: 0; margin-left: 0; }
  .v215-folder-search input { flex: 1; }
  .v215-home-more > summary { align-items: flex-start; gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  #ima *, #imaSyncModal * { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
