/* Novel Tracker — frontend */
.nt-wrapper {
  --nt-fg: #1a1a1a;
  --nt-fg-muted: #555;
  --nt-bg: #fff;
  --nt-bg-2: #f8f9fa;
  --nt-border: #e6e8eb;
  --nt-accent: #0b6bcb;
  --nt-accent-h: #095396;
  --nt-progress: linear-gradient(90deg, #0891b2, #2563eb);
  --nt-radius: 8px;
  --nt-radius-sm: 6px;
  --nt-space: 12px;
  --nt-space-sm: 8px;
  max-width: 1100px;
  margin: 1.25rem auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, sans-serif;
  color: var(--nt-fg);
  font-size: 15px;
}

.nt-header {
  background: var(--nt-bg);
  border: 1px solid var(--nt-border);
  border-radius: var(--nt-radius);
  padding: var(--nt-space) 1rem;
  margin-bottom: var(--nt-space);
}

.nt-title {
  margin: 0 0 4px;
  font-size: 1.25rem;
  font-weight: 600;
}

.nt-week {
  font-size: 0.9rem;
  color: var(--nt-fg-muted);
  margin-bottom: var(--nt-space-sm);
}

.nt-status-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--nt-space-sm);
}

.nt-status-btn {
  padding: 6px 12px;
  font-size: 0.9rem;
  color: var(--nt-fg);
  background: #fff;
  border: 1px solid #ddd;
  border-radius: var(--nt-radius-sm);
  text-decoration: none;
  box-shadow: none;
}

.nt-status-btn:hover { color: var(--nt-accent); border-color: var(--nt-accent); }
.nt-status-btn.nt-status-active {
  color: #fff;
  font-weight: 600;
  background: var(--nt-accent);
  border-color: var(--nt-accent);
  box-shadow: 0 1px 4px rgba(11, 107, 203, 0.35);
}

.nt-actions { margin-top: var(--nt-space-sm); }

.nt-search-form { display: inline-block; }

.nt-filter {
  width: 100%;
  max-width: 280px;
  padding: 10px 12px;
  border: 1px solid var(--nt-border);
  border-radius: var(--nt-radius-sm);
  font-size: 1rem;
  background: var(--nt-bg);
}

.nt-filter:focus {
  outline: none;
  border-color: var(--nt-accent);
  box-shadow: 0 0 0 3px rgba(11, 107, 203, 0.15);
}

/* Progress */
.nt-progress {
  background: var(--nt-bg);
  border: 1px solid var(--nt-border);
  border-radius: var(--nt-radius);
  padding: var(--nt-space) 1rem;
  margin-bottom: var(--nt-space);
}

.nt-progress-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--nt-space-sm);
}

.nt-progress-label {
  font-weight: 600;
  font-size: 0.95rem;
}

.nt-progress-count {
  font-size: 0.9rem;
  color: var(--nt-fg-muted);
  font-weight: 500;
}

.nt-progress-bar {
  height: 10px;
  background: var(--nt-bg-2);
  border-radius: 999px;
  overflow: hidden;
}

.nt-progress-fill {
  height: 100%;
  background: var(--nt-progress);
  border-radius: 999px;
  width: 0;
  transition: width 0.25s ease;
}

/* Table */
.nt-table-wrap {
  background: var(--nt-bg);
  border: 1px solid var(--nt-border);
  border-radius: var(--nt-radius);
  overflow: hidden;
}

.nt-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}

.nt-th-novel { text-align: left; min-width: 200px; }
.nt-th-day   { text-align: center; min-width: 64px; padding: var(--nt-space-sm) 6px; }

.nt-table thead th {
  padding: 5px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--nt-fg-muted);
  background: var(--nt-bg-2);
  border-bottom: 1px solid var(--nt-border);
}

.nt-day-label { display: block; }
.nt-day-num   { display: block; font-size: 0.75rem; color: var(--nt-fg-muted); font-weight: 400; }

.nt-table tbody td {
  padding: 5px;
  border-bottom: 1px solid var(--nt-border);
  vertical-align: middle;
}

