/* Base */
html, body {
      margin: 0;
      padding: 0;
      -webkit-text-size-adjust: 100%;
    }
    body {
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
                   Roboto, "Noto Sans KR", sans-serif;
      background: #f5f5f7;
      color: #111827;
    }
    .app {
      min-height: 100vh;
      display: flex;
      flex-direction: column;
    }

    .app-header {
      padding-top: 18px;
      padding-left: 24px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 6px;
    }
    .header-left {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }
    .app-title {
      font-size: 16px;
      font-weight: 700;
    }

    .header-icons {
      display: flex;
      gap: 4px;
    }

.icon-btn {
  border: none;
  background: transparent;
  padding: 0 4px;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}
.icon-btn:active {
  transform: scale(0.96);
}

    .app-content {
      padding: 8px 12px 20px;
      flex: 1;
      box-sizing: border-box;
    }
    .box {
      background: #ffffff;
      border-radius: 14px;
      padding: 12px;
      box-shadow: 0 2px 8px rgba(15,23,42,0.06);
      margin-bottom: 12px;
      box-sizing: border-box;
    }

    button {
      font-size: 25px;
      border-radius: 999px;
      padding: 6px 10px;
      border: 1px solid #d1d5db;
      background: #ffffff;
      cursor: pointer;
    }
    button:active {
      transform: scale(0.97);
    }
    button.selected {
      background: #111827;
      color: #ffffff;
      border-color: #111827;
    }

    .chip-row {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      justify-content: center;
    }

    .filter-bar {
      display: flex;
      gap: 12px;
      justify-content: center;
      margin-bottom: 12px;
      position: relative;
    }
    .filter-pill {
      border-radius: 999px;
      padding: 6px 10px;
      font-size: 12px;
    }

  #volume-buttons{
    margin-bottom:12px;
  }

    .search-box label {
      display: block;
      font-size: 15px;
      font-weight: 600;
      margin-bottom: 6px;
    }
    .search-row {
      display: flex;
      gap: 8px;
      align-items: center;
    }
    .search-row input {
      flex: 1;
      font-size: 25px;
      padding: 8px 10px;
      border-radius: 10px;
      border: 1px solid #d1d5db;
      box-sizing: border-box;
      background: #ffffff;
    }
    .search-row input:focus {
      outline: none;
      border-color: #2563eb;
      box-shadow: 0 0 0 1px #2563eb33;
      background: #ffffff;
    }
    .search-icon-btn {
      width: 50px;
      height: 50px;
      border-radius: 12px;
      background: #ffffff;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 0;
      font-size: 18px;
      color: #4b5563;
    }

    table {
      width: 100%;
      border-collapse: collapse;
      margin-top: 8px;
      font-size: 25px;
    }
    th, td {
      border: 1px solid #d4d4d8;
      padding: 6px 4px;
      text-align: center;
      word-break: break-word;
    }
    th {
      background: #e5e7eb;
      font-weight: 700;
    }

    .page-title {
      font-size: 30px;
      font-weight: 700;
      margin: 0 0 6px;
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .no-result {
      text-align: center;
      color: #6b7280;
      font-size: 20px;
      margin-top: 14px;
    }

    .dropdown {
      position: absolute;
      top: 40px;
      left: 0;
      min-width: 140px;
      background: #ffffff;
      border-radius: 14px;
      box-shadow: 0 8px 20px rgba(15,23,42,0.18);
      border: 1px solid #e5e7eb;
      padding: 6px 0;
      z-index: 50;
      display: none;
    }
    .dropdown.open {
      display: block;
    }
    .dropdown-item {
      padding: 8px 12px;
      font-size: 20px;
      cursor: pointer;
    }
    .dropdown-item:hover {
      background: #f3f4f6;
    }

    .modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(15,23,42,0.35);
      display: none;
      align-items: flex-end;
      justify-content: center;
      z-index: 60;
    }
    .modal-overlay.open {
      display: flex;
    }
    .modal-sheet {
      width: 100%;
      max-height: 70vh;
      background: #ffffff;
      border-radius: 16px 16px 0 0;
      padding: 12px 16px 16px;
      box-sizing: border-box;
      overflow-y: auto;
    }
    .modal-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 8px;
      font-size: 20px;
      font-weight: 600;
    }
    .keyword-group-title {
      margin: 16px 0 8px;
      font-size: 20px;
      font-weight: 700;
    }
    .keyword-grid {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-bottom: 8px;
    }
    .keyword-pill {
      border-radius: 999px;
      padding: 5px 9px;
      font-size: 18px;
      border: 1px solid #d1d5db;
      background: #ffffff;
    }
.keyword-pill.selected {
  background: #111827;
  color: #ffffff;
  border-color: #111827;
}

