/* ==========================================================================
   Nyhetsklipp Dashboard — Custom styles
   Builds on top of Punkt CSS. Uses Punkt design tokens wherever possible.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Hide Punkt CDN developer panel (injected by CDN scripts into pkt-icon)
   -------------------------------------------------------------------------- */
#page-container {
  display: none !important;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
body {
  overflow-x: hidden;
}

/* --------------------------------------------------------------------------
   Header — larger service name
   -------------------------------------------------------------------------- */
.pkt-header-service__service-name {
  font-size: 1.75rem;
  line-height: 2.5rem;
}

/* --------------------------------------------------------------------------
   Tab link styling — remove default anchor underline
   -------------------------------------------------------------------------- */
.pkt-tabs__link {
  text-decoration: none;
}

.pkt-tabs__link:hover {
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   Main content area
   -------------------------------------------------------------------------- */
.dashboard-main {
  min-height: calc(100vh - 10rem);
  background-color: var(--pkt-color-background-subtle, #F9F9F9);
  display: flex;
  flex-direction: column;
}

.dashboard-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem 0.75rem;
  background-color: var(--pkt-color-background-default, #fff);
  border-bottom: 1px solid var(--pkt-color-border-gray, #CCCCCC);
}

.dashboard-content {
  padding: 1.5rem 2rem 2rem;
  flex: 1;
}

/* --------------------------------------------------------------------------
   Alert area
   -------------------------------------------------------------------------- */
.dashboard-alerts {
  padding: 1rem 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pkt-alert__action {
  margin-left: auto;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Status cards (overview page)
   -------------------------------------------------------------------------- */
.status-card {
  background-color: var(--pkt-color-background-card, #fff);
  border: 1px solid var(--pkt-color-border-gray, #CCCCCC);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.status-card__icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.25rem;
}

.status-card__icon--blue {
  background-color: var(--pkt-color-surface-subtle-light-blue, #E5FCFF);
}

.status-card__icon--blue pkt-icon {
  --fg-color: var(--pkt-color-brand-warm-blue-1000, #1F42AA);
}

.status-card__icon--green {
  background-color: var(--pkt-color-surface-default-faded-green, #E5FFE6);
}

.status-card__icon--green pkt-icon {
  --fg-color: var(--pkt-color-brand-dark-green-1000, #034B45);
}

.status-card__icon--yellow {
  background-color: var(--pkt-color-surface-default-yellow, #FFE7BC);
}

.status-card__icon--yellow pkt-icon {
  --fg-color: var(--pkt-color-brand-dark-blue-1000, #2A2859);
}

.status-card__icon--red {
  background-color: var(--pkt-color-surface-subtle-light-red, #FFF2F1);
}

.status-card__icon--red pkt-icon {
  --fg-color: var(--pkt-color-brand-red-1000, #FF8274);
}

.status-card__label {
  color: var(--pkt-color-text-body-default, #2A2859);
  opacity: 0.7;
}

.status-card__value {
  color: var(--pkt-color-text-body-default, #2A2859);
}

.status-card__detail {
  color: var(--pkt-color-text-placeholder, #666666);
}

/* --------------------------------------------------------------------------
   Modal overlay (custom confirmation dialog)
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(42, 40, 89, 0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-dialog {
  background-color: var(--pkt-color-background-default, #fff);
  border: 1px solid var(--pkt-color-border-gray, #CCCCCC);
  padding: 2rem;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

/* --------------------------------------------------------------------------
   Keyword tags (list page)
   -------------------------------------------------------------------------- */
.keyword-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

/* --------------------------------------------------------------------------
   Expression preview (code snippet in table)
   -------------------------------------------------------------------------- */
.expression-preview {
  font-family: monospace;
  font-size: 0.8125rem;
  background-color: var(--pkt-color-surface-subtle-default, #F5F5F5);
  padding: 0.125rem 0.375rem;
  color: var(--pkt-color-text-body-default, #2A2859);
  word-break: break-all;
}


/* --------------------------------------------------------------------------
   Rule builder — row-based rule rows
   -------------------------------------------------------------------------- */
.rule-rows-container {
  display: flex;
  flex-direction: column;
}

.rule-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--pkt-color-border-gray, #CCCCCC);
  padding: 0.5rem;
  background-color: var(--pkt-color-background-default, #fff);
}

.rule-row + .rule-row__separator + .rule-row {
  border-top: 1px solid var(--pkt-color-border-gray, #CCCCCC);
}

.rule-row__tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  flex: 1;
  min-height: 32px;
  cursor: text;
}

.rule-row__input {
  border: none;
  outline: none;
  flex: 1;
  min-width: 120px;
  font-size: 0.9375rem;
  font-family: inherit;
  padding: 0.25rem 0;
  background: transparent;
  color: var(--pkt-color-text-body-default, #2A2859);
}

.rule-row__input::placeholder {
  color: var(--pkt-color-text-placeholder, #666666);
}

.rule-row__delete {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rule-row__delete pkt-icon {
  --fg-color: var(--pkt-color-text-placeholder, #666666);
}

.rule-row__delete:hover pkt-icon {
  --fg-color: var(--pkt-color-brand-red-1000, #FF8274);
}

.rule-row__delete[hidden] {
  display: none;
}

.rule-row__separator {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--pkt-color-text-placeholder, #666666);
  padding: 0.25rem 0;
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rule-row__separator::before,
.rule-row__separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background-color: var(--pkt-color-border-gray, #CCCCCC);
}


/* --------------------------------------------------------------------------
   Rule builder — exclude tags (red skin override)
   -------------------------------------------------------------------------- */
#exclude-tags pkt-tag[skin="red"] {
  --pkt-tag-bg: var(--pkt-color-surface-subtle-light-red, #FFF2F1);
  --pkt-tag-color: var(--pkt-color-brand-red-1000, #FF8274);
}

/* --------------------------------------------------------------------------
   Rule builder — expression preview box
   -------------------------------------------------------------------------- */
.expression-preview-box {
  font-family: monospace;
  font-size: 0.8125rem;
  background-color: var(--pkt-color-surface-subtle-default, #F5F5F5);
  padding: 0.625rem 0.75rem;
  color: var(--pkt-color-text-body-default, #2A2859);
  border: 1px solid var(--pkt-color-border-gray, #CCCCCC);
  min-height: 2rem;
  word-break: break-all;
  line-height: 1.5;
}

.expression-preview-placeholder {
  color: var(--pkt-color-text-placeholder, #666666);
  font-family: inherit;
  font-style: italic;
}

/* --------------------------------------------------------------------------
   Rule builder — mode toggle button
   -------------------------------------------------------------------------- */
.mode-toggle-btn {
  background: none;
  border: none;
  padding: 0;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--pkt-color-brand-warm-blue-1000, #1F42AA);
  cursor: pointer;
  text-decoration: underline;
}

.mode-toggle-btn:hover {
  color: var(--pkt-color-brand-dark-blue-1000, #2A2859);
}

/* --------------------------------------------------------------------------
   Rule builder — advanced textarea
   -------------------------------------------------------------------------- */
.advanced-textarea {
  width: 100%;
  font-size: 0.875rem;
  font-family: monospace;
  color: var(--pkt-color-text-body-default, #2A2859);
  border: 1px solid var(--pkt-color-border-gray, #CCCCCC);
  padding: 0.625rem 0.75rem;
  box-sizing: border-box;
  resize: vertical;
  background-color: var(--pkt-color-background-default, #fff);
}

.advanced-textarea:focus {
  outline: none;
  border-color: var(--pkt-color-brand-warm-blue-1000, #1F42AA);
  box-shadow: 0 0 0 1px var(--pkt-color-brand-warm-blue-1000, #1F42AA);
}

/* --------------------------------------------------------------------------
   Keyword tag input (editable, on form page)
   -------------------------------------------------------------------------- */
.keyword-input-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  border: 1px solid var(--pkt-color-border-gray, #CCCCCC);
  padding: 0.5rem;
  min-height: 44px;
  background-color: var(--pkt-color-background-default, #fff);
  cursor: text;
}

.keyword-input-container:focus-within {
  border-color: var(--pkt-color-brand-warm-blue-1000, #1F42AA);
  box-shadow: 0 0 0 1px var(--pkt-color-brand-warm-blue-1000, #1F42AA);
}

.keyword-tags-editable {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.keyword-text-input {
  border: none;
  outline: none;
  flex: 1;
  min-width: 120px;
  font-size: 0.9375rem;
  font-family: inherit;
  padding: 0.25rem 0;
  background: transparent;
  color: var(--pkt-color-text-body-default, #2A2859);
}

.keyword-text-input::placeholder {
  color: var(--pkt-color-text-placeholder, #666666);
}

/* --------------------------------------------------------------------------
   Inline inputs (for inline editing in tables, e.g. sources)
   -------------------------------------------------------------------------- */
.inline-input {
  border: 1px solid var(--pkt-color-border-gray, #CCCCCC);
  padding: 0.375rem 0.5rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--pkt-color-text-body-default, #2A2859);
  background-color: var(--pkt-color-background-default, #fff);
  width: 100%;
  box-sizing: border-box;
}

.inline-input:focus {
  outline: none;
  border-color: var(--pkt-color-brand-warm-blue-1000, #1F42AA);
  box-shadow: 0 0 0 1px var(--pkt-color-brand-warm-blue-1000, #1F42AA);
}

.inline-input::placeholder {
  color: var(--pkt-color-text-placeholder, #666666);
}

/* --------------------------------------------------------------------------
   Checkbox grid (for multi-select, e.g. keyword groups in form)
   -------------------------------------------------------------------------- */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.5rem;
}

/* --------------------------------------------------------------------------
   RSS discovery bar
   -------------------------------------------------------------------------- */
.rss-discovery-bar {
  display: flex;
  gap: 0.5rem;
}

.rss-results-box {
  margin: 0.5rem 0 1rem;
  padding: 0.75rem;
  border: 1px solid var(--pkt-color-border-gray, #CCCCCC);
  background-color: var(--pkt-color-surface-subtle-default, #F5F5F5);
}

.rss-result-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.375rem;
}


/* --------------------------------------------------------------------------
   Fix Punkt form inputs — stretch to fill grid cells
   -------------------------------------------------------------------------- */
.dashboard-content .pkt-input,
.dashboard-content .pkt-input__container {
  width: 100% !important;
}

/* --------------------------------------------------------------------------
   Sources table — vertical centering
   -------------------------------------------------------------------------- */
#sources-table td {
  vertical-align: middle;
}

/* --------------------------------------------------------------------------
   Media group multi-select dropdown (replaces pkt-combobox in sources table)
   -------------------------------------------------------------------------- */
.mg-dropdown {
  position: relative;
}

.mg-dropdown__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  min-height: 36px;
  padding: 0.375rem 0.5rem;
  border: 1px solid var(--pkt-color-input-border-normal, #2A2859);
  background: var(--pkt-color-input-background-normal, #FFFFFF);
  color: var(--pkt-color-input-text-normal, #2A2859);
  font-size: 0.875rem;
  font-family: inherit;
  cursor: pointer;
  box-sizing: border-box;
  text-align: left;
  line-height: 1.3;
}

.mg-dropdown__trigger:hover {
  border-color: var(--pkt-color-input-border-hover, #1F42AA);
}

.mg-dropdown__trigger:focus {
  outline: none;
  border-color: var(--pkt-color-input-border-active, #1F42AA);
  box-shadow: 0 0 0 1px var(--pkt-color-input-border-active, #1F42AA);
}

.mg-dropdown__trigger--placeholder {
  color: var(--pkt-color-text-placeholder, #666666);
}

.mg-dropdown__arrow {
  flex-shrink: 0;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.6;
}

.mg-dropdown__panel {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 20;
  background: var(--pkt-color-background-default, #FFFFFF);
  border: 1px solid var(--pkt-color-border-gray, #CCCCCC);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  max-height: 240px;
  overflow-y: auto;
  margin-top: -1px;
}

.mg-dropdown__panel--open {
  display: block;
}

.mg-dropdown__option {
  padding: 0.25rem 0.5rem;
  border-bottom: 1px solid var(--pkt-color-surface-default-gray, #F9F9F9);
}

.mg-dropdown__option:last-child {
  border-bottom: none;
}

.mg-dropdown__option pkt-checkbox {
  --pkt-checkbox-font-size: 0.8125rem;
}

/* --------------------------------------------------------------------------
   Fix icon color inside primary buttons (dark bg needs white icons)
   -------------------------------------------------------------------------- */
pkt-button[skin="primary"]::part(icon),
pkt-button[skin="primary"] pkt-icon {
  --fg-color: #fff;
}

/* --------------------------------------------------------------------------
   Responsive adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 48rem) {
  .dashboard-topbar {
    padding: 1rem 1rem 0.5rem;
  }

  .dashboard-content {
    padding: 1rem;
  }
}

/* --------------------------------------------------------------------------
   Article edit cards (drafts edit page)
   -------------------------------------------------------------------------- */
.article-edit-card {
  background-color: var(--pkt-color-background-default, #fff);
  border: 1px solid var(--pkt-color-border-gray, #CCCCCC);
  padding: 1.25rem;
}

.article-edit-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.article-edit-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background-color: var(--pkt-color-brand-warm-blue-1000, #1F42AA);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 0;
  flex-shrink: 0;
}

.article-removed-card {
  background-color: var(--pkt-color-surface-subtle-default, #F5F5F5);
  border: 1px solid var(--pkt-color-border-gray, #CCCCCC);
  padding: 0.75rem 1rem;
}

/* ==========================================================================
   Editor — Interactive email editor (overview page)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Email-matching styles (mirrors email_styles.py for WYSIWYG parity)
   -------------------------------------------------------------------------- */
.editor-email-wrapper .profile-section {
  margin-top: 32px;
}

.editor-email-wrapper .profile-header {
  color: #2A2859;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-left: 4px solid transparent;
}

.editor-email-wrapper .articles-container {
  border: 1px solid #E6E6E6;
  border-top: none;
}

.editor-email-wrapper .article-item {
  padding: 20px 24px;
  border-bottom: 1px solid #E6E6E6;
}

.editor-email-wrapper .article-item:last-child {
  border-bottom: none;
}

.editor-email-wrapper .article-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1F42AA;
  color: #FFFFFF;
  border-radius: 0;
  width: 24px;
  height: 24px;
  font-size: 12px;
  font-weight: 500;
  margin-right: 10px;
  vertical-align: middle;
  flex-shrink: 0;
}

.editor-email-wrapper .article-title {
  font-weight: 500;
  font-size: 16px;
  line-height: 1.4;
  color: #1F42AA;
  text-decoration: none;
}

.editor-email-wrapper .article-title:hover {
  text-decoration: underline;
}

.editor-email-wrapper .article-meta {
  font-size: 14px;
  font-weight: 300;
  color: #666666;
  margin: 8px 0 12px 34px;
}

.editor-email-wrapper .article-action {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: #1F42AA;
  text-decoration: none;
  margin: -4px 0 12px 34px;
}

.editor-email-wrapper .article-action:hover {
  text-decoration: underline;
}

.editor-email-wrapper .article-action .action-arrow {
  font-size: 11px;
  margin-left: 2px;
}

.editor-email-wrapper .article-summary {
  font-size: 16px;
  font-weight: 300;
  color: #2A2859;
  line-height: 1.5;
  margin-left: 34px;
}

.editor-email-wrapper .article-summary p {
  margin: 0 0 8px 0;
}

.editor-email-wrapper .article-summary p:last-child {
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Info bar (compact stats above the editor)
   -------------------------------------------------------------------------- */
.editor-info-bar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem 1.25rem;
  background-color: var(--pkt-color-background-default, #fff);
  border: 1px solid var(--pkt-color-border-gray, #CCCCCC);
  font-size: 0.875rem;
  color: var(--pkt-color-text-body-default, #2A2859);
  margin-bottom: 1.5rem;
}

.editor-info-bar__item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.editor-info-bar__item pkt-icon {
  --fg-color: var(--pkt-color-text-placeholder, #666666);
}

/* Subject field */
.editor-subject-row {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.editor-subject-row .pkt-inputwrapper {
  flex: 1;
}

/* Email wrapper (mimics .wrapper from email CSS) */
.editor-email-wrapper {
  max-width: 700px;
  margin: 0 auto;
  background: #FFFFFF;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* --------------------------------------------------------------------------
   Hover edit button on articles
   -------------------------------------------------------------------------- */
.editor-article-wrap {
  position: relative;
}

.editor-hover-edit {
  position: absolute;
  top: 12px;
  right: 12px;
  display: none;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  background: var(--pkt-color-background-default, #fff);
  border: 1px solid var(--pkt-color-border-gray, #CCCCCC);
  border-radius: 0;
  cursor: pointer;
  font-size: 0.8125rem;
  font-family: inherit;
  color: var(--pkt-color-text-body-default, #2A2859);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  z-index: 2;
}

.editor-hover-edit pkt-icon {
  --fg-color: var(--pkt-color-text-body-default, #2A2859);
}

.editor-article-wrap:hover .editor-hover-edit {
  display: flex;
}

.editor-hover-delete {
  bottom: 12px;
  top: auto;
}

/* --------------------------------------------------------------------------
   Hover edit button on section headers
   -------------------------------------------------------------------------- */
.editor-section-wrap {
  position: relative;
}

.editor-section-header-wrap {
  position: relative;
}

.editor-section-hover-edit {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  display: none;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--pkt-color-border-gray, #CCCCCC);
  border-radius: 0;
  cursor: pointer;
  font-size: 0.8125rem;
  font-family: inherit;
  color: var(--pkt-color-text-body-default, #2A2859);
  z-index: 2;
}

.editor-section-header-wrap:hover .editor-section-hover-edit {
  display: flex;
}

/* --------------------------------------------------------------------------
   Drag handle (left side of articles)
   -------------------------------------------------------------------------- */
.editor-drag-handle {
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  cursor: grab;
  font-size: 1.25rem;
  color: var(--pkt-color-text-placeholder, #666666);
  user-select: none;
  transition: opacity 0.15s;
  z-index: 2;
  padding: 4px;
  line-height: 1;
}

.editor-article-wrap:hover .editor-drag-handle {
  opacity: 0.5;
}

.editor-drag-handle:hover {
  opacity: 1 !important;
}

/* --------------------------------------------------------------------------
   Insert article zone (between articles)
   Show "+" when hovering the article above OR the zone itself
   -------------------------------------------------------------------------- */
.editor-insert-article {
  position: relative;
  height: 0;
  overflow: visible;
}

.editor-insert-article--end {
  height: 12px;
}

.editor-insert-line {
  position: absolute;
  left: 50%;
  top: -12px;
  transform: translateX(-50%);
  width: 24px;
  height: 24px;
  border: none;
  background: var(--pkt-color-brand-warm-blue-1000, #1F42AA);
  color: #fff;
  border-radius: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  z-index: 3;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.editor-insert-article--end .editor-insert-line {
  top: 0;
}

/* Show "+" on hover of the article above, or the zone itself */
.editor-article-wrap:hover + .editor-insert-article .editor-insert-line,
.editor-insert-article:hover .editor-insert-line {
  display: flex;
}

/* --------------------------------------------------------------------------
   Add section button (between sections)
   -------------------------------------------------------------------------- */
.editor-add-section-zone {
  min-height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.editor-add-section-btn {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px dashed var(--pkt-color-border-gray, #CCCCCC);
  border-radius: 0;
  cursor: pointer;
  font-size: 0.8125rem;
  font-family: inherit;
  color: var(--pkt-color-text-placeholder, #666666);
  transition: all 0.15s;
  width: fit-content;
}

.editor-add-section-zone:hover .editor-add-section-btn {
  display: flex;
}

.editor-add-section-btn:hover {
  border-color: var(--pkt-color-brand-warm-blue-1000, #1F42AA);
  color: var(--pkt-color-brand-warm-blue-1000, #1F42AA);
}

/* --------------------------------------------------------------------------
   Inline editing — minimal, matches display layout with thin border
   -------------------------------------------------------------------------- */
.editor-inline-form {
  display: none;
  flex-direction: column;
  gap: 0;
}

.editor-article-wrap.editing .article-display {
  display: none;
}

.editor-article-wrap.editing .editor-hover-edit {
  display: none !important;
}

.editor-article-wrap.editing .editor-drag-handle {
  display: none !important;
}

.editor-article-wrap.editing .editor-inline-form {
  display: flex;
}

/* Title input — matches .article-title styling with thin border */
.editor-inline-title {
  font-weight: 500;
  font-size: 16px;
  line-height: 1.4;
  color: #1F42AA;
  border: 1px solid #CCCCCC;
  border-radius: 0;
  padding: 2px 6px;
  font-family: inherit;
  background: transparent;
  flex: 1;
  min-width: 0;
}

.editor-inline-title:focus {
  outline: none;
  border-color: #1F42AA;
}

/* Summary textarea — matches .article-summary styling with thin border */
.editor-inline-summary {
  font-size: 16px;
  font-weight: 300;
  color: #2A2859;
  line-height: 1.5;
  border: 1px solid #CCCCCC;
  border-radius: 0;
  padding: 2px 6px;
  font-family: inherit;
  background: transparent;
  resize: vertical;
  width: 100%;
  box-sizing: border-box;
}

.editor-inline-summary:focus {
  outline: none;
  border-color: #1F42AA;
}

.editor-inline-form .article-meta {
  font-size: 14px;
  font-weight: 300;
  color: #666666;
  margin: 8px 0 12px 34px;
}

.editor-inline-form__actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-left: 34px;
  margin-top: 12px;
}

/* --------------------------------------------------------------------------
   Section rename inline form
   -------------------------------------------------------------------------- */
.editor-section-rename-form {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 8px 16px;
}

.editor-section-header-wrap.editing .profile-header-display {
  display: none;
}

.editor-section-header-wrap.editing .editor-section-hover-edit {
  display: none !important;
}

.editor-section-header-wrap.editing .editor-section-rename-form {
  display: flex;
}

.editor-section-rename-input {
  border: 1px solid #CCCCCC;
  border-radius: 0;
  padding: 4px 8px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #2A2859;
  background: transparent;
  flex: 1;
  outline: none;
}

.editor-section-rename-input:focus {
  border-color: #1F42AA;
}

/* URL input for insert form — plain, no nested wrappers */
.editor-inline-url {
  font-size: 15px;
  font-family: inherit;
  color: #2A2859;
  border: 1px solid #CCCCCC;
  border-radius: 0;
  padding: 8px 10px;
  width: 100%;
  box-sizing: border-box;
  background: #fff;
}

.editor-inline-url:focus {
  outline: none;
  border-color: #1F42AA;
}

.editor-inline-url::placeholder {
  color: #999;
}

/* Subject input — plain, no nested wrappers */
.editor-inline-subject {
  font-size: 16px;
  font-family: inherit;
  font-weight: 500;
  color: #2A2859;
  border: 1px solid #CCCCCC;
  border-radius: 0;
  padding: 8px 10px;
  width: 100%;
  box-sizing: border-box;
  background: #fff;
}

.editor-inline-subject:focus {
  outline: none;
  border-color: #1F42AA;
}

/* --------------------------------------------------------------------------
   Intro section — "I korte trekk" with banner header
   -------------------------------------------------------------------------- */
.editor-intro-content {
  border: 1px solid #E6E6E6;
  border-top: none;
  padding: 20px 24px;
  position: relative;
}

.editor-intro-display {
  font-size: 16px;
  font-weight: 300;
  color: #2A2859;
  line-height: 1.6;
}

.editor-intro-display p {
  margin: 0 0 8px 0;
}

.editor-intro-display p:last-child {
  margin-bottom: 0;
}

.editor-intro-placeholder {
  color: #999;
  font-style: italic;
}

.editor-intro-hover-edit {
  position: absolute;
  top: 12px;
  right: 12px;
  display: none;
}

.editor-intro-wrap:hover .editor-intro-hover-edit {
  display: flex;
}

/* Hide display, show form when editing */
.editor-intro-wrap.editing .editor-intro-display {
  display: none;
}

.editor-intro-wrap.editing .editor-intro-hover-edit {
  display: none !important;
}

.editor-intro-form {
  display: none;
}

.editor-intro-wrap.editing .editor-intro-form {
  display: block;
}

.editor-intro-textarea {
  width: 100%;
  font-size: 16px;
  font-family: inherit;
  font-weight: 300;
  line-height: 1.6;
  color: #2A2859;
  border: 1px solid #CCCCCC;
  border-radius: 0;
  padding: 8px 10px;
  box-sizing: border-box;
  resize: vertical;
}

.editor-intro-textarea:focus {
  outline: none;
  border-color: #1F42AA;
}

/* --------------------------------------------------------------------------
   Insert form (slide-down panel for new article via URL)
   -------------------------------------------------------------------------- */
.editor-insert-form {
  border: 2px dashed var(--pkt-color-brand-warm-blue-1000, #1F42AA);
  background: var(--pkt-color-surface-subtle-light-blue, #E5FCFF);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.editor-insert-form__row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

.editor-insert-form__row .pkt-inputwrapper {
  flex: 1;
}

/* --------------------------------------------------------------------------
   Sticky send button (bottom of editor)
   -------------------------------------------------------------------------- */
.editor-sticky-send {
  position: sticky;
  bottom: 0;
  background: var(--pkt-color-background-default, #fff);
  border-top: 1px solid var(--pkt-color-border-gray, #CCCCCC);
  padding: 1rem 2rem;
  display: flex;
  justify-content: center;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
  z-index: 10;
}

/* --------------------------------------------------------------------------
   Removed articles section
   -------------------------------------------------------------------------- */
.editor-removed-section {
  margin-top: 2rem;
  border: 1px solid var(--pkt-color-border-gray, #CCCCCC);
  background: var(--pkt-color-surface-subtle-default, #F5F5F5);
}

.editor-removed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  cursor: pointer;
  user-select: none;
}

.editor-removed-list {
  padding: 0 1rem 1rem;
}

.editor-removed-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--pkt-color-border-gray, #CCCCCC);
}

.editor-removed-item:last-child {
  border-bottom: none;
}

/* SortableJS drag states */
.sortable-ghost {
  opacity: 0.3;
}

.sortable-chosen {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.sortable-drag {
  opacity: 0.9;
}

/* Empty state (no draft today) */
.editor-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 4rem 2rem;
}

.editor-empty-state__icon {
  margin-bottom: 1rem;
}

.editor-empty-state__icon pkt-icon {
  --fg-color: var(--pkt-color-text-placeholder, #666666);
}

/* --------------------------------------------------------------------------
   Diagnostics
   -------------------------------------------------------------------------- */
.diagnostics-filter-row {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1.5rem;
}

.diagnostics-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.diagnostics-detail-grid dt {
  font-weight: 500;
  color: var(--pkt-color-text-body-default, #2A2859);
  margin-top: 0.75rem;
}

.diagnostics-detail-grid dd {
  margin-left: 0;
}

.diagnostics-stacktrace {
  white-space: pre-wrap;
  max-height: 400px;
  overflow-y: auto;
  font-family: monospace;
  font-size: 0.8125rem;
  background: var(--pkt-color-surface-subtle-default, #F5F5F5);
  padding: 1rem;
  border: 1px solid var(--pkt-color-border-gray, #CCCCCC);
}

@media (max-width: 48rem) {
  .diagnostics-detail-grid {
    grid-template-columns: 1fr;
  }
}

/* Loading state for insert form */
.editor-insert-form__loading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  color: var(--pkt-color-text-placeholder, #666666);
  font-size: 0.875rem;
}
