.wrap{
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px;
}
h1{
  margin: 8px 0 14px;
}
.hint{
  color: var(--muted);
  font-size: 13px;
  margin: -4px 0 12px;
}
.tbl{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 6px 0 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.tbl th,.tbl td{
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
.tbl th{
  background: var(--card-2);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}
.tbl tr:last-child td{
  border-bottom: 0;
}
.tbl-sm th,.tbl-sm td{
  padding: 8px 10px;
}
.mono{
  font-variant-numeric: tabular-nums;
}
.tag{
  display: inline-block;
  padding: .2rem .5rem;
  border-radius: 8px;
  border: 1px solid var(--pill-border);
  background: var(--pill-bg);
  font-size: 12px;
}
.btn{
  appearance: none;
  border: 1px solid var(--line);
  background: var(--pill-bg);
  color: inherit;
  padding: .45rem .7rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
.btn:hover{
  filter: brightness(1.05);
}
.btn-ghost{
  background: transparent;
  border: 0;
  font-size: 18px;
  line-height: 1;
}
.btn--green{
  background: #16a34a;
  color: #fff;
  border: 1px solid #15803d;
}
.btn--green:hover{
  background: #15803d;
}
.btn--block{
  display: block;
  width: 100%;
}
.thumb{
  display: block;
  width: 56px;
  height: auto;
  aspect-ratio: 63 / 88;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--card-2), var(--card));
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.imgcell{
  width: 78px;
}
.tleft{
  font-weight: 600;
}
.tleft.soon{
  color: #b26b00;
}
.tleft.urgent{
  color: #b00020;
}
.modal[hidden]{
  display: none;
}
.modal{
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 1000;
}
.modal__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.35);
  backdrop-filter: saturate(120%) blur(2px);
}
.modal__panel{
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  width: min(96vw,760px);
  max-height: 86vh;
  overflow: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
  max-width: 840px;
}
.modal__header,.modal__footer{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.modal__footer{
  border-top: 1px solid var(--line);
  border-bottom: 0;
}
.modal__body{
  padding: 12px 14px;
}
.subhead{
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}
.thumb--lg{
  width: 96px;
  aspect-ratio: 63/88;
  height: auto;
}
.hist-mobile{
  display: block;
}
.hist-mobile__meta{
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}
.hist-meta-title{
  font-size: clamp(1.1rem, 2.2vw, 1.5rem);
  font-weight: 800;
  margin-top: 4px;
}
.hist-meta-sub{
  color: var(--muted);
  font-size: .98rem;
}
#hist-chart{
  display: block;
  width: 100%;
  height: 220px;
  background: radial-gradient(120% 100% at 50% -10%, rgba(255,255,255,.08), transparent 40%),
    var(--chart-bg);
  border-radius: 14px;
  outline: 1px solid var(--chart-outline);
  box-shadow: 0 8px 28px var(--chart-shadow);
  overflow: hidden;
}
.hist-table{
  display: table;
}
.hist-grid{
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}
.hist-grid__row{
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-2);
}
.hist-chip{
  font-size: 12px;
}
.hist-chip.mono{
  font-variant-numeric: tabular-nums;
}
.stack > section{
  margin-bottom: 16px;
}
.modal__body .hist-mobile__meta{
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  margin-bottom: 10px;
}
.modal__body .hist-mobile__meta .thumb{
  width: clamp(160px, 30vw, 240px);
  height: auto;
}
.modal__header{
  justify-content: center !important;
  position: relative;
}
.modal__header .btn-ghost{
  position: absolute;
  right: 10px;
  top: 8px;
}
#hist-title{
  font-weight: 800;
  text-align: center;
}
.hist-meta-countdown{
  margin-top: 4px;
  font-weight: 700;
}
#hist-modal .modal__header{
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center !important;
}
#hist-modal #hist-title{
  display: block;
  margin: 0;
  width: 100%;
  text-align: center;
  font-weight: 800;
}
#hist-modal .modal__header .btn-ghost{
  position: absolute;
  right: 10px;
  top: 8px;
}
:root{
  --chart-bg: #531f36;
  --chart-outline: rgba(255,255,255,.12);
  --chart-shadow: rgba(0,0,0,.35);
}
#hist-modal .hist-table thead th:nth-child(2), #hist-modal .hist-table thead th:nth-child(3), #hist-modal .hist-table thead th:nth-child(4){
  text-align: center;
}
#hist-modal .hist-table thead th:first-child{
  text-align: left;
}
#hist-modal .hist-table tbody td:first-child{
  text-align: left !important;
}
#hist-modal .hist-table tbody td:nth-child(2), #hist-modal .hist-table tbody td:nth-child(3), #hist-modal .hist-table tbody td:nth-child(4){
  text-align: center !important;
}
#hist-modal .hist-table{
  width: 100%;
  min-width: 0 !important;
  table-layout: fixed;
  border-collapse: collapse;
}
#hist-modal .hist-table th, #hist-modal .hist-table td{
  min-width: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.modal__footer .btn.btn--block{
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.btn--lg{
  font-size: 1.125rem;
  padding: 0.9rem 1rem;
  line-height: 1.2;
}
#hist-modal.modal{
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
}
#hist-modal.modal.is-open{
  display: grid !important;
}
body.modal-open{
  overflow: hidden;
}
#hist-modal .modal__backdrop{
  position: absolute;
  inset: 0;
}
#hist-modal .modal-dialog{
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 24px);
  overflow: hidden;
}
#hist-modal .modal-content, #hist-modal .hist-body, #hist-modal .hist-table-wrapper{
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 640px){
.wrap{
  padding: 14px;
}
.tbl thead{
  display: none;
}
.tbl, .tbl tbody, .tbl tr, .tbl td{
  display: block;
  width: 100%;
}
.tbl tr{
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.tbl tr:last-child{
  border-bottom: 0;
}
.tbl td{
  padding: 6px 0;
  border: 0;
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 8px;
  align-items: start;
  word-break: break-word;
}
.tbl td::before{
  content: attr(data-th);
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
}
.tag{
  font-size: 12px;
}
.imgcell .thumb{
  width: 72px;
}
.thumb--lg{
  width: 92px;
}
#hist-chart{
  height: 180px;
}
.hist-table{
  display: none;
}
.hist-grid{
  display: grid;
}
}