.keyword-inline-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 4px;
}
.keyword-inline-panel .keyword-group-title {
  flex: 0 0 54px;
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.keyword-inline-panel .keyword-grid {
  display: flex;
  flex: 1;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  margin: 0;
  padding: 1px 0 6px;
  scrollbar-width: none;
}
.keyword-inline-panel .keyword-grid::-webkit-scrollbar {
  display: none;
}
.keyword-inline-panel .keyword-pill {
  flex: 0 0 auto;
  padding: 5px 9px;
  font-size: 13px;
  white-space: nowrap;
}
.keyword-inline-panel .keyword-group-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.keyword-inline-actions {
  display: flex;
  justify-content: flex-end;
  margin: 4px 0 10px;
}
.keyword-inline-actions button {
  padding: 5px 9px;
  font-size: 13px;
}

    .wish-top {
      display: flex;
      flex-direction: column;
      gap: 6px;
      font-size: 20px;
    }
    .wish-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 6px;
    }
    .cart-input {
      display: flex;
      gap: 6px;
      align-items: center;
    }
    .cart-input input {
      width: 90px;
      padding: 5px 8px;
      font-size: 25px;
      border-radius: 8px;
      border: 1px solid #d1d5db;
      box-sizing: border-box;
    }

.footer {
  margin: 24px 0 16px;
  padding: 8px 0;
  text-align: center;
  font-size: 11px;
  color: #999;
}

.footer a {
  color: #666;
  text-decoration: none;
  font-weight: 500;
}

/* Tables */
.result-table-5,
.result-table-4,
.up-table {
  table-layout: fixed;
}

.result-table-5 th:nth-child(1),
.result-table-5 td:nth-child(1) { width: 8%; }
.result-table-5 th:nth-child(2),
.result-table-5 td:nth-child(2) { width: 47%; }
.result-table-5 th:nth-child(3),
.result-table-5 td:nth-child(3) { width: 20%; }
.result-table-5 th:nth-child(4),
.result-table-5 td:nth-child(4) { width: 10%; }
.result-table-5 th:nth-child(5),
.result-table-5 td:nth-child(5) { width: 15%; }

.up-table th:nth-child(1),
.up-table td:nth-child(1) { width: 5%; }
.up-table th:nth-child(2),
.up-table td:nth-child(2) { width: 40%; }
.up-table th:nth-child(3),
.up-table td:nth-child(3) { width: 20%; }
.up-table th:nth-child(4),
.up-table td:nth-child(4) { width: 15%; }
.up-table th:nth-child(5),
.up-table td:nth-child(5) { width: 15%; }

.table-card table {
  width: 100%;
  border-collapse: collapse;
}

.table-card th,
.table-card td {
  border-bottom: 1px solid #e5e5e5;
  padding: 10px 12px;
}

.table-card tr:last-child td {
  border-bottom: none;
}

.table-card{
  background:#fff;
  border-radius:16px;
  overflow:hidden;
  border:1px solid #e5e7eb;
  box-shadow:0 4px 12px rgba(15,23,42,0.06);
  margin:16px 0;
}

.table-inner{
  padding:12px;
}

.table-inner table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:12px;
  overflow:hidden;
}

.table-inner th,
.table-inner td{
  border:0;
  border-right:1px solid #e5e7eb;
  border-bottom:1px solid #e5e7eb;
  padding:10px 8px;
  vertical-align:middle;
  word-break:break-word;
}

.table-inner thead th{
  background:#f3f4f6;
  font-weight:700;
  text-align:center;
}

.table-inner tbody td{
  text-align:center;
}

.table-inner thead th:first-child{ border-top-left-radius:12px; }
.table-inner thead th:last-child { border-top-right-radius:12px; }

.table-inner tbody tr:last-child td:first-child{ border-bottom-left-radius:12px; }
.table-inner tbody tr:last-child td:last-child { border-bottom-right-radius:12px; }

.table-inner tr > *:last-child{
  border-right:0;
}

.table-inner tbody tr:last-child td{
  border-bottom:0;
}

.result-table-4,
.result-table-5 {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
}

.result-table-4 thead tr:first-child th:first-child,
.result-table-5 thead tr:first-child th:first-child {
  border-top-left-radius: 12px;
}

.result-table-4 thead tr:first-child th:last-child,
.result-table-5 thead tr:first-child th:last-child {
  border-top-right-radius: 12px;
}

.result-table-4 tr:first-child th:first-child,
.result-table-5 tr:first-child th:first-child {
  border-top-left-radius: 12px;
}

.result-table-4 tr:first-child th:last-child,
.result-table-5 tr:first-child th:last-child {
  border-top-right-radius: 12px;
}

.result-table-4 tr:first-child td:first-child,
.result-table-5 tr:first-child td:first-child {
  border-top-left-radius: 12px;
}

.result-table-4 tr:first-child td:last-child,
.result-table-5 tr:first-child td:last-child {
  border-top-right-radius: 12px;
}

.result-table-4 tbody tr:last-child td:first-child,
.result-table-5 tbody tr:last-child td:first-child {
  border-bottom-left-radius: 12px;
}

