/* RESON History: scoped to the existing history view and its shared shell. */
body:has(#songs.active){
  background:radial-gradient(ellipse at 84% 10%,rgba(73,230,207,.055),transparent 45%),#05090c;
  color:#eef5f4;
}
body:has(#songs.active) .main{
  max-width:1460px;padding:0 clamp(24px,4.8vw,76px) 80px;
  font-family:Arial,"PingFang SC","Microsoft YaHei",sans-serif;
}
body:has(#songs.active) .topbar{height:94px;min-height:94px;border-bottom:1px solid rgba(161,205,198,.13)}
body:has(#songs.active) .crumb{font:10px/1.5 "JetBrains Mono",monospace;letter-spacing:.18em;color:#839893}
body:has(#songs.active) .crumb:before{content:"";display:inline-block;width:5px;height:5px;margin-right:11px;border-radius:50%;background:#49e6cf;box-shadow:0 0 12px #49e6cf;vertical-align:1px}
body:has(#songs.active) #gem-stage{opacity:.24;filter:saturate(.55)}
#songs.active{
  --history-line:rgba(161,205,198,.14);--history-muted:#91a5a1;--history-accent:#49e6cf;
  display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:24px;row-gap:0;
  padding-top:0;max-width:100%;
}
#songs .detail-head{display:contents}
#songs .detail-head>div:first-child{grid-column:1/-1;grid-row:1;padding:52px 0 34px;min-width:0}
#songs .detail-title{margin:0;font:600 clamp(46px,5.2vw,76px)/1.06 "Instrument Sans","PingFang SC","Microsoft YaHei",sans-serif;letter-spacing:-.055em;color:#eef5f4}
#songs .detail-lead{max-width:620px;margin:19px 0 0;color:var(--history-muted);font-size:15px;line-height:1.8}
#songs .history-tabs{grid-column:1;grid-row:2;display:flex;align-items:stretch;gap:28px;min-height:54px;margin:0;border-bottom:1px solid var(--history-line)}
#songs .history-tab{
  position:relative;margin:0 0 -1px;padding:16px 0;border:0;border-bottom:2px solid transparent;border-radius:0;
  background:transparent;box-shadow:none;color:#91a5a1;font-family:inherit;font-size:14px;font-weight:500;line-height:1.4;white-space:nowrap;
}
#songs .history-tab.active{border-color:var(--history-accent);color:#c4fbed;background:transparent}
#songs .history-tab:hover{color:#e4f6f0;background:transparent}
#songs .detail-actions{grid-column:2;grid-row:2;display:flex;justify-content:flex-end;gap:10px;min-width:0;align-self:center;margin:0 0 10px;flex-wrap:nowrap}
#songs .search-field,#songs .select-field{
  height:44px;margin:0;border:1px solid rgba(161,205,198,.2);border-radius:2px;box-shadow:none;
  background:rgba(8,18,22,.94);color:#dfece8;font:12px/1.5 Arial,"PingFang SC","Microsoft YaHei",sans-serif;
}
#songs .search-field{width:clamp(200px,23vw,300px);min-width:0;padding:0 15px}
#songs .search-field::placeholder{color:#7b918c}
#songs .select-field{width:124px;padding:0 12px;color-scheme:dark}
#songs .search-field:focus,#songs .select-field:focus{border-color:#49e6cf;outline:2px solid rgba(73,230,207,.12);outline-offset:2px}
#songs #analysisHistoryPanel,#songs #creationHistoryPanel{grid-column:1/-1;grid-row:3;min-width:0}
#songs .stats-row{display:flex;gap:0;align-items:center;flex-wrap:wrap;margin:20px 0 22px}
#songs .stats-row[hidden]{display:none}
#songs .stat-pill{margin:0;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;color:#a7bbb5;font-size:12px;line-height:1.7}
#songs .stat-pill+.stat-pill{margin-left:17px;padding-left:17px;border-left:1px solid var(--history-line);color:#839892}
#songs .module-card.history-table{
  padding:0;border:0;border-radius:0;background:rgba(5,12,15,.5);box-shadow:none;
  backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);
}
#songs .history-table>.section-title{display:none}
#songs .history-head,#songs .history-item{
  grid-template-columns:minmax(180px,1.8fr) minmax(120px,.85fr) minmax(65px,.5fr) minmax(85px,.6fr) minmax(154px,auto);
  gap:20px;align-items:center;
}
#songs .history-head{display:grid;padding:13px 14px;border-top:1px solid var(--history-line);border-bottom:1px solid var(--history-line);color:#839892;font:10px/1.5 "JetBrains Mono",monospace;letter-spacing:.06em}
#songs .history-item{padding:19px 14px;border:0;border-bottom:1px solid var(--history-line);border-radius:0;background:transparent;color:#bdcdc7;font-size:12px;transition:background .18s ease}
#songs .history-item:hover,#songs .creation-history-row:hover{background:rgba(73,230,207,.035)}
#songs .history-item>span{display:block;min-width:0;font-size:12px;line-height:1.6}
#songs .history-item>span:nth-child(2){color:#91a5a1;font-variant-numeric:tabular-nums}
#songs .history-song{min-width:0;gap:15px}
#songs .history-song b{display:block;min-width:0;color:#edf6f2;font-size:15px;font-weight:500;line-height:1.5}
#songs .history-cover,#songs .history-item:nth-child(n) .history-cover{
  position:relative;display:grid;place-items:center;width:42px;height:42px;flex:0 0 42px;
  border:1px solid rgba(73,230,207,.17);border-radius:3px;background:#0c1c1e;
}
#songs .history-cover:before{content:"";width:24px;height:24px;border:1px solid rgba(73,230,207,.5);border-radius:50%;background:radial-gradient(circle,#91e8d8 0 2px,#163b38 2.5px 5px,#081316 5.5px 8px,#214541 8.5px 9px,#081316 9.5px)}
#songs .status-complete{color:#66c9af}
#songs .history-actions{gap:14px;justify-content:flex-end}
#songs .open-result,#songs .creation-history-actions .open-creation{
  display:inline-flex;align-items:center;justify-content:center;min-height:36px;padding:8px 13px;
  border:1px solid rgba(73,230,207,.35);border-radius:2px;background:rgba(73,230,207,.055);
  color:#b7f4e5;font-size:12px;font-weight:500;text-decoration:none;line-height:1.4;white-space:nowrap;box-shadow:none;
}
#songs .open-result:hover,#songs .creation-history-actions .open-creation:hover{border-color:#49e6cf;background:rgba(73,230,207,.14);color:#e5fff6}
#songs .history-delete,#songs .creation-history-actions .history-delete{
  min-height:36px;padding:7px 3px;border:1px solid transparent;border-radius:2px;background:transparent;color:#91a5a1;font-size:12px;line-height:1.4;
}
#songs .history-delete:hover,#songs .creation-history-actions .history-delete:hover{border-color:transparent;color:#f2a5aa;background:rgba(228,107,124,.055)}
#songs button:focus-visible,#songs a:focus-visible{outline:2px solid #49e6cf;outline-offset:4px}
#songs .history-state{padding:64px 20px;border:1px solid var(--history-line);border-radius:2px;background:rgba(8,18,22,.48);color:#91a5a1;font-size:13px;line-height:1.8}
#songs .history-state[hidden]{display:none}
#songs .history-state strong{margin-bottom:9px;color:#e2f0e9;font-size:17px;font-weight:500}
#songs #creationHistoryPanel{padding-top:23px}
#songs #creationHistoryPanel .history-table>p{margin:0 0 22px!important;color:#91a5a1!important;font-size:12px!important;line-height:1.7}
#songs .creation-history-row{grid-template-columns:minmax(190px,1.55fr) minmax(120px,.8fr) minmax(145px,.8fr) minmax(250px,auto);gap:20px;padding:23px 14px;border-top:0;border-bottom:1px solid var(--history-line);font-size:12px;transition:background .18s ease}
#songs .creation-history-row:first-child{border-top:1px solid var(--history-line)}
#songs .creation-history-row>div:first-child{min-width:0}
#songs .creation-history-row strong{color:#edf6f2;font-size:15px;font-weight:500;line-height:1.5}
#songs .creation-history-row small{max-width:480px;margin-top:7px;color:#91a5a1;font-size:12px;line-height:1.7}
#songs .creation-history-row>span{display:block;color:#91a5a1;font-size:12px;line-height:1.65}
#songs .creation-history-actions{gap:12px}
#songs .creation-history-actions button,#songs .creation-history-actions a{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:36px;padding:7px 3px;border:1px solid transparent;border-radius:2px;background:transparent;color:#a7c5ba;font-size:12px;line-height:1.4;white-space:nowrap;text-decoration:none}
#songs .creation-history-actions button:hover,#songs .creation-history-actions a:hover{color:#dcfff2;border-color:transparent;background:rgba(73,230,207,.06)}
#songs .creation-history-actions .open-creation{padding:8px 12px;border-color:rgba(73,230,207,.35);background:rgba(73,230,207,.055);color:#b7f4e5}
#songs .creation-history-more{margin:28px auto 0;padding:12px 23px;border:1px solid rgba(73,230,207,.3);border-radius:2px;background:transparent;color:#b7f4e5;font-size:12px}
#songs .creation-history-more:hover{border-color:#49e6cf;background:rgba(73,230,207,.08)}
@media(max-width:1100px){
  #songs .history-head,#songs .history-item{grid-template-columns:minmax(160px,1.45fr) minmax(112px,.85fr) 72px 85px minmax(150px,auto);gap:14px}
  #songs .history-head span:nth-child(4),#songs .history-item>span:nth-child(4){display:block}
  #songs .creation-history-row{grid-template-columns:minmax(160px,1fr) minmax(114px,.7fr) minmax(140px,.7fr);gap:12px}
  #songs .creation-history-actions{grid-column:1/-1;justify-content:flex-end}
}
@media(max-width:900px){
  #songs.active{grid-template-columns:minmax(0,1fr)}
  #songs .history-tabs{grid-column:1;grid-row:2}
  #songs .detail-actions{grid-column:1;grid-row:3;width:100%;justify-content:flex-start;margin:17px 0 0}
  #songs .search-field{width:auto;flex:1}
  #songs #analysisHistoryPanel,#songs #creationHistoryPanel{grid-row:4}
  #songs .history-head,#songs .history-item{grid-template-columns:minmax(165px,1.5fr) minmax(120px,1fr) 72px minmax(142px,auto);gap:15px}
  #songs .history-head span:nth-child(4),#songs .history-item>span:nth-child(4){display:none}
}
@media(max-width:760px){
  body:has(#songs.active) .main{padding:0 18px 54px}
  body:has(#songs.active) .topbar{height:124px;min-height:124px;align-items:flex-end;padding-bottom:12px}
  body:has(#songs.active) .topbar .crumb{display:block;position:absolute;left:0;bottom:19px;font-size:9px;letter-spacing:.12em}
  body:has(#songs.active) .topbar>.top-actions{width:auto;margin-left:auto;gap:6px}
  body:has(#songs.active) .topbar .reson-dock{top:34px}
  body:has(#songs.active) .top-actions .task-indicator{display:flex;width:32px;min-width:32px;height:32px;padding:0;justify-content:center}
  body:has(#songs.active) .task-indicator .task-compact-copy{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  body:has(#songs.active) .task-indicator .task-compact-percent,body:has(#songs.active) .task-indicator .task-view-compact{display:none}
  body:has(#songs.active) .task-popover{position:fixed;top:132px;left:18px;right:18px;width:auto;max-width:none}
  body:has(#songs.active) .reson-account-menu summary{max-width:124px;font-size:11px}
  body:has(#songs.active) #gem-stage{opacity:.18}
  #songs .detail-head>div:first-child{padding:34px 0 25px}
  #songs .detail-title{font-size:58px;letter-spacing:-.065em}
  #songs .detail-lead{margin-top:16px;font-size:13px;line-height:1.85}
  #songs .history-tabs{gap:26px;min-height:50px}
  #songs .history-tab{font-size:13px;padding:14px 0}
  #songs .detail-actions{gap:8px}
  #songs .search-field{width:0;height:44px;font-size:12px;padding:0 12px}
  #songs .select-field{width:108px;height:44px;padding:0 8px;font-size:11px}
  #songs .stats-row{margin:17px 0;gap:7px 0}
  #songs .stat-pill{font-size:11px}
  #songs .stat-pill+.stat-pill{margin-left:11px;padding-left:11px}
  #songs .history-head{display:none}
  #songs .history-item{grid-template-columns:minmax(0,1fr) auto;gap:12px 16px;padding:21px 4px}
  #songs .history-item:first-child{border-top:1px solid var(--history-line)}
  #songs .history-song{grid-column:1/-1;grid-row:1;gap:12px}
  #songs .history-song b{white-space:normal;overflow-wrap:anywhere;font-size:15px;line-height:1.55}
  #songs .history-item>span:nth-child(2){display:block;grid-column:1;grid-row:2;font-size:11px}
  #songs .history-item>span:nth-child(3){display:block;grid-column:2;grid-row:2;text-align:right;font-size:11px}
  #songs .history-item>span:nth-child(4){display:block;grid-column:1;grid-row:3;font-size:12px}
  #songs .history-item .history-actions{grid-column:2;grid-row:3;gap:15px}
  #songs .open-result,#songs .history-delete{font-size:11px}
  #songs #creationHistoryPanel{padding-top:20px}
  #songs .creation-history-row{grid-template-columns:minmax(0,1fr) auto;padding:21px 4px;gap:12px 10px}
  #songs .creation-history-row>div:first-child{grid-column:1/-1;grid-row:1}
  #songs .creation-history-row strong{white-space:normal;overflow-wrap:anywhere;font-size:15px}
  #songs .creation-history-row small{font-size:12px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;white-space:normal;overflow:hidden;overflow-wrap:anywhere}
  #songs .creation-history-row>span:nth-child(2){display:block;grid-column:1;grid-row:2;font-size:11px}
  #songs .creation-history-row>span:nth-child(3){display:block;grid-column:2;grid-row:2;text-align:right;font-size:11px}
  #songs .creation-history-actions{grid-column:1/-1;grid-row:3;justify-content:flex-start;gap:10px 18px}
  #songs .creation-history-actions button,#songs .creation-history-actions a{font-size:11px}
  #songs .history-state{padding:46px 16px}
}
@media(prefers-reduced-motion:reduce){#songs .history-item,#songs .creation-history-row{transition:none}}
