/* Canonical shared UI contract. Generated copies: scripts/sync-ui.py. */
:root {
  --ui-font:
    "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --ui-surface: var(--ds-bg-surface, var(--card, #fff));
  --ui-text: var(--ds-content-primary, var(--foreground, #172033));
  --ui-muted: var(--ds-content-secondary, var(--muted-foreground, #526077));
  --ui-border: var(--ds-border-strong, var(--border, #94a3b8));
  --ui-accent: var(--ds-accent, var(--primary, #2563eb));
  --ui-quiet: var(--ds-bg-surface-2, var(--muted, #edf2f7));
  --ui-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23526077' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] {
  --ui-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
body {
  font-family: var(--ui-font);
}
.ds-header-row {
  height: 64px;
  min-height: 64px;
  gap: 12px;
  padding-inline: 16px;
}
.ds-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-shrink: 0;
}
.ds-header-toggle,
.ds-theme-toggle,
.ds-lang-toggle .ds-lang-btn {
  box-sizing: border-box;
  height: 44px;
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  padding: 0 12px;
  background-color: var(--ui-surface);
  color: var(--ui-muted);
  font-family: var(--ui-font);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: normal;
  cursor: pointer;
  white-space: nowrap;
}
.ds-header-toggle {
  width: 44px;
  padding: 0;
  border-color: transparent;
}
.ds-lang-toggle {
  display: inline-flex;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
}
.ds-lang-toggle .ds-lang-btn {
  border-radius: 0;
}
.ds-lang-toggle .ds-lang-btn:first-child {
  min-width: 64px;
  border-radius: 8px 0 0 8px;
}
.ds-lang-toggle .ds-lang-btn:last-child {
  min-width: 44px;
  border-radius: 0 8px 8px 0;
}
.ds-lang-toggle .ds-lang-btn + .ds-lang-btn {
  border-left-width: 0;
}
.ds-lang-toggle .ds-lang-btn[aria-pressed="true"] {
  color: var(--ui-accent);
  background-color: var(--ui-quiet);
  box-shadow: inset 0 -2px var(--ui-accent);
}
.ds-theme-toggle {
  width: 44px;
  padding: 0;
  font-size: 0;
}
.ds-theme-toggle > * {
  display: none;
}
.ds-theme-toggle::before {
  content: "";
  width: 18px;
  height: 18px;
  background: currentColor;
  mask: center / contain no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='13' rx='2'/%3E%3Cpath d='M8 21h8m-4-4v4'/%3E%3C/svg%3E");
}
.ds-theme-toggle[data-theme-pref="light"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2m0 16v2M2 12h2m16 0h2M5 5l1.5 1.5m11 11L19 19M5 19l1.5-1.5m11-11L19 5'/%3E%3C/svg%3E");
}
.ds-theme-toggle[data-theme-pref="dark"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M20.5 14A9 9 0 0 1 10 3.5 9 9 0 1 0 20.5 14Z'/%3E%3C/svg%3E");
}
:is(.ds-header-toggle, .ds-theme-toggle, .ds-lang-btn):hover {
  background-color: var(--ui-quiet);
  color: var(--ui-text);
}
:is(.ds-header-toggle, .ds-theme-toggle, .ds-lang-btn):focus-visible {
  outline: 2px solid var(--ui-accent);
  outline-offset: 3px;
}
:is(.ds-lang-btn, .ds-theme-toggle):disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
/* Preserve the select affordance even when app styles reset background. */
select:not([multiple]) {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  box-sizing: border-box;
  min-height: 44px;
  padding: 10px 38px 10px 12px;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  color: var(--ui-text);
  background-color: var(--ui-surface);
  background-image: var(--ui-chevron);
  background-position: right 12px center;
  background-size: 16px 16px;
  background-repeat: no-repeat;
  line-height: 1.4;
}
select:not([multiple]):focus-visible {
  outline: 2px solid var(--ui-accent);
  outline-offset: 2px;
}
select:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
:is(
  input[type="text"],
  input[type="search"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="date"],
  input[type="month"],
  input[type="time"],
  input[type="datetime-local"],
  input[type="url"],
  input[type="tel"]
) {
  box-sizing: border-box;
  min-height: 44px;
  border-radius: 8px;
  max-width: 100%;
}
:is(.btn, .ds-btn, [data-slot="button"]):not(.ds-lang-btn) {
  min-height: 44px;
  border-radius: 8px;
}
:is(
  [data-slot="select-trigger"],
  [data-slot="input"],
  .ds-input,
  .ds-select,
  .ds-ms-field
) {
  min-height: 44px;
  border-radius: 8px;
}
:is(.toolbar, .filter-row, .form-footer, .ds-toolbar) {
  gap: 12px;
  flex-wrap: wrap;
  align-items: end;
}
:is(.toolbar, .filter-row, .form-footer, .ds-toolbar)
  > :is(.btn, .ds-btn, button) {
  margin-bottom: 0;
}
:is(.field, .ds-field) {
  min-width: 0;
}
:is(.ds-content, .ui-content) {
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
  padding: 28px 24px;
}
:is(.ds-sidebar, .ui-sidebar) {
  width: 256px;
}
.ds-sidebar:not(.ds-sidebar--on) {
  visibility: hidden;
}
.ds-sidebar-nav {
  overflow: visible;
  flex: 0 0 auto;
}
.ds-sidebar-brand {
  min-height: 64px;
  height: 64px;
  flex-shrink: 0;
}
.ds-sidebar-foot {
  margin-top: auto;
}
.ds-nav-link .ds-nav-text {
  white-space: normal;
  overflow-wrap: anywhere;
}
html:has(dialog[open]),
html:has(dialog[open]) body,
html.ui-overlay-open,
html.ui-overlay-open body {
  overflow: hidden;
}
/* Table labels are populated by the DOM/React adapters. No clipped data. */
:is(.tablewrap, .ds-tablewrap, .table-scroll, [data-slot="table-container"]) {
  overflow: visible;
  max-height: none;
}
:is(.tablewrap, .ds-tablewrap, .table-scroll, [data-slot="table-container"])
  table {
  width: 100%;
  table-layout: fixed;
}
:is(.tablewrap, .ds-tablewrap, .table-scroll, [data-slot="table-container"])
  :is(td, th) {
  white-space: normal;
  overflow-wrap: anywhere;
  min-width: 0;
}
.ui-record-table tbody tr {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--ui-border);
}
.ui-record-table tbody td {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: start;
  border: 0;
  min-width: 0;
}
.ui-record-table tbody td::before {
  content: attr(data-label);
  color: var(--ui-muted);
  font-size: 12px;
  font-weight: 600;
}
textarea[data-ui-autosize] {
  resize: none;
  overflow: hidden;
  max-height: none;
}
@media (max-width: 991px), (max-height: 700px) {
  .ds-shell--pushed,
  .ds-shell--pushed.ds-shell--narrow {
    padding-left: 0;
  }
  .ds-sidebar {
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .ds-sidebar-scrim {
    display: block;
  }
  .ds-sidebar-foot {
    display: block;
  }
}
@media (max-width: 768px) {
  :is(.ds-content, .ui-content) {
    padding: 20px 16px;
  }
  :is(.ds-tablewrap, .tablewrap, .table-scroll, [data-slot="table-container"])
    tbody
    tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding-block: 12px;
    border-bottom: 1px solid var(--ui-border);
  }
  :is(.ds-tablewrap, .tablewrap, .table-scroll, [data-slot="table-container"])
    tbody
    td {
    display: grid;
    grid-template-columns: minmax(90px, 0.4fr) minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    border: 0;
    text-align: start;
    padding: 8px 12px;
  }
  :is(.ds-tablewrap, .tablewrap, .table-scroll, [data-slot="table-container"])
    tbody
    td::before {
    content: attr(data-label);
    font-size: 12px;
    color: var(--ui-muted);
    font-weight: 600;
  }
  :is(.ds-tablewrap, .tablewrap, .table-scroll, [data-slot="table-container"])
    td[colspan] {
    grid-template-columns: minmax(0, 1fr);
  }
  :is(.ds-tablewrap, .tablewrap, .table-scroll, [data-slot="table-container"])
    td[colspan]::before {
    display: none;
  }
  .ds-header-brand {
    display: none;
  }
  .ds-header-right .health {
    display: none;
  }
}
@media (forced-colors: active) {
  select:not([multiple]) {
    appearance: auto;
    background-image: none;
    padding-right: 8px;
  }
  .ds-theme-toggle::before {
    background: ButtonText;
  }
}

/* Text and form controls must fit their grid track. */
:is(.field, .ds-field) > :is(input, select, textarea) {
  max-width: 100%;
}
.ui-record-table,
.ui-record-table tbody {
  display: block;
}

/* Keep sorting and select-all controls reachable in the reflowed header. */
.ui-record-table thead {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip-path: none;
  display: block;
}
.ui-record-table thead tr {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ui-record-table thead th {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.ui-record-table thead th:has(:is(button, a, input, [role="checkbox"])) {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip-path: none;
}
@media (max-width: 768px) {
  :is(.ds-tablewrap, .tablewrap, .table-scroll, [data-slot="table-container"])
    thead {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
    display: block;
  }
  :is(.ds-tablewrap, .tablewrap, .table-scroll, [data-slot="table-container"])
    thead
    tr {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  :is(.ds-tablewrap, .tablewrap, .table-scroll, [data-slot="table-container"])
    thead
    th {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  :is(.ds-tablewrap, .tablewrap, .table-scroll, [data-slot="table-container"])
    thead
    th:has(:is(button, a, input, [role="checkbox"])) {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
  }
}

.ui-record-table thead th :is(button, a) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 8px;
}
@media (max-width: 768px) {
  :is(.ds-tablewrap, .tablewrap, .table-scroll, [data-slot="table-container"])
    thead
    th
    :is(button, a) {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 12px;
    border-radius: 8px;
  }
}
/* Decorative progress dots: pair with a named action or status message. */
.ds-loading-dots {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  width: 1.25em;
  height: 1em;
  vertical-align: middle;
}
.ds-loading-dots > i {
  display: block;
  width: 22%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: currentColor;
  animation: ds-loading-dot 1s ease-in-out infinite;
}
.ds-loading-dots > i:nth-child(2) { animation-delay: .15s; }
.ds-loading-dots > i:nth-child(3) { animation-delay: .3s; }
@keyframes ds-loading-dot {
  0%, 80%, 100% { opacity: .35; }
  40% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .ds-loading-dots > i { animation: none; opacity: 1; }
}