.result-table-4 tbody tr:last-child td:last-child,
.result-table-5 tbody tr:last-child td:last-child {
  border-bottom-right-radius: 12px;
}

.result-table-4 th,
.result-table-4 td,
.result-table-5 th,
.result-table-5 td {
  border: 1px solid #e5e7eb;
}

.main-sort-buttons{
  margin: 10px 2px 14px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.result-table-5 td:first-child button,
.up-table td:first-child button {
  all: unset;
  font-size: 30px;
  cursor: pointer;
  line-height: 1;
}

.result-table-5 td:first-child,
.up-table td:first-child {
  text-align: center;
  vertical-align: middle;
  width: 44px;
}

input[type="checkbox"] {
  width: 20px;
  height: 20px;
  transform: scale(1.5);
  cursor: pointer;
}

.header-icons .icon-btn {
  font-size: 50px;
  padding: 10px 14px;
  min-width: 44px;
  min-height: 44px;

  border: none;
  background: transparent;
  cursor: pointer;

  line-height: 1;
}

@media (max-width: 520px) {

  .table-card { padding: 12px; border-radius: 18px; }

  .table-inner thead { display: none; }

  .table-inner table{
    border-radius: 16px;
    overflow: hidden;
  }

  .table-inner tbody tr{
    display: grid;
    grid-template-columns: 44px 1fr;
    grid-template-areas:
      "star title"
      "star meta";
    gap: 6px 10px;
    padding: 12px 10px;
    border-bottom: 1px solid #e5e7eb;
  }
  .table-inner tbody tr:last-child{ border-bottom: 0; }

  .table-inner td{
    border: 0 !important;
    padding: 0 !important;
    background: transparent !important;
  }

  .table-inner td:nth-child(1){
    grid-area: star;
    display:flex;
    align-items:center;
    justify-content:center;
  }

  .table-inner td:nth-child(2){
    grid-area: title;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
  }

  .table-inner td:nth-child(3),
  .table-inner td:nth-child(4),
  .table-inner td:nth-child(5){
    grid-area: meta;
    display:inline-block;
    margin-right: 10px;
    font-size: 13px;
    color: #6b7280;
    font-weight: 600;
  }

  .table-inner td:nth-child(4){ color:#111827; }

  .table-inner td:nth-child(5){ color:#111827; }

  .table-inner td:nth-child(1) button{
    border: 0 !important;
    background: transparent !important;
    padding: 0 !important;
    font-size: 22px !important;
    line-height: 1 !important;
  }
}

/* Mobile book list */
.mobile-wrap{
  background:#fff;
  border-radius:16px;
  border:1px solid #e5e7eb;
  overflow:hidden;
}

.book-row{
  display:grid;
  grid-template-columns: 44px 1fr;
  gap:10px;
  padding:14px 14px;
  border-bottom:1px solid #e5e7eb;
  align-items:start;
}
.book-row:last-child{ border-bottom:0; }

.book-star{
  width:34px;
  height:34px;
  border:0;
  background:transparent;
  font-size:28px;
  line-height:1;
  cursor:pointer;
  padding:0;
  display:flex;
  align-items:center;
  justify-content:center;
}

.book-main{ min-width:0; }
.book-top{
  display:flex;
  gap:10px;
  align-items:flex-start;
  justify-content:space-between;
}
.book-title{
  font-size:16px;
  font-weight:700;
  color:#111827;
  line-height:1.25;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.book-author{
  font-size:14px;
  color:#111827;
  white-space:nowrap;
  flex:0 0 auto;
}

.book-sub{
  margin-top:6px;
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between;
  font-size:14px;
  color:#6b7280;
}
.book-sub-left{
  display:flex;
  gap:8px;
  align-items:center;
}
.badge-discount{
  color:#ef4444;
  font-weight:700;
}
.price{
  color:#111827;
  font-weight:600;
}

.title-link,
.title-link:visited,
.title-link:hover,
.title-link:active{
  color:#111827 !important;
  text-decoration:none !important;
}

@media (max-width: 520px){
  .result-table-5, .result-table-4{ display:none; }
}

.mobile-list{
  display:flex;
  flex-direction:column;
  gap:0;
}

.mobile-row{
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px 12px;
  background:#fff;
  border-bottom:1px solid #e5e7eb;
}

.mobile-left{
  width:44px;
  display:flex;
  justify-content:center;
  align-items:center;
}

.star-btn{
  border:none;
  background:transparent;
  font-size:22px;
  line-height:1;
  cursor:pointer;
}

.mobile-mid{
  flex:1;
  min-width:0;
}

.mobile-title{
  font-size:16px;
  font-weight:700;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.mobile-author{
  margin-top:4px;
  font-size:14px;
  color:#6b7280;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.mobile-right{
  text-align:right;
  min-width:88px;
}

.mobile-discount{
  font-size:14px;
  font-weight:700;
  color:#ef4444;
}

.mobile-price{
  margin-top:4px;
  font-size:14px;
  color:#111827;
}

.buy-chk{
  width: 22px;
  height: 22px;
  transform: translateY(1px);
}

.mobile-row-up .mobile-price{
  color:#6b7280;
  font-weight:600;
  font-size:13px;
}

/* Header and main controls */
.topbar{
  padding: 18px 14px 10px;
  background: transparent;
}

.topbar-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
}

.topbar-text{
  min-width: 0;
}

.topbar-title{
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -0.4px;
  color:#111827;
  line-height: 1.05;
}

.topbar-subtitle{
  margin-top: 6px;
  font-size: 13px;
  font-weight: 650;
  color:#6b7280;
}

.topbar-actions{
  display:flex;
  gap: 6px;
  align-items:center;
}

.topbar-icon{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 0;
  background: transparent;
  font-size: 26px;
  line-height: 1;
  padding: 0;
}

.search-wrap{
  padding: 10px 12px 16px;
}

.search-pill{
  display:flex;
  align-items:center;
  gap: 10px;
  background:#ffffff;
  border:1px solid #e5e7eb;
  border-radius: 18px;
  padding: 10px 12px;
  box-shadow: 0 2px 8px rgba(15,23,42,0.06);
}

.search-ico{
  font-size: 18px;
  opacity: 0.75;
}

.search-input{
  flex:1;
  border:0;
  outline:none;
  font-size: 16px;
  background: transparent;
  padding: 0;
}

.search-go{
  border:0;
  background:#111827;
  color:#fff;
  font-weight:800;
  font-size: 14px;
  padding: 10px 14px;
  border-radius: 14px;
}

.search-go:active{ transform: scale(0.98); }

body{
  background:#fff !important;
}

.topbar{
  background:#fff;
  padding: 14px 14px 10px;
}

.topbar-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}

.event-title{
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
  margin: 0;
}

.event-period{
  font-size: 12px;
  color:#6b7280;
  margin-top: 4px;
}

.topbar-icons{
  display:flex;
  gap:10px;
}

.icon-btn{
  width:44px;
  height:44px;
  border:0;
  background:transparent;
  font-size:26px;
  padding:0;
}

.tabs{
  display:flex;
  gap:10px;
  overflow-x:auto;
  padding: 10px 2px 6px;
  -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar{ display:none; }

.tabs-btn{
  border:0;
  background:transparent;
  font-size:18px;
  font-weight:700;
  padding: 6px 2px;
  color:#111827;
  white-space:nowrap;
  opacity:.55;
}
.tabs-btn.active{
  opacity:1;
  border-bottom:3px solid #111827;
}

.topbar-actions{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding: 6px 0 10px;
}
.pill-btn{
  border:1px solid #d1d5db;
  background:#fff;
  border-radius:999px;
  padding:8px 14px;
  font-size:14px;
}

.search-wrap{ padding: 8px 0 8px; }

.search-pill{
  display:flex;
  align-items:center;
  gap:10px;
  border:1px solid #e5e7eb;
  border-radius:14px;
  padding:10px 12px;
  background:#fff;
}

.search-input{
  border:0;
  outline:none;
  width:100%;
  font-size:15px;
}

.search-go{
  border:0;
  background:transparent;
  font-size:22px;
  padding:0 6px;
}

#discount-buttons,
#volume-buttons{
  display:flex;
  flex-wrap:nowrap;
  gap:6px;
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling:touch;
  white-space:nowrap;
  padding:6px 12px 4px;
}

#discount-buttons::-webkit-scrollbar,
#volume-buttons::-webkit-scrollbar{
  display:none;
}

.tabs-btn{
  flex:0 0 auto;
  border:0;
  background:transparent;
  font-size:18px;
  font-weight:700;
  padding:6px 2px;
  color:#111827;
  opacity:.55;
}
.tabs-btn.active{
  opacity:1;
  border-bottom:3px solid #111827;
}

.app-content{
  padding: 10px 60px !important;
}

.topbar{
  padding: 40px 0 10px !important;
}
.topbar-row{
  padding: 0 75px !important;
}

.topbar-title{
  font-size: 45px !important;
  margin: 0 0 2px 0 !important;
}
.topbar-subtitle{
  font-size: 16px !important;
  margin: 0 !important;
}

#view-main .box{
  margin-top: 0 !important;
  padding-top: 6px !important;
}

#discount-buttons{
  padding: 8px 0 12px !important;
  gap: 10px !important;
}
.tabs-btn{
  font-size: 30px !important;
  padding: 8px 24px !important;
}

