/* Shared DTP light theme. Components own spacing; no legacy dark overrides. */
:root {
  color-scheme: light;
  --core-brand: #d63384;
  --core-violet: #6d2f88;
  --core-deep: #06063f;
  --core-bg: #f6f7fb;
  --core-surface: #fff;
  --core-raised: #f2f3f8;
  --core-text: #25263b;
  --core-muted: #606579;
  --core-line: #dfe2eb;
  --core-accent: #783080;
  --core-accent-soft: #f6edf7;
  --core-focus: #73378b;
  --core-danger: #b42342;
  --core-success: #227352;
  --core-radius: 12px;
  --core-space: clamp(16px, 2.5vw, 32px);
  --core-shadow: 0 8px 28px #22223b0a;
  --core-visible-height: 100dvh;
  --core-visible-top: 0px;
}
.core-page {
  margin: 0;
  background: var(--core-bg);
  color: var(--core-text);
  font:
    400 0.9375rem/1.5 system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  min-height: 100svh;
}
:where(.core-page, .core-nav, .core-dialog, .dtp-space-page) *,
:where(.core-page, .core-nav, .core-dialog, .dtp-space-page) *::before,
:where(.core-page, .core-nav, .core-dialog, .dtp-space-page) *::after {
  box-sizing: border-box;
}
:where(.core-page, .core-nav, .core-dialog)
  :is(button, input, select, textarea) {
  font: inherit;
  color: inherit;
}
:where(.core-page, .core-nav, .core-dialog) a {
  color: var(--core-accent);
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
:where(.core-page, .core-nav, .core-dialog) :is(button, .core-button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px 14px;
  border: 1px solid var(--core-line);
  border-radius: 8px;
  background: var(--core-surface);
  color: var(--core-text);
  cursor: pointer;
  line-height: 1.35;
  font-weight: 500;
  text-decoration: none;
  white-space: normal;
  overflow-wrap: anywhere;
}
:where(.core-page, .core-nav, .core-dialog) :is(button, .core-button):hover {
  background: var(--core-raised);
  border-color: #b7bccd;
}
:where(.core-page, .core-nav, .core-dialog) button:active {
  background: #e9eaf2;
}
:where(.core-page, .core-nav, .core-dialog) button:disabled {
  color: #777d8e;
  background: #f0f1f5;
  border-color: #e2e4ed;
  cursor: not-allowed;
}
:where(.core-page, .core-nav, .core-dialog) .core-primary {
  color: #fff;
  background: var(--core-accent);
  border-color: var(--core-accent);
}
:where(.core-page, .core-nav, .core-dialog) .core-primary:not(:disabled):hover {
  color: #fff;
  background: #602567;
  border-color: #602567;
}
:where(.core-page, .core-nav, .core-dialog) .core-danger {
  color: var(--core-danger);
}
:where(.core-page, .core-nav, .core-dialog) :is(input, select, textarea) {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid #c8ccda;
  border-radius: 8px;
  background: #fff;
  color: var(--core-text);
  font-size: 1rem;
}
:where(.core-page, .core-nav, .core-dialog) input::placeholder,
:where(.core-page, .core-nav, .core-dialog) textarea::placeholder {
  color: #707688;
  opacity: 1;
}
:where(.core-page, .core-nav, .core-dialog)
  :is(input[type="checkbox"], input[type="radio"]) {
  width: 20px;
  height: 20px;
  min-height: 20px;
  display: inline-block;
  margin: 4px 8px 4px 0;
  accent-color: var(--core-accent);
  flex-shrink: 0;
}
:where(.core-page, .core-nav, .core-dialog) label {
  display: grid;
  gap: 6px;
  color: var(--core-text);
  font-size: 0.875rem;
  font-weight: 500;
}
:where(.core-page, .core-nav, .core-dialog)
  :is(button, a, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--core-focus);
  outline-offset: 3px;
  scroll-margin: 16px;
}
:where(.core-page, .core-nav, .core-dialog) :is(p, h1, h2, h3, h4, dd) {
  overflow-wrap: anywhere;
}
:where(.core-page, .core-nav, .core-dialog) h1 {
  font-size: clamp(1.4rem, 1.4rem + 0.4vw, 1.85rem);
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: -0.025em;
  margin: 0;
}
:where(.core-page, .core-nav, .core-dialog) h2 {
  font-size: 1.0625rem;
  line-height: 1.4;
  font-weight: 600;
  margin: 0;
}
:where(.core-page, .core-nav, .core-dialog) h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 0;
}
:where(.core-page, .core-nav, .core-dialog) p {
  margin: 0.4em 0;
  color: var(--core-muted);
}
:where(.core-page, .core-nav, .core-dialog) [hidden] {
  display: none;
}
.core-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.core-skip {
  position: fixed;
  top: -100px;
  left: 12px;
  z-index: 100;
  padding: 12px;
  background: #fff;
}
.core-skip:focus {
  top: 10px;
}
.core-nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 16px;
  padding: 10px var(--core-space);
  border-bottom: 1px solid var(--core-line);
  color: var(--core-text);
  background: #fff;
  font: 400 0.875rem/1.4 system-ui;
  position: relative;
  z-index: 10;
}
.core-brand {
  display: flex;
  width: max-content;
  max-width: 100%;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}