@media (max-width: 640px){
.hist-table{
  display: table !important;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.hist-table thead{
  display: table-header-group !important;
}
.hist-table tbody{
  display: table-row-group !important;
}
.hist-table tr{
  display: table-row !important;
}
.hist-table th, .hist-table td{
  display: table-cell !important;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
}
@media (max-width: 640px){
  .hist-table{ table-layout: fixed;
  text-align: right;
  font-variant-numeric: tabular-nums;
  }

  
  .hist-table th:nth-child(3),
  .hist-table td:nth-child(3){
    width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: normal;
  }

  
  .hist-table th, .hist-table td{ padding: 8px 8px;
}
.hist-table td::before{
  content: none !important;
}
.hist-grid{
  display: none !important;
}
}

@media (max-width: 640px){
.modal__body .hist-mobile__meta .thumb{
  width: clamp(150px, 55vw, 220px);
}
}

@media (max-width: 640px){
#hist-modal .hist-table th, #hist-modal .hist-table td{
  width: auto !important;
  padding: 8px 6px;
  font-size: 0.95rem;
}
#hist-modal .hist-table th:nth-child(1), #hist-modal .hist-table td:nth-child(1){
  width: 38% !important;
  text-align: left !important;
  white-space: normal;
}
#hist-modal .hist-table th:nth-child(2), #hist-modal .hist-table td:nth-child(2){
  width: 22% !important;
  text-align: center !important;
  white-space: nowrap;
}
#hist-modal .hist-table th:nth-child(3), #hist-modal .hist-table td:nth-child(3){
  width: 25% !important;
  text-align: center !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
}
#hist-modal .hist-table th:nth-child(4), #hist-modal .hist-table td:nth-child(4){
  width: 15% !important;
  text-align: center !important;
  white-space: nowrap;
}
#hist-modal .hist-table td:nth-child(3).mono{
  white-space: normal !important;
}
}

@media (max-width: 640px){
#hist-modal .hist-table th:nth-child(4), #hist-modal .hist-table td:nth-child(4){
  width: 18% !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: normal;
  text-align: center !important;
  padding-left: 4px;
  padding-right: 4px;
  font-size: .95rem;
  line-height: 1.15;
}
#hist-modal .hist-table th:nth-child(1), #hist-modal .hist-table td:nth-child(1){
  width: 38% !important;
}
#hist-modal .hist-table th:nth-child(2), #hist-modal .hist-table td:nth-child(2){
  width: 22% !important;
}
#hist-modal .hist-table th:nth-child(3), #hist-modal .hist-table td:nth-child(3){
  width: 22% !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
}
}

@media (max-width: 640px){
#hist-modal .hist-table th:nth-child(1), #hist-modal .hist-table td:nth-child(1){
  width: 32% !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
  line-height: 1.15;
}
#hist-modal .hist-table th:nth-child(2), #hist-modal .hist-table td:nth-child(2){
  width: 22% !important;
  text-align: center !important;
  white-space: nowrap;
}
#hist-modal .hist-table th:nth-child(3), #hist-modal .hist-table td:nth-child(3){
  width: 28% !important;
  text-align: center !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
}
#hist-modal .hist-table th:nth-child(4), #hist-modal .hist-table td:nth-child(4){
  width: 18% !important;
  text-align: center !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
  line-height: 1.15;
}
}

@media (max-width: 760px){
.tbl td{
  position: relative;
}
.tbl td::before{
  pointer-events: none;
  z-index: 0;
}
.tbl td > *{
  position: relative;
  z-index: 1;
}}