.filter-bar{
  margin: 6px 0 8px !important;
}

.search-row{
  margin-top: 6px !important;
}

.filter-bar{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.topbar-actions .topbar-icon{
  font-size: 40px !important;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;

  padding: 0 !important;
  border: none !important;
  background: transparent !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
}

#view-main {
  font-size: 17px;
}

#view-main .book-row {
  padding: 14px 0 !important;
}

#view-main .book-title {
  font-size: 18px !important;
  line-height: 1.4 !important;
  font-weight: 600;
}

#view-main .book-author {
  font-size: 15px !important;
  margin-top: 4px;
}

#view-main .book-discount {
  font-size: 15px !important;
  font-weight: 600;
}

#view-main .book-price {
  font-size: 16px !important;
  font-weight: 600;
}

.mobile-list{
  font-size: 16px !important;
}

.mobile-list *{
  font-size: inherit !important;
  line-height: 1.4 !important;
}

.mobile-list > *{
  padding: 12px 12px !important;
}

.mobile-list .title-link,
.mobile-list .book-title{
  font-size: 1.05em !important;
  font-weight: 600 !important;
}

.mobile-list button{
  font-size: 1.4em !important;
  width: 44px !important;
  height: 44px !important;

  padding: 0 !important;
  border: none !important;
  background: transparent !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
}