.nt-table tbody tr:last-child td { border-bottom: 0; }
.nt-table tbody tr:hover { background: rgba(0,0,0,0.02); }

.nt-td-novel { vertical-align: top; position: relative; }

.nt-novel-meta.nt-accordion-btn {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  cursor: default;
  text-align: left;
  display: block;
}

.nt-td-days { vertical-align: middle; }
.nt-days-inner {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  gap: 4px;
}

.nt-day-cell {
  flex: 1;
  min-width: 0;
  text-align: center;
  padding: 0;
}

.nt-novel-title,
.nt-novel-title a {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.nt-novel-title a {
  color: var(--nt-accent);
  text-decoration: none;
  font-weight: 600;
}

.nt-novel-title a:hover { color: var(--nt-accent-h); text-decoration: underline; }

.nt-novel-meta {
  font-size: 0.8rem;
  color: var(--nt-fg-muted);
  margin-top: 2px;
}


.nt-cell-empty {
  color: #bbb;
  font-size: 0.9rem;
}

.nt-cell-check {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: default;
}

.nt-cell-check input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin: 0;
  cursor: default;
  accent-color: var(--nt-accent);
}

.nt-cell-ch {
  font-size: 0.7rem;
  color: var(--nt-fg-muted);
}

.nt-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--nt-fg-muted);
  background: var(--nt-bg-2);
  border: 1px dashed var(--nt-border);
  border-radius: var(--nt-radius);
}

/* ----- Mobile: accordion for novels, week checks when expanded ----- */
@media (max-width: 900px) {
  .nt-wrapper {
    margin: 1rem 0.75rem;
    font-size: 14px;
    min-width: 0;
    box-sizing: border-box;
  }

  .nt-header { padding: var(--nt-space-sm) 0.75rem; }
  .nt-title { font-size: 1.1rem; }
  .nt-filter { max-width: 100%; box-sizing: border-box; }

  .nt-progress { padding: var(--nt-space-sm) 0.75rem; overflow: visible; }
  .nt-progress-top {
    flex-direction: column;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 2px;
    margin-bottom: var(--nt-space-sm);
  }
  .nt-progress-label { flex-shrink: 0; }
  .nt-progress-count { font-size: 0.9rem; }

  .nt-table-wrap { border-radius: var(--nt-radius-sm); overflow: visible; border: none; }

  .nt-table { display: block; }
  .nt-table thead { display: none; }

  .nt-table tbody tr {
    display: block;
    border: 1px solid var(--nt-border);
    border-radius: var(--nt-radius-sm);
    margin-bottom: var(--nt-space-sm);
    padding: var(--nt-space-sm);
    background: var(--nt-bg);
  }

  .nt-table tbody tr:hover { background: var(--nt-bg); }

  .nt-td-novel {
    display: block;
    padding: 0 0 var(--nt-space-sm);
    margin-bottom: 0;
    border-bottom: none;
    min-width: 0;
  }

  .nt-novel-meta.nt-accordion-btn { cursor: pointer; }

  .nt-td-days {
    display: block;
    padding: 0;
    border: none;
  }

  .nt-days-inner {
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: var(--nt-space-sm);
    border-top: 1px solid var(--nt-border);
    margin-top: var(--nt-space-sm);
  }

  .nt-table tbody tr.nt-accordion-open .nt-days-inner {
    display: flex;
  }

  .nt-day-cell {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    padding: 8px 10px;
    border-radius: var(--nt-radius-sm);
    background: var(--nt-bg-2);
    text-align: left;
  }

  .nt-day-cell::before {
    content: attr(data-day);
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--nt-fg-muted);
    margin-right: 8px;
    text-transform: capitalize;
  }

  .nt-novel-title,
  .nt-novel-title a { word-break: break-word; overflow-wrap: anywhere; }

  .nt-cell-check {
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: nowrap;
  }

  .nt-cell-check input[type="checkbox"] { width: 20px; height: 20px; min-width: 20px; flex-shrink: 0; }
  .nt-day-cell .nt-cell-ch { display: none; }

  .nt-cell-empty { font-size: 0.85rem; }
}
