.od-dialog {
  --od-surface: var(--premium-surface, #fffdfb);
  --od-border: var(--premium-border, #e6e1ee);
  --od-muted: var(--premium-muted, #7e778e);
  --od-accent: var(--premium-accent, #6c50bd);
  --od-text: var(--premium-text, #29233a);
  --od-wash: color-mix(in srgb, var(--od-accent) 6%, var(--od-surface));
  width: 100%; max-width: 1100px; height: 100%; max-height: 100dvh; margin: auto; padding: 0;
  border: 0; border-radius: 24px; background: var(--od-surface); color: var(--od-text);
  box-shadow: 0 28px 100px #19102744; overflow: hidden;
}
.od-dialog::backdrop { background: #1a142c7a; backdrop-filter: blur(8px); }
.od-dialog[open] { animation: od-reveal .3s cubic-bezier(.18,.78,.3,1) both; }
.od-shell { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.od-dialog *, .od-dialog *::before, .od-dialog *::after { box-sizing: border-box; }
.od-dialog [hidden] { display: none !important; }
.od-dialog button { min-width: 0; min-height: 40px; margin: 0; padding: 9px 13px; border: 1px solid var(--od-border); border-radius: 12px; background: var(--od-surface); color: var(--od-text); box-shadow: none; font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; transition: background .18s, border-color .18s, transform .18s; }
.od-dialog button:hover { background: var(--od-wash); border-color: var(--od-accent); }
.od-dialog button:active { transform: scale(.97); }
.od-dialog button:focus-visible, .od-dialog input:focus-visible, .od-dialog select:focus-visible, .od-dialog summary:focus-visible { outline: 3px solid color-mix(in srgb, var(--od-accent) 65%, transparent); outline-offset: 3px; }
.od-dialog button.od-primary { background: var(--od-accent); color: white; border-color: var(--od-accent); }
.od-header { display: flex; align-items: center; justify-content: space-between; flex: 0 0 auto; gap: 12px; padding: 23px 26px 18px; border-bottom: 1px solid var(--od-border); background: linear-gradient(120deg, var(--od-wash), var(--od-surface)); }
.od-eyebrow { display: block; font-size: 9px; font-weight: 750; letter-spacing: .21em; color: var(--od-muted); margin-bottom: 6px; }
.od-header h2 { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; margin: 0; font-size: 25px; letter-spacing: -.04em; }
.od-header h2 span { color: var(--od-muted); font-size: 11px; font-weight: 450; letter-spacing: .04em; }
.od-dialog .od-close { width: 42px; height: 42px; min-width: 42px; border-radius: 50%; font-size: 26px; line-height: 1; font-weight: 400; padding: 0; }
.od-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 22px 26px 28px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.od-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.od-stats > div { padding: 10px 12px; border: 1px solid var(--od-border); border-radius: 13px; background: linear-gradient(130deg, var(--od-surface), var(--od-wash)); min-width: 0; }
.od-stats span, .od-stats small { display: block; color: var(--od-muted); font-size: 11px; }
.od-stats strong { display: block; color: var(--od-text); font-size: clamp(18px, 2.5vw, 25px); font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.05em; line-height: 1.25; margin: 5px 0 0; overflow-wrap: anywhere; }
.od-stats small { font-size: 10px; }
.od-top-actions { display: flex; gap: 9px; flex-wrap: wrap; margin: 12px 0; }
.od-view-switch { margin-left: auto; display: flex; padding: 3px; border: 1px solid var(--od-border); border-radius: 13px; background: var(--od-wash); }
.od-view-switch button { min-height: 34px; border: 0; padding: 6px 14px; background: transparent; border-radius: 9px; color: var(--od-muted); }
.od-view-switch button[aria-pressed="true"] { background: var(--od-surface); color: var(--od-accent); box-shadow: 0 2px 5px #1710200a; }
.od-filters { padding: 15px; border: 1px solid var(--od-border); border-radius: 18px; background: var(--od-wash); }
.od-dialog label { display: flex; flex-direction: column; gap: 6px; color: var(--od-muted); font-size: 11px; margin: 0; }
.od-dialog input:not([type="checkbox"]), .od-dialog select { width: 100%; min-width: 0; height: 41px; min-height: 41px; padding: 8px 10px; border: 1px solid var(--od-border); border-radius: 10px; color: var(--od-text); background: var(--od-surface); font: inherit; font-size: 13px; }
.od-search input { padding-left: 13px !important; font-size: 14px !important; }
.od-filter-details { margin-top: 8px; }
.od-filter-details > summary { min-height: 29px; cursor: pointer; color: var(--od-muted); font-size: 11px; line-height: 29px; }
.od-filter-details > summary b { float: right; font-size: 10px; font-weight: 450; }
.od-filter-details > summary b.od-filter-active { color: var(--od-accent); font-weight: 650; }
.od-filter-grid { display: grid; grid-template-columns: 1fr 1.4fr 1fr 1fr 1fr; gap: 9px; margin-top: 13px; }
.od-quick-dates { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.od-quick-dates button { min-height: 33px; border-radius: 8px; padding: 6px 10px; font-size: 11px; }
.od-quick-dates button:last-child { margin-left: auto; background: transparent; color: var(--od-muted); }
.od-hint { color: var(--od-muted); font-size: 10px; margin: 10px 0 0; line-height: 1.6; }
.od-hint.od-error { color: #b4483c; }
.od-result-head { display: flex; justify-content: space-between; align-items: center; gap: 9px; margin: 12px 0 9px; }
.od-result-head > div { display: flex; gap: 5px; }
.od-result-head h3 { margin: 0; color: var(--od-muted); font-size: 12px; font-weight: 600; }
.od-result-head button { font-size: 11px; min-height: 34px; padding: 5px 9px; }
.od-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.od-order { min-width: 0; padding: 16px; background: var(--od-surface); border: 1px solid var(--od-border); border-radius: 18px; box-shadow: 0 4px 14px #21163204; transition: border-color .2s, box-shadow .2s; }
.od-order.od-selected { border-color: var(--od-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--od-accent) 12%, transparent); }
.od-card-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.od-dialog label.od-select, .od-dialog label.od-done { display: inline-flex; flex-direction: row; align-items: center; flex-shrink: 0; min-height: 36px; gap: 6px; cursor: pointer; color: var(--od-muted); font-size: 11px; }
.od-dialog input[type="checkbox"] { width: 18px; height: 18px; min-width: 18px; padding: 0; margin: 0; accent-color: var(--od-accent); }
.od-state { background: var(--od-wash); color: var(--od-accent); padding: 5px 8px; font-size: 10px; font-weight: 650; border-radius: 7px; line-height: 1.3; }
.od-state-late { background: #fff0e9; color: #a44a28; }
.od-dialog .od-card-title { display: block; border: 0; padding: 5px 0 10px; width: 100%; min-height: 0; text-align: left; border-radius: 3px; background: transparent; }
.od-card-title strong { display: block; color: var(--od-text); font-size: 19px; line-height: 1.35; letter-spacing: -.03em; overflow-wrap: anywhere; }
.od-card-title span { display: block; margin-top: 5px; font-size: 11px; font-weight: 450; color: var(--od-muted); overflow-wrap: anywhere; }
.od-card-dates { display: flex; gap: 20px; padding: 11px 0; border-top: 1px solid var(--od-border); border-bottom: 1px solid var(--od-border); }
.od-card-dates span { min-width: 0; }
.od-card-dates small { display: block; font-size: 9px; color: var(--od-muted); margin-bottom: 4px; }
.od-card-dates b { font-size: 11px; font-weight: 550; font-variant-numeric: tabular-nums; }
.od-card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.od-card-tags span { padding: 3px 6px; border: 1px solid var(--od-border); border-radius: 5px; font-size: 10px; color: var(--od-muted); overflow-wrap: anywhere; }
.od-card-tags .od-balance { color: #a57338; }
.od-card-note { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--od-muted); font-size: 11px; line-height: 1.7; margin: 10px 0 0; overflow-wrap: anywhere; }
.od-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 11px; }
.od-card-actions > div { display: flex; gap: 4px; }
.od-card-actions button { min-height: 34px; padding: 5px 7px; font-size: 10px; border-radius: 7px; }
.od-completed-group { margin-top: 17px; background: var(--od-wash); border: 1px solid var(--od-border); border-radius: 16px; overflow: hidden; }
.od-completed-group summary { padding: 16px; cursor: pointer; color: var(--od-muted); font-size: 12px; }
.od-completed-group summary small { float: right; font-size: 10px; }
.od-completed-group .od-cards { padding: 0 12px 12px; }
.od-complete .od-state { background: #eaf3ec; color: #4e785a; }
.od-complete .od-card-title strong { color: var(--od-muted); }
.od-compact-list { display: grid; gap: 5px; }
.od-order.od-compact-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) 68px 34px; align-items: center; gap: 8px; min-height: 64px; padding: 7px 10px; border-radius: 11px; }
.od-dialog .od-compact-main { min-width: 0; min-height: 44px; padding: 0; border: 0; border-radius: 4px; background: transparent; text-align: left; }
.od-compact-main strong, .od-compact-main span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.od-compact-main strong { font-size: 14px; line-height: 1.45; }
.od-compact-main span { font-size: 10px; color: var(--od-muted); font-weight: 450; margin-top: 4px; }
.od-compact-date { text-align: right; font-variant-numeric: tabular-nums; }
.od-compact-date b, .od-compact-date small { display: block; }
.od-compact-date b { font-size: 12px; font-weight: 650; }
.od-compact-date small { font-size: 9px; margin-top: 4px; color: var(--od-muted); }
.od-compact-date small.od-compact-late { color: #ad593b; }
.od-dialog label.od-compact-done { flex-direction: column; justify-content: center; gap: 3px; font-size: 9px; }
.od-completed-group .od-compact-list { padding: 0 8px 8px; }
.od-compact-row.od-complete { background: color-mix(in srgb, #78a583 8%, var(--od-surface)); }
.od-compact-row.od-complete .od-compact-main strong { color: var(--od-muted); }
.od-dialog.od-focus .od-stats, .od-dialog.od-focus .od-top-actions, .od-dialog.od-focus .od-filters, .od-dialog.od-focus .od-templates { display: none !important; }
.od-dialog.od-focus .od-scroll { padding-top: 0; }
.od-dialog.od-focus .od-result-head { position: sticky; top: 0; z-index: 1; background: var(--od-surface); padding: 8px 0; margin-top: 0; }
.od-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 12px; }
.od-lane { min-width: 0; background: var(--od-wash); padding: 9px; border-radius: 17px; border: 1px solid var(--od-border); }
.od-lane h4 { display: flex; justify-content: space-between; align-items: center; margin: 5px 3px 13px; font-size: 12px; font-weight: 650; }
.od-lane h4::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--od-accent); margin-right: 7px; }
.od-lane h4 span { margin-left: auto; min-width: 23px; padding: 3px; border-radius: 5px; background: var(--od-surface); text-align: center; font-size: 10px; }
.od-lane-1 h4::before { background: #c6904d; }
.od-lane-2 h4::before { background: #5c9983; }
.od-lane > div { display: grid; gap: 9px; }
.od-lane .od-order { padding: 11px; border-radius: 12px; }
.od-lane .od-card-title strong { font-size: 16px; }
.od-lane .od-card-actions { flex-wrap: wrap; }
.od-lane-empty { text-align: center; padding: 20px 0; color: var(--od-muted); font-size: 11px; }
.od-batch { background: var(--od-wash); border: 1px solid var(--od-accent); border-radius: 14px; margin-bottom: 15px; padding: 13px; }
.od-batch > div { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.od-batch > div:first-child { justify-content: space-between; }
.od-batch strong { color: var(--od-accent); font-size: 12px; }
.od-batch button { font-size: 11px; min-height: 35px; padding: 6px 9px; }
.od-batch-actions { margin-top: 11px; }
.od-batch-actions label { flex-direction: row; align-items: center; margin-left: auto; }
.od-batch-actions input[type="number"] { width: 58px; height: 35px; min-height: 35px; }
.od-batch small { display: block; margin-top: 10px; color: var(--od-muted); font-size: 10px; line-height: 1.6; }
.od-templates { background: var(--od-wash); border: 1px solid var(--od-border); padding: 15px; border-radius: 16px; margin-bottom: 17px; }
.od-section-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.od-section-title h3 { margin: 0; font-size: 15px; }
.od-section-title button { min-height: 32px; font-size: 11px; padding: 5px 8px; }
.od-templates p { font-size: 11px; color: var(--od-muted); line-height: 1.7; }
.od-template { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 13px 0; border-bottom: 1px solid var(--od-border); }
.od-template > div:first-child { min-width: 0; }
.od-template strong, .od-template small { display: block; overflow-wrap: anywhere; }
.od-template strong { font-size: 13px; }
.od-template small { color: var(--od-muted); font-size: 10px; margin-top: 5px; }
.od-template > div:last-child { display: flex; gap: 4px; flex-shrink: 0; }
.od-template button { min-height: 34px; font-size: 10px; padding: 5px 8px; }
.od-template-tip { margin-bottom: 0; }
.od-empty { text-align: center; border: 1px dashed var(--od-border); border-radius: 19px; padding: 37px 20px; color: var(--od-muted); }
.od-empty > span { display: block; font-size: 31px; margin-bottom: 12px; color: var(--od-accent); }
.od-empty h4 { margin: 0; color: var(--od-text); font-size: 16px; }
.od-empty p { font-size: 12px; line-height: 1.8; max-width: 300px; margin: 10px auto 0; }
.od-live { flex: 0 0 auto; color: var(--od-accent); background: var(--od-wash); border-top: 1px solid var(--od-border); padding: 10px 20px max(10px, env(safe-area-inset-bottom)); font-size: 12px; line-height: 1.8; margin: 0; }
.od-live:empty { display: none; }
@keyframes od-reveal { from { opacity: 0; transform: translateY(18px) scale(.987); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (min-width: 1101px) { .od-dialog { max-height: min(900px, 94dvh); } }
@media (max-width: 700px) {
  .od-dialog { max-width: none; max-height: 100dvh; border-radius: 0; }
  .od-header { padding: max(12px, env(safe-area-inset-top)) 17px 11px; }
  .od-header h2 { font-size: 22px; }
  .od-header h2 span { font-size: 10px; }
  .od-scroll { padding: 12px 15px max(25px, env(safe-area-inset-bottom)); }
  .od-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .od-stats > div { padding: 9px 7px; border-radius: 11px; }
  .od-stats span { font-size: 9px; white-space: nowrap; }
  .od-stats strong { font-size: 19px; margin: 4px 0 0; }
  .od-stats > div:last-child strong { font-size: 16px; line-height: 24px; }
  .od-top-actions { gap: 6px; margin: 10px 0; }
  .od-top-actions > button { font-size: 12px; padding: 8px 11px; }
  .od-view-switch button { padding: 6px 11px; font-size: 12px; }
  .od-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .od-filter-grid > label:nth-child(3) { grid-column: 1 / -1; }
  .od-filters { padding: 10px 11px 5px; }
  .od-cards { grid-template-columns: 1fr; }
  .od-board { grid-template-columns: 1fr; }
  .od-lane > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .od-lane-empty { grid-column: 1 / -1; }
  .od-lane .od-card-dates { gap: 8px; flex-wrap: wrap; }
  .od-lane .od-card-dates b { font-size: 10px; }
  .od-lane .od-card-top { flex-wrap: wrap; }
  .od-lane .od-selection-label { display: none; }
  .od-template { align-items: flex-start; flex-wrap: wrap; }
}
@media (max-width: 370px) {
  .od-header h2 span { display: none; }
  .od-top-actions { gap: 6px; }
  .od-top-actions > button { padding: 8px 10px; font-size: 12px; }
  .od-view-switch button { padding: 6px 10px; }
  .od-lane > div { grid-template-columns: 1fr; }
  .od-batch-actions label { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .od-dialog[open] { animation: none; }
  .od-dialog button, .od-order { transition: none; }
}
body.animations-off .od-dialog[open], body.no-animations .od-dialog[open] { animation: none; }