#view-wishlist button,
#wishlistResult button {
  display: none !important;
}

#view-up .filter-pill,
#view-up .sort-button,
#view-up .sort-item {
  font-size: 14px !important;
  padding: 6px 10px !important;
  border-radius: 8px;
}

/* Wishlist controls */
.wish-input{
  flex:1;
  padding:8px 10px;
  font-size:14px;
  border-radius:10px;
  border:1px solid #d1d5db;
}

.wish-add-btn{
  padding:8px 14px;
  font-size:14px;
  font-weight:700;
  border-radius:999px;
  border:0;
  background:#111827;
  color:#fff;
}

.wish-search-wrap{
  margin-top:10px;
}

.wish-add-wrap{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-top:14px;
  padding-top:14px;
  border-top:1px solid #e5e7eb;
}

.wish-add-row{
  display:flex;
  gap:8px;
}

.wish-add-row .wish-input{
  min-width:0;
}

.wish-search-row{
  display:flex;
  gap:8px;
}

.wish-search-status{
  min-height:20px;
  padding:6px 2px 2px;
  font-size:13px;
  color:#6b7280;
}

.wish-search-status.is-error{
  color:#b91c1c;
}

.wish-search-status.is-success{
  color:#047857;
}

.wish-search-results{
  display:flex;
  flex-direction:column;
  margin-top:4px;
}

.wish-search-result{
  width:100%;
  display:flex;
  align-items:center;
  padding:16px 0;
  border-bottom:1px solid #e5e7eb;
  background:#fff;
  color:#111827;
  text-align:left;
}

.wish-search-result:hover{
  background:#f9fafb;
}

.wish-search-star{
  flex:0 0 auto;
  width:34px;
  height:34px;
  margin-right:10px;
  padding:0;
  border:0;
  background:transparent;
  color:#d1d5db;
  font-size:26px !important;
  line-height:1;
  cursor:pointer;
}

.wish-search-star.saved{
  color:#f59e0b;
}

.wish-search-info{
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:4px;
}

.wish-search-title{
  min-width:0;
  overflow:hidden;
  color:#111827;
  font-size:16px;
  font-weight:600;
  line-height:1.3;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.wish-search-author{
  color:#6b7280;
  font-size:14px;
}

@media (max-width:520px){
  .wish-search-title{
    font-size:14px;
  }

  .wish-search-author{
    font-size:12px;
  }
}

.wish-clear-btn {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #374151;
}

.sheet-tabs{
  display:flex;
  gap:16px;
  overflow-x:auto;
  padding: 6px 0 10px;
  -webkit-overflow-scrolling: touch;
  white-space: nowrap;
}
.sheet-tabs::-webkit-scrollbar{ display:none; }

.sheet-tab{
  flex:0 0 auto;
  border:0;
  background:transparent;
  font-size:22px;
  font-weight:700;
  padding:6px 4px;
  opacity:.45;
  cursor:pointer;
}
.sheet-tab.active{
  opacity:1;
  border-bottom:3px solid #111827;
}

.bought-arrow {
  all: unset;
  width: 28px;
  height: 28px;
  min-width: 28px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  font-size: 16px;
  font-weight: 700;
  color: #111827;

  cursor: pointer;
}

.title-meta{
  font-size: 20px !important;
  color: #9ca3af;
  font-weight: 500;
  margin-left: 6px;
}

.keyword-pill.excluded{
  background:#fee2e2;
  color:#991b1b;
  border-color:#fca5a5;
}

@media (max-width: 520px){
  .topbar{
    display: block !important;
    position: relative !important;
    z-index: 20;
    padding: 14px 16px 10px !important;
  }

  .topbar-subtitle{
    font-size: 13px !important;
  }
}

@media (max-width: 520px){
  .sheet-tabs,
  #discount-buttons,
  #volume-buttons{
    display:flex;
    gap:6px;
    padding:6px 12px;
    overflow-x:auto;
    justify-content: flex-start;
  }

  .sheet-tab,
  .tabs-btn{
    font-size: 15px !important;
    padding: 4px 0 !important;
    border: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
    opacity: .4;
    white-space: nowrap;
  }

  .sheet-tab.active,
  .tabs-btn.active{
    opacity: 1;
    border-bottom: 2px solid #111827;
  }
}

