.result,.editor { padding:clamp(16px,3vw,30px); border:1px solid #373c43; border-radius:14px; margin-bottom:1rem; }
.result { background:#171d24; }
.result h2 { display:flex; flex-wrap:wrap; align-items:baseline; gap:.2rem .6rem; }
.result small { color:#aebcc7; font-size:.85rem; font-weight:500; }
#ranking { list-style:none; padding:0; margin:0; }
#ranking li { display:grid; grid-template-columns:3.2em minmax(90px,1fr) minmax(60px,2fr) 3em; align-items:center; gap:.7rem; margin:.8rem 0; }
#ranking em { font-style:normal; font-weight:700; color:var(--text-3); font-size:.9rem; }
#ranking li.top em { color:var(--accent); }
#ranking span { overflow-wrap:anywhere; font-weight:600; }
#ranking i { border-radius:8px; height:.65rem; background:linear-gradient(to right,#9fb9c3 var(--fraction),#323e48 var(--fraction)); }
#ranking li.top i { background:linear-gradient(to right,#e3a64a var(--fraction),#323e48 var(--fraction)); }
#ranking b { text-align:right; font-size:1.05rem; }
.editor { background:#15151a; }
.scroll { max-width:100%; overflow-x:auto; }
table { border-collapse:collapse; width:100%; }
th,td { padding:.4rem; border-bottom:1px solid #363941; text-align:left; vertical-align:middle; }
td:first-child,th { white-space:nowrap; }
td:first-child,th:nth-child(n+3) { min-width:150px; }
select { min-width:3.7rem; }
table input { width:calc(100% - 3rem); min-width:85px; }
table button.remove { width:40px; min-height:40px; padding:0; margin-left:.3rem; font-size:1.15rem; line-height:1; color:var(--text-2); }
.actions { display:flex; flex-wrap:wrap; gap:.5rem; margin-top:1rem; }
#empty:empty,#note:empty { display:none; }
#note { color:var(--accent); }
/* 폰: 표 대신 선택지 이름 줄 + 기준마다 카드 */
@media (max-width:620px) {
  #ranking li { grid-template-columns:2.6em minmax(0,1fr) 3em; gap:.25rem .6rem; }
  #ranking i { grid-column:2 / 4; grid-row:2; }
  #ranking b { grid-column:3; grid-row:1; }
  .scroll { overflow:visible; }
  table, thead, tbody, tr, th, td { display:block; }
  td:first-child, th { white-space:normal; min-width:0 !important; }
  thead tr { display:grid; grid-template-columns:1fr; gap:.5rem; padding-bottom:.8rem; border-bottom:1px solid #363941; }
  thead th { padding:0; border:0; }
  thead th:nth-child(-n+2) { display:none; }
  thead th:nth-child(n+3) { display:flex; align-items:center; }
  thead th input, td:first-child input { flex:1; width:auto; min-width:0; }
  thead th:first-child { display:block; }
  tbody tr { display:grid; grid-template-columns:repeat(auto-fill,minmax(92px,1fr)); gap:.5rem .6rem; padding:.9rem 0; border-bottom:1px solid #363941; }
  tbody td { padding:0; border:0; }
  tbody td:first-child { grid-column:1 / -1; display:flex; align-items:center; }
  tbody td:first-child input { font-weight:600; }
  tbody td[data-label]::before { content:attr(data-label); display:block; font-size:.8rem; color:var(--text-3); margin:0 0 .25rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  tbody td:nth-child(2)::before { color:var(--accent); }
  tbody select { width:100%; }
}
[data-theme="light"] .result { background:#eef3f7;border-color:#c9d5de; }
[data-theme="light"] .editor { background:var(--surface);border-color:var(--border); }
[data-theme="light"] .result small { color:#485c6c; }
[data-theme="light"] #ranking i { background:linear-gradient(to right,#7fa1ae var(--fraction),#d5dee5 var(--fraction)); }
[data-theme="light"] #ranking li.top i { background:linear-gradient(to right,#d98e1f var(--fraction),#d5dee5 var(--fraction)); }
[data-theme="light"] #ranking li.top em, [data-theme="light"] #note { color:#b45309; }
[data-theme="light"] th, [data-theme="light"] td, [data-theme="light"] thead tr, [data-theme="light"] tbody tr { border-color:var(--border); }
[data-theme="light"] input[type=text], [data-theme="light"] select { background:#fff; color:var(--text); }
@media (max-width:620px) {
  thead th:first-child { font-size:0; }
  thead th:first-child::after { content:attr(data-phone); font-size:.82rem; }
}
[data-theme="light"] button.primary { color:#fff; }
