.yelan-model-service { --ms-ink: #263f50; --ms-muted: #536b77; --ms-line: #d5e1e3; --ms-blue: #286884; --ms-paper: #fffdf7; color: var(--ms-ink); font: 14px/1.55 var(--wc-ui, "Noto Sans SC", system-ui, sans-serif); position: relative; width: 100%; min-width: 0; height: 100%; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.yelan-model-service *, .yelan-model-service *::before, .yelan-model-service *::after { box-sizing: border-box; }
.yelan-model-service [hidden] { display: none !important; }
.yelan-model-service h2, .yelan-model-service h3, .yelan-model-service h4, .yelan-model-service p { margin: 0; }
.yelan-model-service button, .yelan-model-service input, .yelan-model-service select { font: inherit; }
.yelan-model-service button { border: 1px solid #bbced5; color: var(--ms-blue); border-radius: 8px; padding: 8px 12px; min-height: 40px; background: #f9fcfc; cursor: pointer; transition: background-color 140ms ease, transform 100ms ease; }
.yelan-model-service button:hover { background: #e8f2f4; }
.yelan-model-service button:active { transform: translateY(1px); }
.yelan-model-service button.primary { background: var(--ms-blue); color: white; border-color: var(--ms-blue); }
.yelan-model-service button.primary:hover { background: #1c5067; }
.yelan-model-service button.danger { color: #943f32; border-color: #e4c6ba; background: #fff9f6; }
.yelan-model-service button:disabled, .yelan-model-service fieldset:disabled button { opacity: .5; cursor: not-allowed; transform: none; }
.yelan-model-service :is(button,input,select,summary,a):focus-visible { outline: 3px solid #3a81a1; outline-offset: 3px; }
.yelan-model-service fieldset { margin: 0; border: 0; padding: 0; min-width: 0; display: grid; gap: 12px; }
.yelan-model-service label { display: grid; gap: 5px; color: var(--ms-muted); font-size: 12px; font-weight: 600; min-width: 0; }
.yelan-model-service input:not([type=checkbox]), .yelan-model-service select { min-height: 42px; width: 100%; min-width: 0; background: #fff; border: 1px solid #bdcdd0; border-radius: 7px; padding: 8px 10px; color: var(--ms-ink); font-size: 14px; }
.yelan-model-service input[type=checkbox] { width: 18px; height: 18px; flex: 0 0 18px; accent-color: var(--ms-blue); cursor: pointer; }
.yelan-model-service.is-embedded .yms-heading { display: none; }
.yms-heading { display: flex; gap: 12px; justify-content: space-between; align-items: center; padding: 4px 0 8px; flex-shrink: 0; }
.yms-heading h2 { font: 600 20px/1.3 var(--wc-serif, serif); letter-spacing: .04em; }
.yms-heading p { color: var(--ms-muted); margin-top: 2px; font-size: 12px; }
.yms-eyebrow { display: block; font: 600 10px/1.5 system-ui, sans-serif; letter-spacing: .16em; color: #657a83; margin-bottom: 5px; }
.yms-tabs { display: inline-flex; gap: 2px; border-bottom: 0; margin: 0 0 10px; padding: 3px; flex-shrink: 0; align-self: start; background: rgba(255, 255, 255, 0.55); border: 1px solid rgba(54, 83, 122, 0.1); border-radius: 10px; }
.yms-tabs button { border: 1px solid transparent; border-radius: 7px; background: transparent; font-weight: 600; min-width: 88px; min-height: 36px; position: relative; }
.yms-tabs button[aria-selected=true] { color: #2367cc; background: #fff; }
.yms-tabs button::after { content: none; }
.yms-status { color: var(--ms-muted); font-size: 12px; min-height: 24px; font-variant-numeric: tabular-nums; }
.yms-error, .yms-feedback.bad { color: #913e30; background: #fff0e9; padding: 10px 12px; border-radius: 7px; overflow-wrap: anywhere; }
.yms-toolbar { display: flex; gap: 10px; align-items: end; margin: 6px 0 8px; flex-wrap: wrap; flex-shrink: 0; }
.yms-toolbar .yms-search { flex: 1 1 190px; }
.yelan-model-service .yms-check { display: flex; flex-direction: row; align-items: center; gap: 9px; min-height: 40px; font-size: 13px; }
.yms-check small { display: block; font-size: 11px; font-weight: 400; color: var(--ms-muted); overflow-wrap: anywhere; }
.yms-hint { color: var(--ms-muted); font-size: 12px; }
.yms-batchbar { background: #e6f1f2; border: 1px solid #bdd3da; border-radius: 9px; padding: 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.yms-batchbar > span { margin-right: auto; font-weight: 600; }
.yelan-model-service [data-pane="public"] { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.yelan-model-service [data-pane="channels"] { flex: 1; min-height: 0; overflow: hidden; }
.yms-status, .yms-error, .yms-hint { flex-shrink: 0; }
.yms-layout { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); align-items: stretch; gap: 12px; min-width: 0; flex: 1; min-height: 0; overflow: hidden; }
.yms-list { border: 1px solid rgba(54, 83, 122, 0.1); border-radius: 12px; background: rgba(255, 253, 248, 0.42); backdrop-filter: blur(12px); overflow: auto; max-height: none; height: auto; align-self: stretch; scrollbar-gutter: stable; min-width: 0; min-height: 0; }
.yms-group + .yms-group { border-top: 1px solid var(--ms-line); }
.yms-group h3 { position: sticky; top: 0; z-index: 1; background: rgba(255, 253, 248, 0.72); backdrop-filter: blur(8px); color: #456358; font-size: 12px; padding: 10px 14px; display: flex; justify-content: space-between; }
.yms-group h3 span { font-weight: 400; }
.yms-row { display: grid; grid-template-columns: 22px minmax(0,1fr) 52px 52px; align-items: center; gap: 7px; padding: 4px 12px; border: 1px solid transparent; border-radius: 10px; margin: 4px 6px; }
.yms-badge { display: inline-flex; align-items: center; justify-content: center; min-height: 22px; padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.yms-badge.published { background: #d7ecdf; color: #2f6a45; }
.yms-badge.pending { background: #f3ead0; color: #7a5a18; }
.yms-badge.waiting { background: #dcebf0; color: #2e6c90; }
.yms-badge.retired { background: #f3d9d2; color: #7a3a2c; }
.yms-badge.alias, .yms-badge.pricing { background: #ece7db; color: #5d6758; }
.yms-row.selected { background: rgba(46, 114, 210, 0.09); box-shadow: none; border: 1px solid rgba(46, 114, 210, 0.28); }
.yms-row button { min-width: 0; text-align: left; background: transparent; color: inherit; border: 0; padding: 6px 2px; min-height: 44px; }
.yms-model-name { display: block; font: 600 13px/1.5 ui-monospace, monospace; overflow-wrap: anywhere; }
.yms-row-meta { display: block; color: var(--ms-muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yms-row-price { color: #396757; text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; }
.yms-detail { min-width: 0; min-height: 0; height: 100%; padding: 0; border: 1px solid rgba(255, 255, 255, 0.7); border-radius: 12px; background: rgba(255, 253, 248, 0.46); backdrop-filter: blur(14px); max-height: none; overflow: hidden; display: flex; flex-direction: column; }
.yms-detail-scroll { flex: 1; min-height: 0; overflow: auto; padding: 14px 16px; scrollbar-gutter: stable; }
.yms-detail-foot { flex-shrink: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding: 10px 14px; border-top: 1px solid rgba(54, 83, 122, 0.1); background: rgba(255, 253, 248, 0.72); backdrop-filter: blur(12px); }
.yms-detail-foot .yms-actions { margin-left: auto; }
.yms-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; }
.yms-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid #c5dbe3; border-radius: 6px; background: #eef6f8; font-size: 12px; }
.yms-chip button { min-height: 22px; padding: 0 6px; border: 0; background: transparent; }
.yms-source-add { display: flex; gap: 6px; align-items: stretch; margin-top: 8px; }
.yms-source-add select { flex: 1; min-width: 0; }
.yms-placeholder { min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; color: var(--ms-muted); background: transparent; }
.yms-placeholder > span { color: #73a1ad; font-size: 42px; }
.yms-placeholder h3 { font: 500 20px/1.5 var(--wc-serif, serif); }
.yms-detail-head { display: flex; justify-content: space-between; align-items: start; gap: 10px; padding: 12px 16px 0; flex-shrink: 0; animation: yms-detail-enter 200ms ease both; }
.yms-detail-head h3 { font: 600 18px/1.5 ui-monospace, monospace; overflow-wrap: anywhere; }
.yms-detail-head > div { min-width: 0; }
.yms-detail-head button { flex: 0 0 auto; font-size: 12px; }
.yms-section { padding-top: 20px; margin-top: 18px; border-top: 1px solid var(--ms-line); display: grid; gap: 13px; }
.yms-section h4 { color: #789192; font: 500 12px/1.5 ui-monospace, monospace; display: flex; gap: 10px; align-items: center; }
.yms-section h4 span { color: var(--ms-ink); font: 600 15px/1.5 var(--wc-ui, system-ui, sans-serif); }
.yms-section input[type=number] { max-width: 200px; }
.yms-sources { max-height: none; overflow: visible; border: 0; border-radius: 0; padding: 0; }
.yms-source-count { color: var(--ms-muted); font-size: 11px; padding: 3px 0 7px; }
.yms-source { display: flex; gap: 8px; align-items: center; border-top: 1px solid #e6ecea; }
.yms-source > label { flex: 1; min-width: 0; }
.yms-source label span { min-width: 0; }
.yms-source strong { display: block; font-size: 12px; font-weight: 500; overflow-wrap: anywhere; }
.yms-source > button { background: transparent; border: 0; padding: 4px; font-size: 11px; flex: 0 0 auto; }
.yms-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.yms-actions button { font-size: 12px; }
.yms-feedback { color: #376958; font-size: 12px; min-height: 22px; }
.yms-prices, .yms-review dl { display: grid; grid-template-columns: 110px minmax(0,1fr); gap: 8px 10px; margin: 0; font-size: 12px; font-variant-numeric: tabular-nums; }
.yms-prices dt, .yms-review dt { color: var(--ms-muted); }
.yms-prices dd, .yms-review dd { margin: 0; overflow-wrap: anywhere; }
.yms-more, .yms-match { font-size: 12px; }
.yms-more summary, .yms-match summary { color: var(--ms-blue); cursor: pointer; min-height: 36px; line-height: 36px; }
.yms-more > p, .yms-match > p { margin-bottom: 8px; }
.yms-review { background: #fff7e7; border: 1px solid #e3d3af; padding: 12px; display: grid; gap: 12px; border-radius: 8px; }
.yms-review dl { grid-template-columns: 65px minmax(0,1fr); }
.yms-empty { padding: 28px 16px; color: var(--ms-muted); text-align: center; }
.yms-dialog { width: min(620px, calc(100vw - 28px)); max-height: 85dvh; overflow: auto; color: var(--ms-ink); background: var(--ms-paper); border: 1px solid var(--ms-line); border-radius: 15px; padding: 24px; box-shadow: 0 18px 70px #163c4b40; }
.yms-dialog::backdrop { background: #233e5366; }
.yms-dialog h2 { font-size: 20px; }
.yms-dialog > p { margin: 12px 0 18px; font-size: 13px; color: var(--ms-muted); }
.yms-batch-preview { max-height: 40vh; overflow: auto; }
.yms-batch-preview table { border-collapse: collapse; width: 100%; font-size: 12px; }
.yms-batch-preview td, .yms-batch-preview th { padding: 9px; text-align: left; border-bottom: 1px solid var(--ms-line); overflow-wrap: anywhere; }
.yms-batch-preview th { background: #edf3ef; }
.yelan-model-service .yelan-ops { --bg: #f6f8f2; --card: #fffdf8; background: transparent; min-height: 0; border: 0; }
.yelan-model-service .yelan-ops .top { display: none; }
.yelan-model-service .yelan-ops .wrap { padding: 0; max-width: none; }
.yms-reference-panel { margin: 10px 0; border-block: 1px solid var(--ms-line); padding: 4px 0; }
.yms-reference-panel > summary { cursor: pointer; padding: 10px 0; color: var(--ms-ink); font-weight: 600; }
.yms-channel-references { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 10px; max-height: 160px; overflow: auto; padding: 3px; }
.ops-standalone { margin: 0; min-height: 100dvh; background: #eff5f2 url('./paper.webp') repeat; }
.ops-standalone #yelanModelServiceRoot { max-width: 1420px; margin: 0 auto; padding: 12px 28px 40px; }
.ops-back { display: inline-block; margin: 18px 28px 0; color: #315e72; font: 13px system-ui, sans-serif; }
.admin-models-section #yelanModelServiceRoot { width: 100%; min-width: 0; }
@keyframes yms-detail-enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (max-width: 1000px) {
  .yms-layout { grid-template-columns: minmax(0,1fr); position: relative; }
  .yms-detail { display: none; max-height: none; }
  .has-detail .yms-detail { display: flex; position: absolute; inset: 0; z-index: 4; background: #f6f9fc; border-radius: 0; }
  .has-detail .yms-list { display: none; }
  .has-detail .yms-toolbar, .has-detail .yms-batchbar { display: none; }
  .yms-list { max-height: none; }
  .yms-source-add { flex-direction: column; }
  .yms-source-add button, .yms-detail-foot .yms-actions button { min-height: 44px; }
  .yms-detail-foot { flex-direction: column; align-items: stretch; }
  .yms-detail-foot .yms-actions { margin-left: 0; width: 100%; }
  .yms-detail-foot .yms-actions button { flex: 1; }
}
@media (max-width: 480px) {
  .yms-heading { gap: 10px; padding-top: 10px; }
  .yms-heading h2 { font-size: 22px; }
  .yms-heading p { font-size: 12px; }
  .yms-heading > button { font-size: 12px; flex: 0 0 auto; }
  .yms-toolbar { gap: 10px; }
  .yms-toolbar .yms-search { flex-basis: 100%; }
  .yms-toolbar > label { flex: 1; }
  .yms-toolbar > button { width: 100%; }
  .yms-detail { padding: 13px; }
  .yms-prices { grid-template-columns: 84px minmax(0,1fr); }
  .yms-detail-head h3 { font-size: 16px; }
  .ops-standalone #yelanModelServiceRoot { padding: 8px 12px 30px; }
  .ops-back { margin-left: 12px; }
  .yms-dialog { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .yelan-model-service *, .yelan-model-service *::before, .yelan-model-service *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.yelan-model-service.is-embedded .yms-tabs {
  margin: 0 0 6px;
}
.yelan-model-service.is-embedded .yms-tabs button {
  min-width: 72px;
  min-height: 30px;
  font-size: 12px;
}
.yelan-model-service.is-embedded .yms-status {
  min-height: 16px;
  margin: 0 0 4px;
  font-size: 11px;
}
.yelan-model-service.is-embedded .yms-toolbar {
  gap: 8px;
  margin: 0 0 6px;
  align-items: center;
}
.yelan-model-service.is-embedded .yms-toolbar label {
  font-size: 11px;
  gap: 3px;
}
.yelan-model-service.is-embedded input:not([type=checkbox]),
.yelan-model-service.is-embedded select,
.yelan-model-service.is-embedded button {
  min-height: 32px;
  padding: 4px 10px;
  font-size: 12px;
}
.yelan-model-service.is-embedded .yms-check {
  min-height: 32px;
}
.yelan-model-service.is-embedded .yms-row {
  gap: 6px;
  margin: 1px 4px;
  padding: 1px 8px;
}
.yelan-model-service.is-embedded .yms-row button {
  min-height: 30px;
  padding: 2px;
}
.yelan-model-service.is-embedded .yms-model-name {
  font-size: 12px;
  line-height: 1.3;
}
.yelan-model-service.is-embedded .yms-row-meta {
  font-size: 10px;
}
.yelan-model-service.is-embedded .yms-group h3 {
  padding: 6px 10px;
  font-size: 11px;
}
.yelan-model-service.is-embedded .yms-section {
  gap: 8px;
  margin-top: 8px;
  padding-top: 10px;
}
.yelan-model-service.is-embedded .yms-detail-head {
  padding: 8px 12px 0;
}
.yelan-model-service.is-embedded .yms-detail-head h3 {
  font-size: 15px;
}
.yelan-model-service.is-embedded .yms-detail-scroll {
  padding: 8px 12px;
}
.yelan-model-service.is-embedded .yms-placeholder {
  min-height: 0;
  padding: 28px 12px;
}
.yelan-model-service.is-embedded .yms-detail-foot {
  padding: 8px 10px;
}
.yelan-model-service.is-embedded .yms-batchbar {
  margin-bottom: 6px;
  padding: 6px 8px;
}