@media (max-width: 520px){
  .search-row{
    padding: 0 12px;
    margin-bottom: 14px !important;
    gap: 6px;
  }

  .search-row input{
    font-size: 15px;
    padding: 10px 12px;
  }

  .search-icon-btn{
    width: 36px;
    height: 36px;
    font-size: 16px;
    flex-shrink: 0;
  }
}

@media (max-width: 520px){

  .mobile-row{
    display: grid !important;
    grid-template-columns: 44px 1fr;
    grid-template-areas:
      "star title"
      "star meta";
    row-gap: 6px;
    padding: 14px 12px;
    border-top: 1px solid #e5e7eb;
  }

  .mobile-left{
    grid-area: star;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 4px;
  }

  .mobile-mid{
    grid-area: title;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
  }

  .mobile-title{
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
    white-space: normal;
    word-break: keep-all;
    flex: 1;
  }

  .mobile-author{
    font-size: 13px;
    color: #6b7280;
    white-space: nowrap;
    flex-shrink: 0;
    text-align: right;
  }

  .mobile-right{
    grid-area: meta;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
  }

  .title-meta{
    font-size: 12px;
    color: #9ca3af;
    white-space: nowrap;
  }

  .mobile-right .meta-right{
    display: flex;
    gap: 8px;
    align-items: center;
  }

  .mobile-discount{
    color: #ef4444;
    font-weight: 700;
    white-space: nowrap;
  }

  .mobile-price{
    color: #111827;
    font-weight: 600;
    white-space: nowrap;
  }

}

@media (max-width: 520px){
  .title-meta{
    font-size: 10px;
  }
}

@media (max-width: 520px){
  .mobile-right{
    flex-wrap: nowrap;
    align-items: center;
  }

  .title-meta{
    font-size: 10px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .meta-right{
    display: flex;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .mobile-discount{
    font-size: 12px;
  }

  .mobile-price{
    font-size: 12px;
  }
}

@media (max-width: 520px){
  .mobile-row{
    grid-template-columns: 32px 1fr;
  }

  .mobile-left{
    padding-top: 2px;
  }

  .star-btn{
    font-size: 18px;
    line-height: 1;
  }
}

@media (max-width: 520px){

  .mobile-row{
    display: grid !important;
    grid-template-columns: 20px 1fr !important;
    grid-template-areas:
      "star title"
      "star meta" !important;
    row-gap: 4px !important;
    padding: 12px 10px !important;
  }

  .mobile-left{
    width: 28px !important;
    padding-top: 2px !important;
  }

  .star-btn{
    font-size: 14px !important;
    line-height: 1 !important;
  }

  .mobile-mid{
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 6px !important;
  }

  .mobile-title{
    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
    white-space: normal !important;
    flex: 1 !important;
  }

  .mobile-author{
    font-size: 12px !important;
    color: #6b7280 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    text-align: right !important;
  }

  .mobile-right{
    display: flex !important;
    justify-content: space-between !important;
    align-items: baseline !important;
    flex-wrap: nowrap !important;
    font-size: 10px !important;
  }

  .title-meta{
    font-size: 10px !important;
    color: #9ca3af !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  .meta-right{
    display: flex !important;
    gap: 6px !important;
    align-items: baseline !important;
    white-space: nowrap !important;
  }

  .mobile-discount{
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #ef4444 !important;
  }

  .mobile-price{
    font-size: 10px !important;
    font-weight: 600 !important;
    color: #111827 !important;
  }
}

@media (max-width: 520px){
  #view-wish .page-title{
    font-size: 18px !important;
    font-weight: 700;
  }
}

@media (max-width: 520px){
  #wishTotal{
    font-size: 14px !important;
    font-weight: 600;
  }
}

@media (max-width: 520px){
  #view-wish .wish-row:last-of-type{
    flex-wrap: wrap;
  }

  .wish-add-btn{
    flex-shrink: 0;
  }
}

@media (max-width: 520px){
  #view-wish .filter-pill{
    font-size: 13px !important;
    padding: 6px 10px !important;
  }
}

@media (max-width: 520px){
  .buy-chk{
    width: 16px !important;
    height: 16px !important;
    transform: scale(1) !important;
  }
}

@media (max-width: 520px){
  #view-up .page-title{
    font-size: 18px !important;
    font-weight: 700;
  }
}

@media (max-width: 520px){
  #view-up .sort-button{
    font-size: 13px !important;
    padding: 6px 10px !important;
    border-radius: 8px;
  }
}

@media (max-width: 520px){
  .dropdown-item{
    font-size: 14px !important;
    padding: 8px 12px !important;
  }
}

