#view-royalties { min-width: 0; }
.royalty-hero { display: flex; align-items: center; gap: 14px; margin: 14px 0 18px; }
.royalty-hero h2, .royalty-panel h3, .royalty-editor h2 { margin: 0; color: var(--black); }
.royalty-hero h2 { font-size: clamp(27px, 4vw, 39px); line-height: 1.1; }
.royalty-hero p, .royalty-section-head p, .royalty-editor header p { margin: 5px 0 0; font-size: 12px; color: var(--muted); }
.royalty-emblem, .royalty-kpi-icon { display: grid; place-items: center; flex-shrink: 0; }
.royalty-emblem { width: 50px; height: 50px; border-radius: 17px; background: var(--yellow); color: #17140b; }
.royalty-emblem svg { width: 26px; height: 26px; }
.royalty-link { display: inline-flex; align-items: center; gap: 6px; justify-content: center; min-height: 34px; padding: 5px 10px;
  border: 1px solid var(--line); border-radius: 10px; color: var(--black); background: var(--white); font: inherit; font-weight: 720; font-size: 12px; }
.royalty-link svg { width: 15px; height: 15px; flex: 0 0 15px; }
.royalty-link:hover, .royalty-cluster:hover { border-color: color-mix(in srgb, var(--black) 32%, transparent); }
.royalty-filters { display: grid; grid-template-columns: .62fr 1fr 1fr 1.65fr; gap: 10px; margin-bottom: 14px; }
.royalty-filters label, .royalty-editor label { display: grid; min-width: 0; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 720; }
.royalty-filters select, .royalty-search, .royalty-editor input, .royalty-editor select {
  width: 100%; min-width: 0; min-height: 40px; border: 1px solid var(--line); border-radius: 11px;
  background: var(--white); color: var(--black); font: inherit; padding: 7px 10px;
}
.royalty-status { color: var(--muted); font-size: 13px; margin: 14px 0; }
.royalty-status:empty { display: none; }
#view-royalties [data-results] { display: grid; gap: 14px; }
.royalty-kpis { display: grid; grid-template-columns: 1.15fr 1fr 1fr 1fr; gap: 10px; }
.royalty-kpi, .royalty-panel { min-width: 0; background: var(--white); border: 1px solid var(--line); border-radius: 18px; color: var(--black); }
.royalty-kpi { display: grid; align-content: start; gap: 5px; padding: 12px 14px 14px; }
.royalty-kpi-icon { width: 30px; height: 30px; border-radius: 9px; background: var(--soft-yellow); color: var(--black); margin-bottom: 3px; }
.royalty-kpi-icon svg { width: 18px; height: 18px; }
.royalty-kpi > span:nth-child(2) { font-weight: 770; font-size: 12px; }
.royalty-kpi strong { font-size: clamp(18px, 2.6vw, 27px); font-weight: 875; line-height: 1.18; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.royalty-kpi small, .royalty-breakdown, .royalty-legend { color: var(--muted); font-size: 11px; line-height: 1.4; }
.royalty-kpi-primary { color: #17140b; background: var(--yellow); border-color: transparent; }
.royalty-kpi-primary .royalty-kpi-icon { background: #17140b; color: #ffdb42; }
.royalty-kpi-primary small { color: #504312; }
.royalty-panel { padding: 16px; }
.royalty-section-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.royalty-panel h3 { font-size: 16px; line-height: 1.25; }
.royalty-legend { display: flex; flex-wrap: wrap; gap: 8px; }
.royalty-legend span { display: inline-flex; gap: 5px; align-items: center; }
.royalty-legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--yellow); }
.royalty-legend span + span i { background: var(--soft); border: 1px dashed var(--muted); }
.royalty-chart-scroll { overflow-x: auto; scrollbar-width: thin; padding: 3px 0 5px; }
.royalty-chart { display: grid; grid-template-columns: 47px minmax(0,1fr); min-width: 470px; --plot: 151px; }
.royalty-axis { display: flex; flex-direction: column; justify-content: space-between; padding-right: 6px;
  height: var(--plot); text-align: right; font-size: 10px; color: var(--muted); }
.royalty-columns { position: relative; display: grid; grid-template-columns: repeat(12,minmax(0,1fr)); gap: 3px; }
.royalty-columns::before { position: absolute; z-index: 0; pointer-events: none; content: ''; inset: 0 0 auto; height: var(--plot);
  background: linear-gradient(to top, transparent var(--zero), var(--line) var(--zero), var(--line) calc(var(--zero) + 1px), transparent calc(var(--zero) + 1px));
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.royalty-columns button { isolation: isolate; display: grid; align-content: start; gap: 5px; padding: 0; margin: 0; color: var(--muted);
  background: transparent; border: 0; border-radius: 7px; font: inherit; font-size: 11px; }
.royalty-columns button[aria-pressed="true"] { background: var(--soft-yellow); color: var(--black); font-weight: 820; }
.royalty-track { position: relative; height: var(--plot); }
.royalty-bar { display: block; position: absolute; width: min(31%,18px); left: calc(50% - min(31%,18px)); bottom: var(--bottom);
  height: var(--height); min-height: 2px; border-radius: 5px 5px 2px 2px; background: var(--yellow); }
.royalty-bar-plan { left: calc(50% + 2px); background: var(--soft); border: 1px dashed var(--muted); }
.royalty-month-label { padding: 3px 0 5px; }
.royalty-breakdown { display: flex; flex-wrap: wrap; gap: 7px 18px; border-top: 1px solid var(--line); margin-top: 7px; padding-top: 9px; }
.royalty-breakdown b { margin-left: 4px; color: var(--black); }
.royalty-empty { color: var(--muted); padding: 12px 3px; margin: 0; font-size: 13px; }
.royalty-cluster-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,170px),1fr)); gap: 8px; }
.royalty-cluster { min-width: 0; padding: 10px 12px; text-align: left; border: 1px solid var(--line); border-radius: 12px;
  display: grid; gap: 6px; color: var(--black); background: var(--soft); font: inherit; font-size: 12px; }
