/* M021 local UI2 tokens; inherited brand and global motion stay unchanged. */
.m021-workspace, .m021-dialog { --m021-blue: #155eef; --m021-green: #248641; --m021-red: #c93430; --m021-action: var(--m021-blue); --m021-ink: #18232d; }
.m021-workspace { width: 100%; height: 100%; min-height: 0; }
.m021-workspace [hidden], .m021-dialog [hidden], .m021-preview [hidden] { display: none !important; }
.m021-action { transition: transform 140ms ease-out, background 140ms; cursor: pointer; }
.m021-action:not(:disabled):active { transform: scale(.98); }
.m021-primary { background: var(--m021-action); color: white; }
.m021-action:disabled { background: #e5e7eb; color: #52606d; cursor: default; }
.m021-action[data-morph='active'] { opacity: 0; }
.m021-observation .obs-title { font-size: 1.125rem; }
.m021-observation .obs-header { flex-wrap: wrap; }
.m021-observation .obs-brand { position: relative; padding-bottom: 8px; }
.m021-observation .obs-brand::after { content: ''; position: absolute; left: 64px; bottom: 0; height: 3px; width: 45px; border-radius: 2px; background: linear-gradient(to right, var(--m021-green) 0 33.333%, var(--m021-blue) 33.333% 66.666%, var(--m021-red) 66.666% 100%); }
.m021-observation .obs-summary { margin: 10px 0 0; }
.m021-observation .obs-context { margin: 0 0 4px; }
.m021-observation .obs-records { scroll-padding-block: 12px; }
.m021-observation .obs-history-capsule { flex-basis: 48px; width: 48px; background: transparent; border-color: transparent; box-shadow: none; }
.m021-observation .obs-history-capsule .obs-icon-button { background: transparent; }
.m021-dialog .m021-record-detail-head { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 8px; }
.m021-record-detail-head h2 { text-align: center; min-width: 0; }
.m021-record-detail-head .m021-action { width: 44px; height: 44px; min-width: 44px; padding: 10px; }
.m021-record-detail-head .m021-revoke-current { color: var(--m021-red); background: transparent; }
.m021-feedback { flex: 0 0 auto; margin: 6px 0; font-size: .8125rem; color: #78350f; max-height: 5em; overflow: auto; }
.m021-recorder { position: relative; flex: 0 0 auto; margin-top: 12px; padding-bottom: max(8px, env(safe-area-inset-bottom, 0px)); }
.m021-record-button { position: relative; width: 100%; padding: 0; border: 0; background: transparent; color: inherit; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: pointer; }
.m021-record-button:focus-visible { outline: 2px solid #005fcc; outline-offset: 3px; border-radius: 24px; }
.m021-record-surface { display: grid; align-content: center; justify-items: center; gap: 2px; width: 100%; height: max(72px, 4.5rem); padding: 8px; border-radius: 22px; background: #e5e7eb; color: #18232d; box-shadow: 0 5px 14px rgb(24 35 45 / 10%); transform: scale(1); transition: transform 140ms ease-out; }
.m021-recorder[data-held='true'] .m021-record-surface { transform: scale(.98); transition-duration: 80ms; }
.m021-record-label { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 1.125rem; line-height: 1.35; font-weight: 600; min-width: 0; }
.m021-record-icon { display: flex; flex: 0 0 auto; }
.m021-record-icon svg { width: 22px; height: 24px; }
.m021-slide-hint { position: absolute; bottom: 6px; font-size: .75rem; line-height: 1.2; visibility: hidden; }
.m021-recorder[data-held='true'] .m021-slide-hint { visibility: visible; }
.m021-wave { display: none; height: 16px; }
.m021-recorder[data-phase='preparing'] .m021-record-surface { background: #fef3c7; color: #78350f; }
.m021-recorder[data-phase='starting'] .m021-record-surface { background: #ede9fe; color: #5b21b6; }
.m021-recorder[data-phase='ready'] .m021-record-surface { background: #155eef; color: white; }
.m021-recorder[data-phase='recording'] .m021-record-surface { background: radial-gradient(ellipse at 50% 50%, #0756b3 10%, #0866d9 70%, #77cafc 140%); color: white; box-shadow: none; }
.m021-recorder[data-phase='recording'] .m021-wave { display: flex; }
.m021-recorder[data-phase='recording'] .m021-record-surface { padding-top: 6px; padding-bottom: calc(.75rem + 10px); }
.m021-recorder[data-phase='recording'] .m021-record-label { font-size: .8125rem; }
.m021-recorder[data-phase='starting'] .m021-record-surface { padding-bottom: calc(.75rem + 10px); }
.m021-recorder[data-phase='cancelled'] .m021-record-surface, .m021-recorder[data-phase='cancel-error'] .m021-record-surface { background: #fee2e2; color: #991b1b; }
.m021-recorder[data-phase='cancelled'] .m021-slide-hint, .m021-recorder[data-phase='cancel-error'] .m021-slide-hint { visibility: hidden; }
.m021-cancel-boundary { position: fixed; z-index: 5; pointer-events: none; border: 1px dashed #155eef; border-radius: 24px; }
/* Transparent overflow, not a reserved panel: records remain behind the splashes. */
.m021-recorder[data-paint='true'] { --m021-paint-air: clamp(96px, 22svh, 192px); isolation: isolate; z-index: 2; background: transparent; }
.m021-paint-canvas { position: absolute; left: 0; top: calc(-1 * var(--m021-paint-air)); width: 100%; height: calc(100% + var(--m021-paint-air)); pointer-events: none; z-index: 0; background: transparent; }
.m021-recorder[data-paint='true'] .m021-record-button { z-index: 1; box-shadow: none; }
.m021-recorder[data-paint='true'] .m021-cancel-boundary { display: none; }
.m021-recorder[data-paint='true'] .m021-record-surface { transform: scale(var(--m021-paint-sx, 1), var(--m021-paint-sy, 1)); transform-origin: var(--m021-paint-ox, 50%) var(--m021-paint-oy, 50%); transition: none; box-shadow: inset 0 0 0 1px rgb(24 35 45 / 8%); }
.m021-recorder[data-paint='true'] .m021-record-label { transform: scale(var(--m021-paint-ix, 1), var(--m021-paint-iy, 1)); }
.m021-recorder[data-paint='true']:is([data-phase='ready'],[data-phase='starting'],[data-phase='recording'],[data-phase='saving']) .m021-record-surface { background: transparent; color: #18232d; }
.m021-recorder[data-paint='true'][data-phase='ready'] .m021-record-surface,
.m021-recorder[data-paint='true'][data-phase='starting'] .m021-record-surface { color: #fff; }
.m021-recorder[data-paint='true'][data-phase='recording'] .m021-wave { display: none; }
.m021-recorder[data-paint='true'][data-phase='recording'] .m021-record-label { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.m021-recorder[data-paint='true'] .m021-record-icon { color: inherit; }
.m021-recorder[data-paint='true'][data-phase='recording'] .m021-record-icon { color: #248641; }
.m021-recorder[data-paint='true']:is([data-phase='recording'],[data-phase='saving']) .m021-record-label { background: #fff; border-radius: 20px; padding: 4px 12px; }
.m021-recorder[data-paint='true'][data-phase='recording'] .m021-slide-hint { background: #fff; padding: 1px 5px; border-radius: 6px; }
.m021-recorder[data-paint='true'][data-phase='recording'] .m021-record-surface { padding: 8px; }
.m021-recorder[data-paint='true'][data-phase='recording'] .m021-record-icon,
.m021-recorder[data-paint='true'][data-phase='recording'] .m021-slide-hint { display: none; }
.m021-recorder[data-cancel-armed='true'] .m021-record-label { color: #b42318; }
.m021-recorder[data-paint='true'][data-cancel-armed='true'] .m021-slide-hint { display: block; visibility: visible; color: #b42318; }
.m021-recorder[data-paint='true'][data-cancel-armed='true'] .m021-record-surface { padding-bottom: 24px; }
.m021-recorder[data-paint='true'][data-phase='cancelled'] .m021-record-surface { background: transparent; color: #18232d; }
.m021-recorder[data-phase='recording'] .m021-record-label { font-variant-numeric: tabular-nums; }
.m021-recorder[data-phase='recording'][data-cancel-armed='false'] .m021-record-label { visibility: hidden; }
.m021-floating-time { position: absolute; z-index: 4; transform: translate(-50%, -100%); pointer-events: none; white-space: nowrap; padding: 4px 12px; border-radius: 20px; background: #fff; color: #18232d; font-size: 1.5rem; line-height: 1.35; font-weight: 600; font-variant-numeric: tabular-nums; }
.m021-recorder[data-cancel-armed='true'] .m021-floating-time { color: #b42318; }
.m021-recorder[data-phase='cancelled'] .m021-record-label { visibility: hidden; }
.m021-recorder[data-paint='true'][data-phase='cancelled'] .m021-record-icon { display: none; }
.m021-card-review { position: relative; isolation: isolate; border-color: #c48b38; }
.m021-card-pigment-review { z-index: -1; opacity: .12; }
.m021-paint-space { height: 0; pointer-events: none; transition: height 220ms cubic-bezier(.2,.75,.2,1); }
.m021-observation[data-paint-flow='true'] .obs-records { --record-gutter-bottom: 0px; }
.m021-paint-card { position: relative; isolation: isolate; height: clamp(112px, 20svh, 176px); min-height: 72px; border-radius: 22px; flex-shrink: 0; }
.m021-card-pigment { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: -1; }
.m021-paint-card-number { position: absolute; top: 12px; left: 14px; padding: 3px 8px; border-radius: 12px; background: #fffffff0; color: #18232d; font-size: .8125rem; }
.m021-paint-card-label { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); margin: 0; padding: 7px 14px; border-radius: 18px; background: #fffffff0; color: #18232d; font-size: 1rem; white-space: nowrap; }
.m021-card-revealing { position: relative; overflow: hidden; }
.m021-card-pigment-completing { z-index: 2; }
.m021-card-revealing > :not(canvas) { animation: m021-ink-reveal 460ms ease-out both; }
@keyframes m021-ink-reveal { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .m021-paint-space { transition: none; } .m021-card-revealing > :not(canvas) { animation: none; } }
.m021-card { padding: 8px 14px 12px; scroll-margin-top: 12px; flex: 0 0 auto; }
.m021-card-meta { display: flex; align-items: center; min-height: 44px; gap: 8px; font-size: .8125rem; color: var(--kdl-text-secondary); }
.m021-card-meta > span { flex: 1; }
.m021-sequence { color: var(--m021-blue); font-weight: 500; }
.m021-icon, .m021-pencil { min-height: 44px; width: 44px; padding: 10px; background: transparent; color: #52606d; }
.m021-icon { padding: 9px; }
.m021-pencil { display: inline-flex; vertical-align: middle; align-items: center; justify-content: center; margin-left: 2px; color: var(--m021-green); }
.m021-pencil:not(:disabled):active, .m021-pencil:focus-visible { background: #edf7ef; }
.m021-card .obs-record-text-content { margin: 0; }
.m021-card .obs-player { margin-top: 6px; }
.m021-card .obs-play-button { color: var(--m021-red); background: #fcefed; }
.m021-card .obs-play-track { background: #efc7c5; }
.m021-card .obs-play-fill { background: var(--m021-red); }
.m021-card .obs-play-track::before { background: var(--m021-red); left: var(--m021-play-position, 0%); transform: translateX(-50%); }
.m021-card .obs-duration { color: #52606d; }
.m021-record-status { color: #52606d; font-size: .75rem; margin: 6px 0 0; }
.m021-revoked { background: #eef1f2; }
.m021-card-exiting { overflow: hidden; pointer-events: none; transform-origin: 50% 0; will-change: height, opacity, transform; }
.m021-just-edited { outline: 2px solid #155eef; outline-offset: -2px; background: #eff6ff; }
.m021-edited-marker { display: none; color: #20763a; font-size: .8125rem; font-weight: 600; }
.m021-just-edited .m021-edited-marker { display: block; }
.m021-dialog .m021-dialog-body { padding: 16px; gap: 12px; }
.m021-dialog-head { display: flex; flex-shrink: 0; justify-content: space-between; align-items: center; gap: 8px; }
.m021-dialog-head h2 { font-size: 1.125rem; }
.m021-dialog-head button { width: 44px; min-height: 44px; flex: 0 0 44px; padding: 10px; }
.m021-dialog p { margin: 0; }
.m021-dialog .obs-text-editor { min-height: 100px; height: 160px; flex: 0 0 auto; resize: none; }
.m021-dialog::backdrop { background: transparent; }
.m021-dialog .m021-dialog-head h2:focus { outline: none; }
html[data-m021-input='pointer'] .m021-workspace :focus,
html[data-m021-input='pointer'] .m021-dialog button:focus { outline: none; }
.m021-workspace button, .m021-dialog button { -webkit-tap-highlight-color: transparent; }
.m021-keyboard-dialog .obs-text-editor { min-height: 64px; flex-shrink: 1; }
.m021-edit-dialog.obs-dialog { background: #fff; border: 1px solid #fff; color: #18232d; }
@supports (backdrop-filter: blur(16px)) or (-webkit-backdrop-filter: blur(16px)) {
  .m021-edit-dialog.obs-dialog { background: rgba(255,252,254,.92); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
}
.m021-edit-dialog::backdrop { background: transparent; }
.m021-edit-dialog .m021-dialog-body { padding: 12px; gap: 10px; }
.m021-edit-dialog .m021-dialog-head { border-bottom: 1px solid #dce1e5; padding-bottom: 10px; }
.m021-edit-dialog .m021-dialog-head h2 { flex: 1; text-align: center; font-size: 1rem; line-height: 1.4; }
.m021-edit-dialog .m021-dialog-head button { border-radius: 50%; background: #eceef0; color: #18232d; box-shadow: none; height: 44px; }
.m021-edit-dialog .m021-dialog-head .m021-save-edit { color: #155eef; background: #e8efff; }
.m021-edit-dialog .m021-dialog-head button:disabled { color: #627080; background: #eceef0; }
.m021-edit-dialog .obs-text-editor { border: 0; border-radius: 0; background: transparent; padding: 6px; color: #18232d; min-height: 80px; flex-shrink: 1; }
.m021-edit-dialog .obs-text-editor:focus-visible { outline: none; box-shadow: inset 2px 0 #155eef; }
.m021-edit-dialog .m021-edit-note { color: #52606d; font-size: .75rem; padding: 0 6px 2px; }
@media (prefers-reduced-transparency: reduce), (forced-colors: active) {
  .m021-edit-dialog.obs-dialog { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
.m021-dialog .m021-dialog-body > * { animation: none; }
.m021-dialog .m021-original, .m021-history-entry { white-space: pre-wrap; overflow-wrap: anywhere; }
.m021-history-entry { padding-block: 10px; border-top: 1px solid #dce1e5; font-size: .875rem; }
.m021-choices { display: flex; flex-direction: column; min-height: 0; gap: 8px; max-height: 24rem; overflow-y: auto; overflow-x: hidden; padding: 2px; }
.m021-choice { display: grid; flex: 0 0 auto; grid-template-rows: auto auto; gap: 4px; text-align: left; background: #f7f8f6; }
.m021-choice strong { font-size: .8125rem; }
.m021-choice span { display: block; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .875rem; }
.m021-error { color: #b42318; }
.m021-end-pending { display: grid; gap: 8px; }
.m021-ended { height: 100%; padding: 24px 16px; overflow: auto; text-align: center; }
.m021-ended h2 { margin-top: 40px; }
.m021-ended > button { display: block; width: 100%; margin-top: 16px; }
.m021-exports { display: flex; flex-direction: column; height: 100%; min-height: 0; background: var(--kdl-canvas); }
.m021-exports:not([hidden]) { animation: obs-sheet-enter 380ms var(--obs-land, ease-out) both; }
.m021-export-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; flex: 0 0 auto; gap: 8px; }
.m021-export-head h2 { font-size: 1.25rem; margin: 0; }
.m021-export-list { overflow: auto; flex: 1 1 0; padding: 0 16px max(20px, env(safe-area-inset-bottom)); overscroll-behavior: contain; }
.m021-export-card { border: 1px solid #dce1e5; border-radius: 24px; background: white; padding: 20px; margin: 12px 0; overflow-wrap: anywhere; }
.m021-exports:not([hidden]) .m021-export-card { animation: obs-card-enter 360ms ease-out both; }
.m021-exports:not([hidden]) .m021-export-card:nth-child(2) { animation-delay: 70ms; }
.m021-exports:not([hidden]) .m021-export-card:nth-child(3) { animation-delay: 140ms; }
.m021-exports:not([hidden]) .m021-export-card:nth-child(4) { animation-delay: 210ms; }
.m021-export-card { --m021-export-accent: #7c858f; }
.m021-export-card[data-export-kind='ledger'] { --m021-export-accent: var(--m021-blue); }
.m021-export-card[data-export-kind='audio'] { --m021-export-accent: var(--m021-red); }
.m021-export-card[data-export-kind='confirm'] { --m021-export-accent: var(--m021-green); }
.m021-export-card h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 1rem; }
.m021-export-card h3::before { content: ''; width: 3px; height: 16px; flex: 0 0 3px; border-radius: 2px; background: var(--m021-export-accent); }
.m021-export-card h3 svg { width: 18px; height: 20px; color: var(--m021-export-accent); }
.m021-export-status { margin: 0 0 6px; font-weight: 600; color: #18232d; font-size: .875rem; }
.m021-export-detail { color: #52606d; font-size: .875rem; margin: 0 0 16px; line-height: 1.6; }
.m021-export-card > button { width: 100%; min-height: 48px; }
.m021-export-boundary { color: #52606d; font-size: .8125rem; }
.m021-preview .preview-notice { background: #e8f2f7; }
.m021-preview .preview-notice p { margin: 0; font-size: .75rem; }
.m021-preview .demo-panel > * { max-width: 100%; }
.m021-preview .demo-panel select { width: 100%; min-height: 48px; font: inherit; }
.m021-test-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
@media (orientation: landscape) and (max-height: 480px) and (min-width: 640px) {
  [data-fixed] .m021-observation { display: flex; }
  .m021-observation .obs-summary { font-size: .75rem; display: flex; gap: 16px; }
  .m021-recorder { width: 50%; align-self: center; margin-top: 4px; }
  .m021-recorder[data-paint='true'] { --m021-paint-air: 44px; }
  .m021-record-surface { height: max(64px, calc(4.5rem - 8px)); }
}
@media (max-width: 339px) { .m021-observation .obs-brand::after { left: 44px; } }
@media (prefers-reduced-motion: reduce) { .m021-action, .m021-record-surface { transition: none !important; } .m021-wave i, .m021-exports:not([hidden]), .m021-exports:not([hidden]) .m021-export-card { animation: none; } }