@media (max-width: 520px){
  .keyword-pill{
    font-size: 13px !important;
    padding: 6px 10px !important;
  }

  .keyword-group-title{
    font-size: 15px !important;
  }
}

@media (max-width: 520px){
  .keyword-action,
  .keyword-reset{
    font-size: 13px !important;
    padding: 6px 10px !important;
    border-radius: 14px !important;
  }
}

@media (max-width: 520px){
  .wishlist-total{
    font-size: 14px !important;
  }

  .wishlist-total .label{
    font-size: 14px !important;
  }

  .wishlist-total .price{
    font-size: 14px !important;
    font-weight: 600;
  }
}

@media (max-width: 520px){
  #keywordModal button,
  #wishKeywordModal button{
    font-size: 13px !important;
    padding: 6px 10px !important;
    border-radius: 14px !important;
  }
}

@media (max-width: 520px){
  #view-wish .wish-row > div{
    font-size: 14px !important;
    font-weight: 500;
  }

  #wishTotal{
    font-size: 14px !important;
    font-weight: 600;
  }
}

.app-content{
  padding: 50px 72px !important;
}

.topbar-row{
  padding: 0 72px !important;
}

.sheet-tab{
  color: #9ca3af !important;
  opacity: 1 !important;
}

.sheet-tab.active{
  color: #111827 !important;
  border-bottom: 3px solid #111827 !important;
}

.tabs-btn{
  color: #9ca3af !important;
  opacity: 1 !important;
}

.tabs-btn.active{
  color: #111827 !important;
  border-bottom: 3px solid #111827 !important;
}

.filter-pill{
  color: #111827 !important;
  font-weight: 600;
}

.dropdown-item{
  color: #111827 !important;
}

.keyword-pill{
  color: #111827 !important;
}

.star-btn{
  color: #9ca3af !important;
}

.star-btn.saved{
  color: #f59e0b !important;
}

@media (max-width: 520px){
  .app-content{
    padding: 14px 18px !important;
  }

  .topbar-row{
    padding: 0 !important;
  }
}

/* Keyword modal states */
.keyword-pill.selected{
  background: #111827 !important;
  color: #ffffff !important;
  border-color: #111827 !important;
  font-weight: 500 !important;
}

.keyword-pill.excluded{
  background:#fee2e2 !important;
  color:#991b1b !important;
  border-color:#fca5a5 !important;
  font-weight: 500 !important;
}

.keyword-pill{
  font-weight: 500 !important;
}

#keywordModal button,
#wishKeywordModal button{
  color: #111827 !important;
  font-weight: 400 !important;
}

#keywordModal .keyword-pill.selected,
#wishKeywordModal .keyword-pill.selected{
  background-color: #111827 !important;
  color: #ffffff !important;
  border-color: #111827 !important;
  font-weight: 500 !important;
}

#keywordModal .keyword-pill,
#wishKeywordModal .keyword-pill{
  font-weight: 400 !important;
  color: #111827 !important;
}

#keywordModal .keyword-pill.excluded,
#wishKeywordModal .keyword-pill.excluded{
  background:#fee2e2 !important;
  color:#991b1b !important;
  border-color:#fca5a5 !important;
}

/* Layout overrides */
html body .app-content{
  padding-left: 96px !important;
  padding-right: 96px !important;
}

html body .topbar-row{
  padding-left: 96px !important;
  padding-right: 96px !important;
}