.royalty-cluster small { float: right; color: var(--muted); }
.royalty-cluster strong { font-size: 16px; }
.royalty-cluster i { display: block; background: var(--line); height: 4px; border-radius: 4px; overflow: hidden; }
.royalty-cluster i b { display: block; background: var(--yellow); width: var(--size); height: 100%; }
.royalty-search { max-width: 230px; font-size: 12px; }
.royalty-table { width: 100%; border-spacing: 0; text-align: right; font-variant-numeric: tabular-nums; font-size: 12px; }
.royalty-table th, .royalty-table td { padding: 9px 8px; border-bottom: 1px solid var(--line); }
.royalty-table th:first-child { text-align: left; }
.royalty-table thead th { font-size: 11px; color: var(--muted); }
.royalty-table tbody th { font-weight: 600; }
.royalty-table th small { display: block; margin-top: 3px; font-size: 10px; color: var(--muted); }
.royalty-table td { white-space: nowrap; }
.royalty-fee-split, .royalty-plan-note { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.royalty-plan-note { max-width: 16ch; margin-left: auto; white-space: normal; }
.royalty-shop { border: 0; background: transparent; color: var(--black); font: inherit; font-weight: 770; padding: 0; text-align: left; }
.royalty-shop:hover { text-decoration: underline; }
.royalty-more { margin-top: 10px; }
.royalty-method { padding-top: 11px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.royalty-method summary { cursor: pointer; }
.royalty-method p { margin: 6px 0 0; }
.royalty-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); }
.royalty-editor { width: min(580px, calc(100vw - 18px)); max-height: calc(100dvh - 20px); padding: 16px;
  border: 1px solid var(--line); border-radius: 20px; background: var(--white); color: var(--black); }
.royalty-editor::backdrop { background: rgba(14,14,15,.62); }
.royalty-editor header { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; }
.royalty-editor header h2 { font-size: 22px; }
.royalty-editor [data-close], .royalty-editor [data-remove] { width: 34px; height: 34px; font-size: 18px; padding: 0; flex-shrink: 0; }
.royalty-editor-tabs { display: flex; gap: 4px; padding: 4px; margin: 13px 0; background: var(--soft); border-radius: 12px; }
.royalty-editor-tabs button { flex: 1; border: 0; min-height: 35px; background: transparent; color: var(--black); border-radius: 9px; font: inherit; font-size: 13px; }
.royalty-editor-tabs button[aria-pressed="true"] { background: var(--yellow); color: #17140b; font-weight: 820; }
.royalty-editor-body, .royalty-editor-body form { display: grid; gap: 11px; }
.royalty-editor-pair, .royalty-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; align-items: end; }
.royalty-fields { grid-template-columns: 1.35fr minmax(70px,.65fr) 34px; margin: 7px 0; }
.royalty-editor input, .royalty-editor select { font-size: 16px; }
.royalty-editor fieldset { min-width: 0; padding: 8px; margin: 0; border: 1px solid var(--line); border-radius: 12px; }
.royalty-editor fieldset > label { margin-bottom: 7px; }
.royalty-editor legend { font-size: 12px; font-weight: 805; padding: 0 4px; }
.royalty-editor-body p, .royalty-editor-status { font-size: 12px; color: var(--muted); margin: 0; line-height: 1.45; }
.royalty-contract { display: grid; gap: 8px; }
.royalty-contract h3 { margin: 0; color: var(--black); font-size: 15px; }
.royalty-contract table { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.royalty-contract th, .royalty-contract td { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: left; }
.royalty-editor-status:not(:empty) { padding: 10px 0 0; color: var(--black); }
.royalty-save { justify-self: start; padding: 8px 13px; min-height: 39px; border: 0; border-radius: 11px;
  background: var(--yellow); color: #17140b; font: inherit; font-size: 13px; font-weight: 850; }
.royalty-save:disabled { opacity: .65; }
#view-royalties :focus-visible, .royalty-editor :focus-visible { outline: 2px solid var(--black); outline-offset: 2px; }
@media (max-width: 700px) {
  .royalty-filters, .royalty-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .royalty-filters select { font-size: 16px; }
  .royalty-chart { min-width: 0; grid-template-columns: 34px minmax(0,1fr); --plot: 133px; }
  .royalty-columns { gap: 1px; }
  .royalty-columns button, .royalty-axis { font-size: 9px; }
  .royalty-table thead { display: none; }
  .royalty-table, .royalty-table tbody { display: block; }
  .royalty-table tr { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; border-bottom: 1px solid var(--line); padding: 8px 0; }
  .royalty-table th, .royalty-table td { border: 0; padding: 0; text-align: left; white-space: normal; }
  .royalty-table th, .royalty-table .royalty-table-action { grid-column: 1 / -1; }
  .royalty-table td[data-label] { overflow-wrap: anywhere; }
  .royalty-plan-note { margin-left: 0; }
  .royalty-table td[data-label]::before { display: block; color: var(--muted); font-size: 10px; content: attr(data-label); margin-bottom: 2px; }
  .royalty-table-action { margin-top: 3px; }
  .royalty-directory .royalty-section-head { align-items: flex-start; flex-direction: column; }
  .royalty-search { max-width: none; }
}
@media (max-width: 390px) {
  .royalty-panel, .royalty-kpi { padding: 11px; }
  .royalty-kpi strong { font-size: 17px; }
}
