/* YIN visual polish: typography + Discovery schedule controls */
html{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility}
body{font-weight:400;letter-spacing:0}

/* Keep Oswald reserved for large display hierarchy. */
h1,h2,.yin-page-title,.yin-section-title{font-family:var(--yin-font-heading);font-weight:500;letter-spacing:.005em}
.yin-page-title{font-weight:500}
.yin-section-title{font-weight:500}

/* Operational UI should stay neutral and highly legible. */
table,th,td,.btn,button,input,select,textarea,label,.yin-nav,.yin-header,.yin-footer{font-family:var(--yin-font-body)}
th{font-weight:500;letter-spacing:0;color:#334155}
td{font-weight:400;color:#1f2937;line-height:1.35}
td strong,td b,th strong,th b{font-weight:500}
strong,b{font-weight:500}
.btn{font-weight:500}
.yin-field label{font-weight:500}
.yin-nav a.active{font-weight:500}
.yin-nav-section{font-weight:500}
.yin-kpi-label{font-weight:500}

/* Discovery schedule toolbar */
.yin-schedule-section>.yin-section-header{align-items:center}
.yin-schedule-section>.yin-section-header p{margin:4px 0 0;color:#64748b;font-size:12px}
.yin-schedule-flow{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0;margin:0 0 12px;padding:0;list-style:none}
.yin-schedule-flow li{position:relative;display:flex;align-items:center;gap:8px;color:#475569;font-size:12px}
.yin-schedule-flow li:not(:last-child)::after{content:"";height:1px;flex:1;margin-right:10px;background:#cbd5e1}
.yin-schedule-flow span{display:grid;place-items:center;width:24px;height:24px;flex:0 0 24px;border:1px solid #b8cee0;border-radius:50%;background:#eef6fb;color:var(--yin-primary);font-weight:600}
.yin-schedule-flow strong{white-space:nowrap}
.yin-form-status{min-height:18px;margin:7px 2px 0;font-size:12px;line-height:1.4}
.yin-schedule-section .yin-table-wrap{overflow-x:auto}
.yin-schedule-section table{min-width:1120px}
.yin-schedule-section .schedule-name{min-width:150px}
.yin-schedule-days{display:grid;grid-template-columns:repeat(4,auto);gap:4px;margin:0;border:0;padding:0;min-width:210px}
.yin-schedule-days label{display:flex;align-items:center;gap:3px;color:#475569;font-size:10px;white-space:nowrap}
.yin-schedule-days input{width:14px;height:14px;margin:0;accent-color:var(--yin-primary)}
.yin-schedule-actions{display:flex;gap:5px}.yin-schedule-actions .btn{padding:6px 8px;font-size:11px}
.schedule-row--overlap td{background:#fffaf0}
.schedule-row--overlap td:first-child{box-shadow:inset 3px 0 #d97706}
.yin-overlap-warning{border:1px solid #f1d29a;border-radius:7px;background:#fff8e6;padding:8px 10px!important;color:#8a5700!important}
.yin-next-runs{display:grid;grid-template-columns:minmax(180px,240px) 1fr;gap:14px;margin-top:12px;border-top:1px solid var(--yin-border);padding-top:12px}
.yin-next-runs>div{display:flex;flex-direction:column;gap:3px}.yin-next-runs small{color:#64748b;line-height:1.4}
.yin-next-runs__content{display:grid;gap:8px}.yin-next-runs ol{display:grid;grid-template-columns:repeat(3,minmax(180px,1fr));gap:6px;margin:0;padding:0;list-style:none}
.yin-next-runs li{display:grid;grid-template-columns:1fr auto;gap:2px 8px;border:1px solid #dbe3ec;border-radius:7px;background:#fff;padding:7px 9px;font-size:11px}
.yin-next-runs li span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#334155}.yin-next-runs li strong{color:var(--yin-primary)}.yin-next-runs li time{grid-column:1/-1;color:#64748b}
.yin-next-runs__more>summary{width:max-content;cursor:pointer;color:var(--yin-primary);font-size:12px;font-weight:600}.yin-next-runs__more>ol{margin-top:8px}
#schedule-form > .yin-inline-actions{
  margin-top:14px!important;
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px 14px;
  border:1px solid var(--yin-border);
  border-radius:10px;
  background:var(--yin-surface-subtle);
}
#schedule-form > .yin-inline-actions #add-pair{
  background:#fff;
  border-color:#cbd5e1;
  color:#334155;
  box-shadow:none;
}
#schedule-form > .yin-inline-actions #add-pair:hover{background:#f1f5f9}
#schedule-form > .yin-inline-actions label{
  margin-left:4px;
  color:#64748b;
  font-size:12px;
  font-weight:500;
  white-space:nowrap;
}
#schedule-form > .yin-inline-actions label strong{font-weight:500}
#schedule-form > .yin-inline-actions select{
  min-width:260px!important;
  height:38px!important;
  padding:0 34px 0 11px!important;
  border:1px solid #cbd5e1!important;
  border-radius:8px!important;
  background:#fff!important;
  color:#1f2937;
  box-shadow:0 1px 1px rgba(15,23,42,.02);
}
#schedule-form > .yin-inline-actions .btn:not(.secondary){
  min-width:132px;
  box-shadow:none;
}
#schedule-form + .yin-note,
#schedule-form ~ .yin-note{
  margin-top:8px;
  padding:0 2px;
  color:#64748b;
  line-height:1.5;
}

/* Tables: lighter optical weight and cleaner rhythm. */
.yin-discovery-table th,.yin-discovery-table td{font-size:13px}
.yin-discovery-table th{font-weight:500;background:#edf3f8}
.yin-discovery-table td{font-weight:400}
.yin-discovery-table a{font-weight:400}

/* Product + KPI detail */
.yin-product-header{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-top:0}
.yin-product-heading{min-width:0;max-width:1000px}
.yin-product-heading .yin-page-title{margin-top:8px}
.yin-product-meta{display:flex;align-items:center;gap:8px;flex-wrap:wrap;color:#64748b;font-size:13px}
.yin-product-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end;padding-top:24px}
.yin-product-kpis{display:grid;grid-template-columns:repeat(4,minmax(150px,1fr));margin-top:16px;background:#fff;border:1px solid var(--yin-border);border-radius:10px;overflow:hidden}
.yin-product-kpi{display:flex;flex-direction:column;gap:5px;min-height:88px;padding:13px 15px;border-right:1px solid var(--yin-border)}
.yin-product-kpi:last-child{border-right:0}
.yin-product-kpi span{color:#64748b;font-size:12px}
.yin-product-kpi strong{font-family:var(--yin-font-heading);font-size:24px;line-height:1.1;font-weight:500;font-variant-numeric:tabular-nums}
.yin-product-kpi small{color:#64748b;font-size:11px}
.yin-product-overview{margin-top:12px}
.yin-back-link{display:inline-flex;align-items:center;gap:6px;color:#64748b;text-decoration:none;font-size:13px;font-weight:500}
.yin-back-link:hover{color:var(--yin-primary)}
.yin-title-link{color:var(--yin-text);text-decoration:none}
.yin-title-link:hover{color:var(--yin-primary)}
.yin-detail-grid{display:grid;grid-template-columns:1.3fr .8fr 1fr;gap:12px}
.yin-detail-panel{background:var(--yin-surface);border:1px solid var(--yin-border);border-radius:10px;padding:14px 15px;min-width:0}
.yin-detail-panel-title{font-size:12px;text-transform:uppercase;letter-spacing:.045em;color:#64748b;font-weight:500;margin-bottom:10px}
.yin-detail-list{display:flex;flex-direction:column;gap:8px}
.yin-detail-row,.yin-metric-pair{display:flex;align-items:flex-start;justify-content:space-between;gap:18px}
.yin-detail-row span,.yin-metric-pair span{color:#64748b;font-size:12px;white-space:nowrap}
.yin-detail-row strong,.yin-metric-pair strong{font-weight:500;text-align:right;color:#1f2937;min-width:0;overflow-wrap:anywhere}
.yin-metric-pair + .yin-metric-pair{margin-top:10px;padding-top:10px;border-top:1px solid var(--yin-border)}
.yin-metric-pair strong{font-size:20px;line-height:1.1}
.yin-alert-note{border:1px solid #f1d7a8;background:#fffaf0;color:#7c4a03;border-radius:9px;padding:11px 13px;font-size:13px}
.yin-alert-note strong{font-weight:500}
.yin-status{display:inline-flex;align-items:center;justify-content:center;min-height:24px;padding:3px 8px;border:1px solid #dbe3ec;border-radius:999px;background:#f8fafc;color:#475569;font-size:11px;font-weight:500;line-height:1.2;text-align:center}
.yin-status--good{background:#edf8f0;border-color:#b9dfc3;color:#176b35}
.yin-status--review{background:#fff8e6;border-color:#f1d29a;color:#8a5700}
.yin-status--danger{background:#fff1f0;border-color:#fecaca;color:#a61b1b}
.yin-status--neutral{background:#f1f5f9;border-color:#dbe3ec;color:#64748b}
.yin-mono{font-variant-numeric:tabular-nums;white-space:nowrap}
.yin-empty-state{border:1px dashed #cbd5e1;background:var(--yin-surface);border-radius:10px;padding:26px;text-align:center;color:#64748b}
.yin-empty-title{font-weight:500;color:#334155;margin-bottom:4px}
.yin-kpi-detail-table td.yin-wrap{white-space:normal;line-height:1.35}

/* Alerts */
.yin-alerts-table{min-width:1180px}
.yin-alerts-table th{position:static;top:auto;z-index:auto;font-weight:500;background:#edf3f8}
.yin-alerts-table td{vertical-align:middle}
.yin-alerts-table td.yin-wrap{white-space:normal;line-height:1.4}
.yin-severity{display:inline-flex;align-items:center;justify-content:center;min-width:72px;padding:4px 8px;border-radius:999px;font-size:11px;font-weight:500;letter-spacing:.015em;border:1px solid #dbe3ec;background:#f8fafc;color:#475569}
.yin-severity-critical,.yin-severity-error,.yin-severity-high{background:#fff1f0;border-color:#fecaca;color:#a61b1b}
.yin-severity-warning,.yin-severity-warn,.yin-severity-medium{background:#fff8e6;border-color:#f5d59a;color:#8a5700}
.yin-severity-info,.yin-severity-low{background:#eef5ff;border-color:#c9dcfb;color:#315f9f}

@media(max-width:980px){
  .yin-product-header{flex-direction:column;gap:12px}
  .yin-product-actions{padding-top:0;justify-content:flex-start}
  .yin-product-kpis{grid-template-columns:repeat(2,minmax(150px,1fr))}
  .yin-product-kpi:nth-child(2){border-right:0}
  .yin-product-kpi:nth-child(n+3){border-top:1px solid var(--yin-border)}
  .yin-detail-grid{grid-template-columns:1fr 1fr}
  .yin-detail-primary{grid-column:1 / -1}
}
@media(max-width:760px){
  .yin-schedule-flow{grid-template-columns:1fr;gap:7px}
  .yin-schedule-flow li:not(:last-child)::after{display:none}
  .yin-next-runs{grid-template-columns:1fr}.yin-next-runs ol{grid-template-columns:1fr}
  #schedule-form > .yin-inline-actions{align-items:stretch;flex-direction:column}
  #schedule-form > .yin-inline-actions label{margin-left:0;align-self:flex-start}
  #schedule-form > .yin-inline-actions select,
  #schedule-form > .yin-inline-actions .btn{width:100%;min-width:0!important}
  .yin-detail-grid{grid-template-columns:1fr}
  .yin-detail-primary{grid-column:auto}
  .yin-product-actions,.yin-product-actions .btn{width:100%}
  .yin-product-kpis{grid-template-columns:1fr}
  .yin-product-kpi{border-right:0;border-top:1px solid var(--yin-border)}
  .yin-product-kpi:first-child{border-top:0}
}

/* Configurable catalog automation profiles */
.yin-automation-profiles{display:grid;gap:12px}.yin-automation-profiles>.yin-section-header{margin-bottom:0}
.yin-automation-safety{display:flex;gap:10px;align-items:center;padding:11px 13px;border-left:4px solid #0f8a72;background:#edf9f6;color:#315d55;font-size:12px}
.yin-automation-profile{border:1px solid var(--yin-border);border-radius:10px;background:#fff;overflow:hidden}
.yin-automation-profile>summary{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:13px 15px;cursor:pointer;font-weight:700;color:#334155}
.yin-automation-profile>summary:hover{background:#f8fafc}.yin-automation-profile>summary::marker{color:var(--yin-primary)}
.yin-automation-profile-form{display:grid;gap:15px;padding:16px;border-top:1px solid var(--yin-border);background:#fbfdff}
.yin-automation-profile-head{display:flex;align-items:center;justify-content:space-between;gap:16px}.yin-automation-profile-head>div{display:flex;flex-direction:column;gap:3px}.yin-automation-profile-head span{color:#64748b;font-size:12px}
.yin-automation-grid{grid-template-columns:repeat(4,minmax(150px,1fr))}.yin-automation-grid .span-2{grid-column:span 2}.yin-automation-grid input,.yin-automation-grid select{min-height:38px}
.yin-automation-days,.yin-automation-checkpoints{display:flex;flex-wrap:wrap;gap:8px 18px;margin:0;padding:11px 13px;border:1px solid var(--yin-border);border-radius:8px}.yin-automation-days legend,.yin-automation-checkpoints legend{padding:0 5px;color:#475569;font-size:12px;font-weight:700}.yin-automation-days label,.yin-automation-checkpoints label,.yin-switch{display:inline-flex;align-items:center;gap:7px;color:#475569;font-size:12px}.yin-automation-days input,.yin-automation-checkpoints input,.yin-switch input{accent-color:var(--yin-primary)}
.yin-status--active{background:#edf8f0;border-color:#b9dfc3;color:#176b35}.yin-status--muted{background:#edf1f5;color:#64748b}
.yin-process-summary{display:grid;grid-template-columns:repeat(4,minmax(130px,1fr));margin-bottom:16px;border:1px solid var(--yin-border);border-radius:10px;background:#fbfdff;overflow:hidden}
.yin-process-summary>div{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 14px;border-right:1px solid var(--yin-border)}.yin-process-summary>div:last-child{border-right:0}.yin-process-summary span{color:#64748b;font-size:12px}.yin-process-summary strong{font-size:18px;color:#1f2937}
.yin-process-section-head{display:flex;align-items:baseline;justify-content:space-between;gap:14px;margin:0 0 9px}.yin-process-section-head h3{margin:0;font-size:13px;color:#334155}.yin-process-section-head span{color:#64748b;font-size:11px}
.yin-process-list{display:grid;gap:10px}
.yin-process-run{padding:14px 15px;border:1px solid var(--yin-border);border-radius:10px;background:#fff}
.yin-process-run__head,.yin-process-run__foot{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}
.yin-process-run__head>div{display:flex;align-items:baseline;gap:9px;min-width:0}.yin-process-run__identity{align-items:flex-start!important}.yin-process-run__identity>div{display:flex;min-width:0;flex-direction:column;gap:3px}
.yin-process-run__head strong{font-size:13px;color:#1f2937}
.yin-process-run__head div span,.yin-process-run__foot{color:#64748b;font-size:12px}
.yin-process-context{max-width:680px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.yin-process-context b{color:#334155;font-weight:600}.yin-process-toggle{display:grid;place-items:center;width:28px;height:28px;flex:0 0 28px;border:1px solid #cbd5e1;border-radius:7px;background:#fff;color:#475569;cursor:pointer;font-size:18px;line-height:1}.yin-process-toggle:hover{background:#f1f5f9}.yin-process-toggle:focus-visible{outline:3px solid rgba(12,116,184,.2)}
.yin-process-progress-row{display:grid;grid-template-columns:1fr auto;align-items:center;gap:10px;margin:12px 0 10px}.yin-process-progress-row>strong{min-width:38px;color:#334155;font-size:12px;font-variant-numeric:tabular-nums;text-align:right}.yin-process-progress{height:6px;overflow:hidden;border-radius:99px;background:#e8eef4}
.yin-process-progress>span{display:block;height:100%;border-radius:inherit;background:var(--yin-primary);transition:width .2s ease}
.yin-process-stages{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:9px}
.yin-process-stage{display:flex;align-items:center;gap:6px;color:#94a3b8;font-size:11px}
.yin-process-stage i{width:8px;height:8px;border:2px solid #cbd5e1;border-radius:50%;background:#fff}
.yin-process-stage--done{color:#47635d}.yin-process-stage--done i{border-color:#0f8a72;background:#0f8a72}
.yin-process-stage--current{color:#8a5700;font-weight:500}.yin-process-stage--current i{border-color:#d39a2c;background:#fff8e6}
.yin-process-history{margin-top:14px;border-top:1px solid var(--yin-border);padding-top:12px}.yin-process-history>summary{display:flex;align-items:center;gap:8px;width:max-content;cursor:pointer;color:#475569;font-size:12px;font-weight:700}.yin-process-history>summary span{min-width:22px;padding:2px 7px;border-radius:99px;background:#edf1f5;text-align:center}.yin-process-history>.yin-process-list{margin-top:10px}
.yin-help-wrap{position:relative;display:inline-flex;align-items:center}.yin-help{display:inline-grid;place-items:center;width:16px;height:16px;border:1px solid #94a3b8;border-radius:50%;background:#fff;padding:0;color:#475569;font-size:10px;line-height:1;cursor:help}.yin-help:focus-visible{outline:3px solid rgba(12,116,184,.2);outline-offset:2px}.yin-help-popover{position:absolute;z-index:30;left:22px;top:-8px;display:none;width:min(320px,70vw);padding:9px 11px;border:1px solid #b8cee0;border-radius:8px;background:#fff;color:#334155;font-size:12px;font-weight:400;line-height:1.4;box-shadow:0 8px 24px rgba(15,23,42,.14)}.yin-help-wrap:hover .yin-help-popover,.yin-help-wrap:focus-within .yin-help-popover,.yin-help-wrap.is-open .yin-help-popover{display:block}
.yin-table-window{max-height:430px;overflow:auto;border:1px solid var(--yin-border);border-radius:10px}.yin-table-window table{border-collapse:separate;border-spacing:0}.yin-table-window thead th{position:sticky;top:0;z-index:3;background:#f8fafc;box-shadow:0 1px 0 var(--yin-border)}
.yin-input-kind{display:inline-block;width:18px;margin-right:6px;text-align:center}.yin-input-kind:before{content:'🔎'}.yin-input-kind--shop_url:before{content:'🏪'}.yin-input-kind--category_url:before{content:'🗂'}.yin-input-kind--product_url:before{content:'🔗'}
.yin-row-details summary,.yin-run-details summary{cursor:pointer;color:var(--yin-primary);font-weight:600}.yin-row-details a,.yin-row-details small{display:block;margin-top:6px}.yin-row-details small{color:var(--yin-muted)}
.yin-automation-limit{display:block;margin:12px 0;color:#334155;font-weight:600}.yin-automation-days small{display:block;width:100%;margin-top:8px;color:var(--yin-muted)}
.yin-process-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}.yin-process-tabs>details{min-width:0}.yin-process-tabs>details>summary{display:flex;justify-content:space-between;gap:8px;padding:10px 12px;border:1px solid var(--yin-border);border-radius:9px;background:#f8fafc;cursor:pointer;font-weight:700;font-size:12px}.yin-process-tabs>details[open]{grid-column:1/-1}.yin-process-tabs>details[open]>summary{border-color:#91b8af;background:#eff9f6}.yin-process-tabs>details>summary span{padding:1px 7px;border-radius:99px;background:#e2e8f0}.yin-process-window{max-height:600px;overflow:auto;margin-top:10px;padding-right:4px}.yin-run-details{margin-top:10px;border-top:1px solid var(--yin-border);padding-top:8px}.yin-run-details dl{display:grid;grid-template-columns:repeat(4,minmax(120px,1fr));gap:8px}.yin-run-details dl>div{padding:8px;background:#f8fafc;border-radius:7px}.yin-run-details dt{font-size:10px;color:var(--yin-muted);text-transform:uppercase}.yin-run-details dd{margin:3px 0 0;font-size:12px}
.yin-process-controls{display:flex;gap:6px;flex-wrap:wrap}.yin-process-controls .btn{padding:6px 9px;font-size:11px}.yin-process-overview{display:grid;grid-template-columns:repeat(3,minmax(130px,1fr)) auto;align-items:center;margin-bottom:12px;border:1px solid var(--yin-border);border-radius:9px;background:#fbfdff;overflow:hidden}.yin-process-overview>div{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 12px;border-right:1px solid var(--yin-border)}.yin-process-overview span,.yin-process-overview small{color:#64748b;font-size:11px}.yin-process-overview strong{font-size:16px}.yin-process-overview>small{padding:9px 12px;text-align:right}.yin-process-updates{display:grid;grid-template-columns:minmax(220px,1fr) minmax(240px,2fr) auto;align-items:center;gap:12px;margin-bottom:12px;padding:11px 13px;border:1px solid #f1d29a;border-radius:9px;background:#fffaf0}.yin-process-updates[hidden]{display:none}.yin-process-updates>div{display:flex;flex-direction:column;gap:2px}.yin-process-updates small{color:#7c5a20;font-size:11px}.yin-process-updates ul{display:flex;gap:6px;overflow:auto;margin:0;padding:0;list-style:none}.yin-process-updates li button{max-width:320px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border:1px solid #e3c27e;border-radius:7px;background:#fff;padding:6px 8px;color:#5f451a;cursor:pointer;font-size:11px}.yin-process-context-list{display:grid;gap:5px;margin-top:8px;padding:8px;border-radius:7px;background:#f8fafc;color:#475569;font-size:11px}
.yin-result-meta{display:grid;grid-template-columns:repeat(4,minmax(140px,1fr));gap:8px;margin-top:14px}.yin-result-meta>div{padding:10px;border:1px solid var(--yin-border);border-radius:8px;background:#f8fafc}.yin-result-meta dt{color:var(--yin-muted);font-size:11px;text-transform:uppercase}.yin-result-meta dd{margin:4px 0 0;font-size:13px}
@media(prefers-reduced-motion:reduce){.yin-process-progress>span{transition:none}}
@media(max-width:1000px){.yin-automation-grid{grid-template-columns:repeat(2,minmax(180px,1fr))}}
@media(max-width:620px){.yin-automation-grid{grid-template-columns:1fr}.yin-automation-grid .span-2{grid-column:auto}.yin-automation-profile>summary,.yin-automation-profile-head,.yin-automation-safety,.yin-process-run__head,.yin-process-run__foot,.yin-process-section-head{align-items:flex-start;flex-direction:column}.yin-process-summary,.yin-process-tabs{grid-template-columns:1fr 1fr}.yin-process-summary>div:nth-child(2){border-right:0}.yin-process-summary>div:nth-child(-n+2){border-bottom:1px solid var(--yin-border)}.yin-process-stages,.yin-run-details dl,.yin-result-meta{grid-template-columns:1fr}.yin-process-overview,.yin-process-updates{grid-template-columns:1fr}.yin-process-overview>div{border-right:0;border-bottom:1px solid var(--yin-border)}.yin-process-overview>small{text-align:left}.yin-process-updates .btn{width:100%}}