@media (max-width: 520px){
  html body .app-content{
    padding-left: 24px !important;
    padding-right: 24px !important;
  }

  html body .topbar-row{
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

html body .search-row{
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;

  width: 100% !important;
  box-sizing: border-box;
}

html body .search-row input{
  width: 100% !important;
  border-radius: 14px;
}

html body .search-icon-btn{
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;

  width: auto !important;
  height: auto !important;
  padding: 0 6px !important;

  font-size: 20px;
  color: #6b7280;
}

html body .search-icon-btn:active{
  transform: none !important;
}

@media (max-width: 520px){
  html body .search-row{
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

html body .mobile-mid{
  align-items: baseline !important;
}

html body .mobile-title{
  line-height: 1.35 !important;
  margin: 0 !important;
  padding: 0 !important;
}

html body .mobile-author{
  line-height: 1.35 !important;
  margin: 0 !important;
  padding: 0 !important;

  position: relative;
  top: 0.05em;
}

html body .mobile-mid{
  padding-left: 0 !important;
}

html body .mobile-title{
  position: relative;
  left: 0.55em;
}

html body .mobile-author{
  position: relative;
  left: 0.55em;
}

html body .title-meta{
  margin-left: 0 !important;
}

html body .mobile-title,
html body .mobile-author{
  position: relative;
  left: 0.35em !important;
}

html body .sheet-tabs,
html body #discount-buttons{
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

html body .sheet-tab,
html body .tabs-btn{
  margin-left: 0 !important;
}

html body .discount-scroll,
html body .chip-row{
  padding-left: 0 !important;
  margin-left: 0 !important;
}

.mobile-mid {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Book row alignment */
.mid-top,
.mid-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mobile-title,
.mobile-author {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.title-meta,
.mobile-price {
  flex-shrink: 0;
  margin-left: 8px;
}

.mid-top,
.mid-bottom {
  display: flex;
  align-items: center;
  width: 100%;
}

.mid-top .mobile-title {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
}

.mid-top .title-meta {
  flex: 0 0 auto;
  margin-left: auto;
  text-align: right;
  white-space: nowrap;
}

.mid-bottom .mobile-author {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left !important;
}

.mid-bottom .mobile-price-line {
  flex: 0 0 auto;
  margin-left: auto;
  text-align: right;
  white-space: nowrap;
}

.mobile-row-up .mobile-price-line .up-diff {
  margin-left: 4px;
  font-size: 10px !important;
  font-weight: 400 !important;
  color: #9ca3af !important;
  line-height: 1 !important;
}

/* Up page */
#view-up .sort-button{
  font-size: 10px !important;
  padding: 4px 8px !important;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #d1d5db;
  color: #111827 !important;
  font-weight: 500;
}

#view-up .sort-button:active{
  transform: scale(0.96);
}

.main-title-text,
.section-title {
  display: none;
}

.main-top,
.main-header {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

#sheet-tabs {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.main-top,
.main-top > *,
#view-main > .main-top {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

@media (max-width: 520px) {
  #view-main .main-top {
    margin-top: -20px !important;
  }
}

.buy-chk {
  accent-color: #6b7280;
}

#wishlistResult .combo-card {
  margin-top: 12px;
}

#view-wish .filter-pill {
  margin-bottom: 12px;
}

@media (max-width: 520px){
  .mobile-title.title-link{
    font-size: 14px !important;
    line-height: 1.3 !important;
    font-weight: 600 !important;
  }
}

@media (max-width: 520px){
  .mobile-price-line{
    font-size: 12px !important;
    color: #9ca3af;
    font-weight: 400;
  }
}

header.topbar {
  margin-bottom: 0;
  padding: 0;
}

header.topbar .topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 14px 28px 6px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.home-btn {
  border: 0;
  background: transparent;
  padding: 4px;
  display: flex;
  align-items: center;
  cursor: pointer;
  color: #111827 !important;
}

.topbar-title {
  font-size: 20px;
  font-weight: 600;
}

header.topbar {
  margin-bottom: 0 !important;
  padding: 0 !important;
}

header.topbar .topbar-row {
  padding-top: 10px !important;
  padding-bottom: 6px !important;
  padding-left: 25px !important;
  padding-right: 16px !important;
}

.home-btn {
  padding: 4px !important;
}

.home-btn svg {
  width: 17px !important;
  height: 17px !important;
}

header.topbar .topbar-title {
  font-size: 18px !important;
  line-height: 1.2;
}

.topbar-actions .topbar-icon {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  min-height: 28px !important;

  font-size: 18px !important;
  padding: 0 !important;
  padding-right: 2px !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
}

@media (max-width: 520px){

  .mid-bottom{
    display: grid !important;
    grid-template-columns: 1fr auto;
    column-gap: 8px;
    align-items: start !important;
  }

  .mobile-author{
    white-space: normal !important;
    overflow: hidden !important;

    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;

    line-height: 1.3 !important;
  }

  .mobile-price-line,
  .mobile-price{
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    text-align: right;
  }

}

/* Cart and graph modals */
.modal-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
}

.combo-chk {
  width:14px !important;
  height:14px !important;
  accent-color:#111;
  zoom:0.8;
}

.combo-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.combo-head strong {
  font-size: 15px;
  font-weight: 600;
}

.combo-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 14px 14px;
  margin-top: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  border: 1px solid #f1f3f5;
  transition: box-shadow 0.2s ease;
}

.combo-card:first-child {
  margin-top: 0;
}

.combo-price {
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
}

#cartResult .wish-row {
  display:flex !important;
  justify-content:space-between !important;
  align-items:center !important;
  padding-left:0 !important;
}

#cartResult .mobile-row {
  display:grid !important;
  grid-template-columns: 1fr !important;
  grid-template-areas:
    "title"
    "meta" !important;
}

input,
select,
textarea {
  font-size: 16px !important;
}

.graph-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}
.graph-modal-content {
  width: 92%;
  max-width: 900px;
  max-height: 85vh;
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  position: relative;
}
.graph-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: none;
  font-size: 24px;
  cursor: pointer;
}
#graph-filter button {
  border: 1px solid #e5e7eb;
  background: #ffffff;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
}
#graph-filter button:hover {
  background: #e5e7eb;
}

.book-hit-area {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.book-hit-area:hover,
.book-hit-area.is-pressed {
  background: #f9fafb;
}