.core-brand img {
  display: block;
  width: 166px;
  max-width: 100%;
  height: auto;
}
.core-nav-links {
  grid-column: 1/-1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  min-width: 0;
}
.core-nav-links :is(a, button) {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--core-muted);
  text-decoration: none;
  font: inherit;
}
.core-nav-links :is(a, button):hover {
  color: var(--core-text);
  background: var(--core-raised);
}
.core-nav-links [aria-current="page"] {
  color: var(--core-accent);
  background: var(--core-accent-soft);
  font-weight: 650;
}
.core-nav-account {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}
.core-nav-account > summary {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--core-accent-soft);
  color: var(--core-accent);
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}
.core-nav-account > summary::-webkit-details-marker {
  display: none;
}
.core-account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(300px, calc(100vw - 32px));
  padding: 16px;
  border: 1px solid var(--core-line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 40px #26233b20;
}
.core-account-menu strong {
  display: block;
  overflow-wrap: anywhere;
  margin-bottom: 8px;
}
.core-account-menu :is(a, button) {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  padding: 10px;
  text-align: left;
  justify-content: flex-start;
  text-decoration: none;
}
.core-account-menu form {
  margin: 4px 0 0;
}
.core-main {
  width: 100%;
  max-width: 1328px;
  margin: auto;
  padding: var(--core-space);
  padding-bottom: max(32px, env(safe-area-inset-bottom));
}
.core-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 4px 0 24px;
}
.core-page-head > div {
  min-width: 0;
  flex: 1 1 240px;
}
.core-page-head p {
  font-size: 0.9rem;
  margin-top: 6px;
  max-width: 65ch;
}
.core-surface {
  background: var(--core-surface);
  border: 1px solid var(--core-line);
  border-radius: var(--core-radius);
  padding: clamp(16px, 2vw, 24px);
  min-width: 0;
  margin-bottom: 20px;
}
.core-list {
  padding: 0;
}
.core-list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--core-line);
}
.core-list-heading span {
  color: var(--core-muted);
  font-size: 0.8125rem;
}
.core-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--core-line);
}
.core-row:last-child {
  border-bottom: 0;
}
.core-row > div:first-child {
  min-width: 0;
  flex: 1 1 220px;
}
.core-row h2 {
  font-size: 0.9375rem;
  line-height: 1.45;
}
.core-row h2 a {
  color: var(--core-text);
  text-decoration: none;
}
.core-row h2 a:hover {
  color: var(--core-accent);
  text-decoration: underline;
}
.core-row p {
  font-size: 0.8125rem;
  margin: 5px 0 0;
}
.core-row .core-row-subtitle {
  max-width: 80ch;
}
.core-row .core-actions {
  flex-shrink: 0;
}
.core-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.core-row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  color: var(--core-muted);
  font-size: 0.8125rem;
  margin-top: 7px;
}
.core-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: max-content;
  max-width: 100%;
  border-radius: 5px;
  background: #eef0f5;
  color: #555d70;
  padding: 3px 7px;
  font-size: 0.75rem;
  line-height: 1.45;
  font-weight: 500;
}
.core-badge[data-state="published"],
.core-badge[data-state="success"],
.core-badge[data-state="active"] {
  color: #226447;
  background: #eaf5ef;
}
.core-badge[data-state="draft"],
.core-badge[data-state="pending"],
.core-badge[data-state="created"] {
  color: #82570c;
  background: #fff5da;
}
.core-badge[data-state="failed"],
.core-badge[data-state="error"],
.core-badge[data-state="uncertain"] {
  color: #a32a40;
  background: #fff0f2;
}
.core-filter {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: end;
  margin-bottom: 20px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--core-line);
  border-radius: 12px;
}
.core-filter .core-search-field {
  grid-column: 1/-1;
}
.core-filter label {
  font-size: 0.8125rem;
}
.core-filter .core-filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.core-filter select {
  min-width: 0;
}
.core-form {
  display: grid;
  gap: 16px;
}
.core-form .errorlist {
  color: var(--core-danger);
  font-size: 0.875rem;
  padding-left: 20px;
  margin: 4px 0;
}
.core-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.core-form :is(small, .helptext) {
  color: var(--core-muted);
  font-size: 0.8125rem;
  font-weight: 400;
}
.core-form input[aria-invalid="true"] {
  border-color: var(--core-danger);
}
.core-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin: 20px 0;
  font-size: 0.875rem;
}
.core-pagination a {
  min-height: 44px;
  padding: 10px;
}
.core-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.core-data {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  font-size: 0.875rem;
}
.core-data dt {
  color: var(--core-muted);
  font-weight: 500;
}
.core-data dd {
  margin: 0 0 10px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.core-data ul {
  padding-left: 20px;
}
.core-empty {
  padding: 36px 20px;
  text-align: center;
}
.core-empty h2 {
  font-size: 1rem;
}
.core-empty p {
  max-width: 55ch;
  margin: 8px auto 0;
}
.core-disclosure > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}
.core-disclosure > summary:after {
  content: "＋";
  color: var(--core-accent);
}
.core-disclosure[open] > summary:after {
  content: "−";
}
.core-disclosure > form {
  margin-top: 20px;
  max-width: 700px;
}
.core-section-head {
  margin: 24px 0 12px;
}
.core-back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-bottom: 12px;
  text-decoration: none;
}
.core-dialog {
  padding: 0;
  box-sizing: border-box;
  border: 1px solid var(--core-line);
  border-radius: 16px 16px 0 0;
  color: var(--core-text);
  background: #fff;
  width: 100%;
  max-width: 100%;
  max-height: calc(var(--core-visible-height, 100dvh) - 12px);
  margin: 0;
  position: fixed;
  inset: auto 0 0;
  box-shadow: 0 24px 80px #27243b26;
  font: 400 0.9375rem/1.5 system-ui;
  color-scheme: light;
}
.core-dialog::backdrop {
  background: #27243b45;
}
.core-dialog[open] {
  display: flex;
  flex-direction: column;
}
.core-dialog > header {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--core-line);
}
.core-dialog > header h2 {
  flex: 1 1 120px;
  min-width: 0;
  font-size: 1rem;
}
.core-dialog > header button {
  min-width: 44px;
  padding: 8px;
  border-color: transparent;
  background: transparent;
}
.core-dialog > header button[data-core-close] {
  font-size: 1.4rem;
}
.core-scroll {
  overflow: auto;
  overscroll-behavior: contain;
  min-height: 0;
  padding: 20px;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  scrollbar-width: thin;
}
.core-dialog details {
  margin: 12px 0;
}
.core-dialog summary {
  min-height: 44px;
  padding: 10px 0;
  cursor: pointer;
}
.core-dialog .core-row {
  padding-inline: 0;
}
.core-dialog .core-surface {
  padding: 12px 16px;
  box-shadow: none;
}
#coreSystemSearch {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 16px;
}
#coreSystemSearch label {
  grid-column: 1/-1;
}
.core-chat {
  height: calc(var(--core-visible-height, 100dvh) - 12px);
  top: var(--core-visible-top, 0px);
  bottom: auto;
}
.core-chat-context {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  flex-shrink: 0;
  padding: 12px 16px;
  border-bottom: 1px solid var(--core-line);
  background: #fafbfe;
  max-height: 35%;
  overflow: auto;
}
.core-chat-context label {
  flex: 1 1 120px;
  font-size: 0.75rem;
  min-width: 0;
}
.core-chat-context a {
  font-size: 0.8125rem;
  padding: 10px 0;
  min-height: 44px;
}
.core-chat #coreChatHistory {
  flex: 1 1 60%;
  border-bottom: 1px solid var(--core-line);
}
.core-messages {
  flex: 1 1 0;
  overflow: auto;
  min-height: 70px;
  overscroll-behavior: contain;
  padding: 20px;
  scroll-padding: 20px;
  scrollbar-width: thin;
}
.core-message {
  padding: 16px 0;
  border-bottom: 1px solid var(--core-line);
  overflow-wrap: anywhere;
}
.core-message.is-user {
  background: #f5f0f8;
  padding: 14px 16px;
  border-radius: 12px;
  margin: 8px 0;
  border: 0;
}
.core-message > strong {
  font-size: 0.8125rem;
  color: var(--core-accent);
}
.core-message-content {
  white-space: pre-wrap;
  margin: 8px 0;
  line-height: 1.65;
}
.core-message table {
  border-collapse: collapse;
  width: 100%;
  table-layout: fixed;
  margin: 12px 0;
}
.core-message :is(th, td) {
  text-align: left;
  border: 1px solid var(--core-line);
  padding: 10px;
  overflow-wrap: anywhere;
}
.core-message th {
  background: var(--core-raised);
}
.core-message .core-actions button {
  font-size: 0.8125rem;
  border-color: transparent;
  background: transparent;
}
.core-composer {
  padding: 12px 16px max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--core-line);
  display: grid;
  gap: 8px;
  flex-shrink: 0;
  background: #fff;
}
.core-composer > label {
  font-size: 0.8125rem;
}
.core-composer textarea {
  resize: vertical;
  min-height: 68px;
  max-height: 140px;
}
.core-composer .core-actions {
  justify-content: flex-end;
}
.core-file {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 44px;
  max-width: 100%;
  cursor: pointer;
  margin-right: auto;
}
.core-file input {
  width: 190px;
  max-width: 100%;
  font-size: 0.75rem;
  padding: 6px;
  min-height: 44px;
  border: 0;
  background: transparent;
}
.core-status {
  font-size: 0.8125rem;
  padding: 8px 16px;
  color: var(--core-muted);
  max-height: 100px;
  overflow: auto;
  background: #f8f9fc;
}
.core-status:empty {
  display: none;
}
#aiCoreSend {
  min-width: 100px;
}
.core-login {
  max-width: 460px;
  padding-top: clamp(24px, 10svh, 100px);
}
.core-login .core-brand {
  margin: 0 0 28px;
}
.core-login .core-form {
  margin-top: 24px;
}
@media (min-width: 640px) {
  .core-nav-links {
    display: flex;
    flex-wrap: wrap;
  }
  .core-filter {
    grid-template-columns: minmax(0, 1fr) minmax(140px, 180px) auto;
  }
  .core-filter .core-search-field {
    grid-column: auto;
  }
  .core-filter:not(:has(select)) {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .core-data {
    grid-template-columns: minmax(120px, 0.35fr) minmax(0, 1fr);
    gap: 10px;
  }
}
@media (min-width: 768px) {
  .core-dialog {
    width: min(720px, calc(100% - 48px));
    max-height: calc(var(--core-visible-height, 100dvh) - 48px);
    margin: auto;
    inset: 24px;
    border-radius: 16px;
  }
  .core-chat {
    width: min(720px, calc(100% - 48px));
    height: min(820px, calc(var(--core-visible-height, 100dvh) - 48px));
    top: var(--core-visible-top, 24px);
    inset-inline: auto 24px;
  }
  .core-chat.is-expanded {
    width: min(1120px, calc(100% - 48px));
    height: calc(var(--core-visible-height, 100dvh) - 48px);
    inset-inline: 24px;
    margin: auto;
  }
  .core-columns {
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.85fr);
  }
}
@media (min-width: 1024px) {
  .core-nav {
    display: flex;
    gap: 28px;
    min-height: 72px;
    padding-block: 10px;
  }
  .core-nav-links {
    flex: 1;
    gap: 4px;
  }
  .core-nav-account {
    margin-left: auto;
  }
}
@media (max-width: 479px) {
  .core-message table,
  .core-message tbody,
  .core-message tr,
  .core-message td {
    display: block;
    width: 100%;
  }
  .core-message thead {
    position: absolute;
    clip-path: inset(50%);
    width: 1px;
    height: 1px;
  }
  .core-message td:before {
    content: attr(data-label);
    display: block;
    color: var(--core-muted);
    font-weight: 600;
  }
  .core-message tr {
    margin: 12px 0;
    border: 1px solid var(--core-line);
  }
  .core-message td {
    border: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  :where(.core-page, .core-dialog) * {
    scroll-behavior: auto;
    transition: none;
    animation: none;
  }
}

.core-attachment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.core-attachment-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px;
  background: var(--core-raised);
  border-radius: 8px;
  overflow-wrap: anywhere;
}
.core-message[data-delivery="sending"] {
  border-style: dashed;
}
.core-message[data-delivery="failed"] {
  border-color: var(--core-danger);
}
